Esempio n. 1
0
        void runBot( )
        {
            Logger.Instance( ).Log("Initialising blacklists");
            DNSBL = initialiseBlacklists( );
            Logger.Instance( ).Log("Running BOPRbot.");
            Block[] proxyBlocks = db.getProxyBlocks(0);
            Logger.Instance( ).Log("Fetched " + proxyBlocks.Length.ToString( ) + " blocks to check.");
            Logger.Instance( ).Log("Will need to perform " + proxyBlocks.Length * BLCOUNT + " DNS lookups.");
            Logger.Instance( ).Log("Connecting to IRC...");
            IrcController ic = new IrcController( );

            Logger.Instance( ).Log("Starting execution");
            ic.setTotal(proxyBlocks.Length);
            for (int i = 0; i < proxyBlocks.Length; i++)
            {
                ic.setPosition(i);
                Block b = proxyBlocks[i];

                if (b.IP != null)
                {
                    int count = 0;
                    foreach (Blacklist d in DNSBL)
                    {
                        if (d.openProxy(b.IP))
                        {
                            count++;
                        }
                    }
                    Reporter.Instance( ).Add(b, count);
                }

                System.Threading.Thread.Sleep(500);
            }

            Reporter.Instance( ).WriteReport(DNSBL);
            Logger.Instance( ).Log("Done. Logging off IRC and exiting.");

            ic.stop( );
        }
Esempio n. 2
0
        void runBot( )
        {
            Logger.Instance( ).Log( "Initialising blacklists" );
            DNSBL = initialiseBlacklists( );
            Logger.Instance( ).Log( "Running BOPRbot." );
            Block[ ] proxyBlocks = db.getProxyBlocks( 0 );
            Logger.Instance( ).Log( "Fetched " + proxyBlocks.Length.ToString( ) + " blocks to check." );
            Logger.Instance( ).Log( "Will need to perform " + proxyBlocks.Length * BLCOUNT + " DNS lookups." );
            Logger.Instance( ).Log( "Connecting to IRC..." );
            IrcController ic = new IrcController( );
            Logger.Instance( ).Log( "Starting execution" );
            ic.setTotal( proxyBlocks.Length );
            for( int i = 0; i < proxyBlocks.Length; i++ )
            {
                ic.setPosition( i );
                Block b = proxyBlocks[ i ];

                if( b.IP != null )
                {
                    int count = 0;
                    foreach( Blacklist d in DNSBL )
                    {
                        if( d.openProxy( b.IP ) )
                            count++;

                    }
                    Reporter.Instance( ).Add( b, count );
                }

                System.Threading.Thread.Sleep( 500 );

            }

            Reporter.Instance( ).WriteReport( DNSBL );
            Logger.Instance( ).Log( "Done. Logging off IRC and exiting." );

            ic.stop( );
        }