IHoneyPotPortListner Item( int index ) {get;}
Parameters
- index
- The index of the listener to retrieve.
IHoneyPotPortListner Item( int index ) {get;}
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>(); // Access a HoneyPotPortListener by index IHoneyPotPortListner listener = portScannerService[0]; listener.OnDetecting += (sender, e) => { Console.WriteLine("Ping detected from IP: " + e.IPAddress); }; // Start the service portScannerService.Start(); // Additional logic here } }
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