Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            List <Ids.Common.Interfaces.ISensorReport> reporters = new List <Ids.Common.Interfaces.ISensorReport>();

            reporters.Add(new Ids.Common.Reporters.SimpleReportAgent());
            string connectionString = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=IDSDB;Persist Security Info=True;User ID=cyberproduct;Password=x2000; Connect Timeout=600;Max Pool Size = 200;Pooling = True";

            AzureSqlDbReportAgent cloudDbReportAgent = new AzureSqlDbReportAgent(connectionString, String.Empty);

            reporters.Add(cloudDbReportAgent);
            CaptureDeviceDescription cdd = new CaptureDeviceDescription()
            {
                DeviceNumber     = 0,
                TextInDeviceName = "whatever"
            };

            //www.google.com = 216.58.209.100
            //const string googleIpAddress = "216.58.209.100";
            //WebServerDosSensor wds = WebServerDosSensor.FactoryMethod(cdd, googleIpAddress, 443, false, reporters, 5000);
            //cloudDbReportAgent.UpdateSensorId(wds.GetSensorId());
            //wds.StartCapturing();
            //Console.ReadLine();
            //wds.StopCapturing();

            const string       ftpIpAddress = "192.168.1.74";
            FtpServerDosSensor fds          = FtpServerDosSensor.FactoryMethod(cdd, ftpIpAddress, 443, false, reporters, 5000);

            cloudDbReportAgent.UpdateSensorId(fds.GetSensorId());
            fds.StartCapturing();
            Console.ReadLine();
            fds.StopCapturing();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            string connectionString = @"Data Source=UB1NB092\SQL2012;Initial Catalog=AzureIdsDb;Persist Security Info=True;User ID=cyberproduct;Password=x2000; Connect Timeout=600;Max Pool Size = 200;Pooling = True";

            //reporters
            List <IAlertReport>   reporters = new List <IAlertReport>();
            AzureSqlDbReportAgent ara       = new AzureSqlDbReportAgent(connectionString);

            reporters.Add(ara);

            //data agent
            SensorEventDbAgent dbDataAgent = new SensorEventDbAgent(connectionString);

            SimpleWebDosAnalyser wda = new SimpleWebDosAnalyser(reporters, 2000, dbDataAgent);

            string webServerAddress = "69.5.9.180";

            wda.CheckForWebServerDosAttack(webServerAddress, 3, null);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            List <Ids.Common.Interfaces.ISensorReport> reporters = new List <Ids.Common.Interfaces.ISensorReport>();
            string connectionString = @"Data Source=UB1NB092\SQL2012;Initial Catalog=AzureIdsDb;Persist Security Info=True;User ID=cyberproduct;Password=x2000; Connect Timeout=600;Max Pool Size = 200;Pooling = True";

            AzureSqlDbReportAgent cloudDbReportAgent = new AzureSqlDbReportAgent(connectionString,
                                                                                 "7C8FA0D3-1F00-42F1-B849-184348D834F6");

            reporters.Add(cloudDbReportAgent);
            reporters.Add(new SimpleReportAgent());
            CaptureDeviceDescription cdd = new CaptureDeviceDescription()
            {
                DeviceNumber     = 0,
                TextInDeviceName = "whatever"
            };
            string enteredChar = "X";

            while (enteredChar != "s" && enteredChar != "p")
            {
                Console.WriteLine("enter type Statistics Capture (s) or Packet Capture (p):");
                enteredChar = Console.ReadLine();
            }

            BaseSensor baseSensor = null;

            if (enteredChar == "p")
            {
                baseSensor = new BaseSensor(cdd, "port 21", SharpPcap.DeviceMode.Normal, reporters, 20000, Enumerations.SensorMode.PacketCapture);
            }
            else
            {
                baseSensor = new BaseSensor(cdd, "tcp", SharpPcap.DeviceMode.Normal, reporters, 1000, Enumerations.SensorMode.Statistics);
            }

            baseSensor.StartCapturing();

            Console.ReadLine();
            baseSensor.StopCapturing();
        }