示例#1
0
        private void onEventLogMessage(EventLogMessage obj)
        {
            // IP of the AuditFailure log should be stored on offset 19

            if (obj.ReplacementStrings.Length < 20)
            {
                return;
            }

            var ip = obj.ReplacementStrings[19];

            if (!IPAddress.TryParse(ip, out var ipAddress))
            {
                return;
            }


            var eventArg = new RDPEventArgs(ip);

            OnAuditFailure?.Invoke(this, new RDPEventArgs(ip));
            if (!eventArg.IsCancel)
            {
                // add the IP to our limit counter
                _auditFailureCounter.Count(ip);
            }
        }
示例#2
0
        private void onAuditFailureLimitReached(string ip)
        {
            var ipAddress = IPAddress.Parse(ip);

            if (ipAddress.IsInRange(_settings.Whitelist))
            {
                // IP is whitelisted
                return;
            }

            var eventArg = new RDPEventArgs(ip);

            OnIPBlocked?.Invoke(this, eventArg);
            if (!eventArg.IsCancel)
            {
                _firewallBlock.Add(ip);
            }
        }
示例#3
0
        private static void onAuditFailureEvent(object sender, RDPEventArgs e)
        {
            //e.IsCancel = true;

            Debug.WriteLine($"Audit Failure ({e.IP})");
        }
示例#4
0
        private static void onIPBlockedEvent(object sender, RDPEventArgs e)
        {
            //e.IsCancel = true;

            Debug.WriteLine($"IP Blocked ({e.IP})");
        }