Walter.Net.HoneyPot
OnPortAccessDetected Event
Example 
Walter.Net.HoneyPot Assembly > Walter.Net.HoneyPot Namespace > IPortScannerDetectionService Interface : OnPortAccessDetected Event
Event that is triggered when a Honey-Pot detection occurs, allowing you to listen to port-related incidents.
Syntax
event EventHandler<HoneyPotDetectionEventArgs> OnPortAccessDetected
Event Data

The event handler receives an argument of type HoneyPotDetectionEventArgs containing data related to this event. The following HoneyPotDetectionEventArgs properties provide information specific to this event.

PropertyDescription
If value is set the socket will answer the text assigned  
Will terminate the connection, set to false if you like to "keep the conversation going" for legal proposes  
Set the value to True if you would like to generate an incident  
The data collected during the detection  
Gets the guard response.  
The port alias that detected the communication  
This will let the service send the file and a command to the attacker  
Remarks
This event is raised whenever there is an attempt to access a monitored port, enabling the implementation of custom logic for handling such incidents.
Example
using Microsoft.Extensions.DependencyInjection;
using System;
            
public class Example
{
    public static void Main()
    {
        // Configure services
        var serviceProvider = new ServiceCollection()
            .UsePortScannerProtection(option =>
            {
                option.Echo = 7;
                option.IgnoreAfterDetection = IgnoreScope.IPAddressAndPort;
            })
            .BuildServiceProvider();
            
        // Retrieve the port scanner detection service
        var portScannerService = serviceProvider.GetRequiredService<IPortScannerDetectionService>();
            
        // Subscribe to the OnPortAccessDetected event
        portScannerService.OnPortAccessDetected += (sender, e) =>
        {
            PortAliasMapper mapped= e.PortAlias;
            IHoneyPotPortDetection data = e.Data; 
            ...
        };
            
        // Start the service
        portScannerService.Start();
            
        // Additional logic here
    }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also