Introducing Recon
Need a schmancy, new GUI for Nmap? Got Leopard? Give Recon a try.
Recon is open source. This means I want you to help me improve it. To help you get started, here’s an overview of the Recon object model.
Fig. 1: Recon Object Graph
The primary object controller is MyDocument (Recon started life as an Core Data Persistent Document. It’s windowControllerDidLoadNib: is effectively your int main().
MyDocument configures the Core Data persistent store, and instantiates a SessionManager object.
Fig. 2: SessionManager Interaction Through Session Drawer
The SessionManager (SM) object creates a SessionController queue and allows the user to Run/Abort/Delete SessionController objects residing in the queue.
Fig 3: SessionManager Queue Controllers
After the user selects a profile and enters a target, they click the queueSession: button. The SessionManager then instantiates a new SessionController (SC) object and adds it to the queue.
Upon instantiate, the SessionController, itself, instantiates an:
- ArgumentListGenerator, which converts the selected scan profile into a string of Nmap arguments flags.
- NmapController, which instantiates an NSTask with the user-specified nmap binary and argument string from above.
- XMLController, which parses the Nmap output XML file, and populates the Core Data Store with the results.
The SC handles the sequence of events which invokes its three sub-controllers, and handles any errors that may occur.
The SessionControllers sit dormant in the SM queue, waiting for a signal to actually perform the scan.
Fig 4: SessionManager processQueue:
When the user chooses to process the session queue, the processQueue: method is envoked in the SessionManager. The SM iterates through the SessionController queue, executing a startScan: in FIFO fashion.
Each SC tells its corresponding NmapController (NC) to startScan: and waits for a notification indicating that the NC’s NSTask has returned. If the scan went well, a successfulRunNotification: is sent back to the appropriate SessionController.
If an SC receives a successfulRunNotification:, it reads the nmap output file path from the NC returned in the [notification object]. This output file path is then passed to an XMLController, which parses the output and inserts the scan results into the Core Data Store.
The SC then sends a successfulRunNotification: to the SessionManager, which dequeues the SessionController.
The functional flow is fairly straightforward for other interaction cases.
Recon Core Data Object Model
Recon’s data model is stored using a Core Data Store.
Check out the source code at: recon @ googlecode.com.