Category: Projects

Few days ago I started thinking about the scalability limits of the TIP Fast-Flux Tracking module and realized its design was really awful. The approach was based on the idea of assigning a monitoring thread to each fluxy domain. This approach is well suited if the number of threads is quite small but not for what I was just realizing. First of all, when the number of threads starts growing the performance starts decreasing due to the Python Global Interpreter Lock which limits concurrency of a single interpreter process with multiple threads (and there are no improvements in running the process on a multiprocessor system). Moreover, it’s really hard to guarantee each thread enough stack space for running not raising segmentation faults. For these reasons I decided to rewrite the module from scratch and currently I’m testing it. The new design is really simple, effective and scalable and I have to thank Jose Nazario, Marcello Barnaba and Orlando Bassotto for the really interesting talks we had about this matter. Just one process and no monitoring threads. The code is written is such a way not to have blocking calls thus realizing a really asynchronous module. But when a domain starts being monitored there’s the need to access to backend database thus requiring blocking calls. When this happens, the blocking calls are delegated to the Twisted thread pool with a cloned copy of the collected data in order not to compromise code scalability with not necessary locks. Moreover the module is now turning to be a Twisted Application of its own and the first tests done using the Twisted Epoll Reactor are absolutely encouraging. Stay tuned!

In the last days, the inner workings of TIP changed too much. In fact, as soon as I plugged in the new Spamtrap module, I realized that the core engine was far from perfect. In particular, it was designed when I had no precise idea of the work load it had to face and this forced me to rethink about it from scratch. First of all the new implementation is based on the Twisted Application Framework. Using this infrastructure freed me from having to write a large amount of boilerplate code by hooking the application into existing tools that manage daemonization, logging, choosing a reactor and more. Moreover, TIP is moving towards a component-based architecture by using the interfaces and adapters created by the Zope3 team for developing the submodules. The current implementation scales much better than the previous one because every time a module is scheduled, it runs inside its own subprocess controlled by the twistd master process. This design allows to avoid any kind of memory leakage issue which is exactly the reason why I moved towards a new scheduler design. Each subprocess is independent from the others and the main aim of the master process is to synchronize the subprocesses and free resources when they complete their tasks. Another important change which is worth mentioning is about the Fast Flux tracking module which is now handled as a two-pass subprocess in such a way to free resources as soon as it completes the domain fluxiness classification. Right now the first tests are running. Stay tuned!

I spent my last days working on a subtle bug in TIP which didn’t allow a correct engine rescheduling and thus a correct information sources updating. The bug has gone now but I’m realizing how hard is working always close to the limits of the operating system and the database management system. But it’s a nice challenge to face every day so I think I’ll not stopping having fun for a while! While going crazy in realizing where the bug was I introduced a new interesting feature which lets you discover virtual domains associated to an IP address through a SOAP request to the Windows Live Search. I think that this feature could be quite useful in the company I work for in order to easily handle security incidents. Moreover I spent a good amount of time in creating a comfortable Web 2.0 interface for the daily working. I’m not so cool in Ajax and similar matters but I feel quite satisfied about the result. Keep a look at it!


Today I came back from my Christmas holidays with the precise idea of rewriting the Fast Flux Tracking module from scratch. In fact, in the last days I observed strange behaviors during its working when the number of domains to monitor exceeded a few thousands. A deep investigation of the code revelead to me the sad truth. While using the monitoring threads I forgot cleaning an object related to asynchronous DNS requests at the thread exit. This lead to a great number of unused socket descriptors flying around thus causing the process to quickly hit the limit of the operating system. Three lines of code were added and everything works fine with about 24000 domains monitored right now. Moreover I think few improvements in the module are on the way. Stay tuned!

Eppur si muove!

TIP (Tracking Intelligence Project) is taking its first steps. In my most beautiful dreams, TIP should be an information gathering framework whose purpose is to autonomously collect Internet threat trends. Currently, TIP is closely monitoring information derived from few publicly available blacklists thus identifying malicious domains and networks. To reach its goal, TIP core engine was designed to be totally asynchronous in order to handle common situations where few thousands of running monitoring threads are needed. It’s a nice challenge but something is moving. Have a look at this Fast-Flux Network that TIP is tracking right now (few information are skipped for obvious reasons).

Stay tuned!

Current Datetime:  2008-12-19 12:01:14.890779
set([(‘′, ‘7922’, ‘US’), (‘′, ‘13343’, ‘US’), (‘′, ‘15227’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7018’, ‘US’), (‘′, ‘33287’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘20115’, ‘US’), (‘′, ‘209’, ‘US’), (‘′, ‘20115’, ‘US’), (‘′, ‘11060’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘20115’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7725’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘21508’, ‘US’), (‘′, ‘7922’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘33662’, ‘US’), (‘′, ‘19115’, ‘US’), (‘′, ‘7922’, ‘US’), (‘′, ‘7922’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7922’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘20115’, ‘US’), (‘′, ‘15227’, ‘US’), (‘′, ‘6389’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘14615’, ‘US’), (‘′, ‘36727’, ‘US’), (‘′, ‘36727’, ‘US’), (‘′, ‘12083’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘33668’, ‘US’), (‘′, ‘21766’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘33662’, ‘US’), (‘′, ‘33652’, ‘US’), (‘′, ‘30160’, ‘US’), (‘′, ‘20115’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘13343’, ‘US’), (‘′, ‘4565’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7018’, ‘US’), (‘′, ‘7922’, ‘US’), (‘′, ‘33657’, ‘US’), (‘′, ‘7922’, ‘US’), (‘′, ‘7922’, ‘US’), (‘′, ‘20115’, ‘US’), (‘′, ‘33662’, ‘US’), (‘′, ‘6478’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘12262’, ‘US’), (‘′, ‘11388’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘33287’, ‘US’), (‘′, ‘11427’, ‘US’), (‘′, ‘19262’, ‘US’), (‘′, ‘10994’, ‘US’), (‘′, ‘11060’, ‘US’), (‘′, ‘7018’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7018’, ‘US’), (‘′, ‘6478’, ‘US’), (‘′, ‘33491’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘16810’, ‘US’), (‘′, ‘7459’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7922’, ‘US’), (‘′, ‘33651’, ‘US’), (‘′, ‘20214’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘33657’, ‘US’), (‘′, ‘20115’, ‘US’), (‘′, ‘3909’, ‘US’), (‘′, ‘33662’, ‘US’), (‘′, ‘7029’, ‘US’), (‘′, ‘20115’, ‘US’), (‘′, ‘20412’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7725’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘5668’, ‘US’), (‘′, ‘2711’, ‘US’), (‘′, ‘29737’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘33287’, ‘US’), (‘′, ‘3801’, ‘US’), (‘′, ‘13693’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘20115’, ‘US’), (‘′, ‘7922’, ‘US’), (‘′, ‘7132’, ‘US’), (‘′, ‘14615’, ‘US’), (‘′, ‘7922’, ‘US’), (‘′, ‘33657’, ‘US’)])