Octent Control v1.0.0 RC1 (2003-10-13)
Don’t let that date scare you, yes it still compiles!
This package is a multi-threaded C middleware that controls Nessus instances for distributed vulnerability scanning. Octent was a front end to Nessus written in PHP and PostgreSQL designed to make the usage of Nessus user friendly. This code you see is the backend that actually carried out all the work.
The basic concept is that you would define a pool of scanners and a pool of work, then attach work to specific scanners (or just first available), run the work, and then get the results and parse them in a quick and dirty way and throwing them back in the database for reporting/workflows.
For Demo Use Only
I wrote this in C and it expects to be run in a Linux environment. I did just compile it on a recent Debian installation, so it should still be good. That said, there is a huge missing piece here, the PHP front end and all the database schema.
The point being you won’t be able to really run this code, but if you are looking for a model to create a multi-threaded C application, check this out.
For fun, learning, and enjoyment
If nothing else, just read through this code. Not only is it chocked full of my stream of thought code comments, but you can even see the progress of the code through the comments. Part of how I code is writing out what I want the code to do, often times in hilarious fashion, and then tagging certain lines when I need to call attention to them. Like this:
prevnode = NULL; // DONT FORGET TO CLEAR POINTERS DANGIT!
Or debug logging messages such as:
thread shutting down because nessus crapped out...
So anyway, anytime I browse through the codebase it is a trip down memory lane sitting on the 19th floor of the building, listening to music, pounding out code, and swearing. A lot.