Monday 10 February 2014

Automating Nipper Studio Audits

by Edwin Bentley

About the Author

Edwin Bentley, Software Developer at Titania
Edwin joined Titania in 2011 and has since become a key member of development team, having primary involvement in advancement of both the Nipper Studio and Paws Studio software. He has a keen interest in Information Security and the role that the industry will play in the future advancement of technologies.

Nipper Studio is typically used by security specialists using the graphical interface from their testing desktop environment. However the Nipper Studio system integrators make use of the equally powerful command line interface to integrate the report output into their own setup. This article provides a glimpse in to the integration possibilities by showing how Nipper Studio can be run from the command line and scheduled on Linux and Windows systems.

Running from the command line

Although Nipper Studio has a huge number of different configuration settings, in its most basic form you want to provide it with a configuration to audit and give it a filename to save the report to. So from the command line you could create a report using the following:

nipper --input=router.txt --output=report.html

The above example would make use of the current processing, reporting and save settings. Since the settings are maintained between the command line and graphical interfaces, those settings could be changed using the graphical interface.

To list all the possible configuration settings available on the command line you can use the built-in help system:

nipper --help=all

On Linux systems you could also look at the help using the UNIX man system.

Figure 1. Nipper man page
Nipper Studio includes a variety of different report formats; the ones system integrators are most familiar with are XML and CSV. To write a report out in XML format you can use the following command:

nipper --input=router.txt --xml --output=report.xml

Scheduling on Linux

On Linux I am going to demonstrate using Cron to schedule a job to create a Nipper Studio report. I will assume that you already have a grasp on using command line and Linux utilities, rather than provide a tutorial on the shell and editors.

Typing the command crontab -e will open the crontab file for the current user and will make use of the currently defined command line editor for your shell (see Figure 2).

Figure 2. ‘crontab -e’ command
I am then going to add a line that will schedule a job to run Nipper Studio to process a configuration stored in /configs/myconfig.txt, and save the report to /configs/report.html at 15 minutes past 3 each day.

15 3 * * * nipper --input=/configs/myconfig.txt --output=/configs/report.html

Once you save and exit the editor the changes to your scheduled tasks will take effect, so as to include the new task. If you aren’t comfortable using command line editors, you can just list out the current scheduled task for your user by running the following:

crontab -l >scheduled-tasks.txt

You can then edit this file using a GUI text editor such as Kwrite or Gedit, or whichever your preferred editor is (see Figure 3).

Figure 3. Task scheduling in GUI text editor
Once you have saved the file, running the following command will add it to the schedule:

crontab scheduled-task.txt

I have just used a basic example of processing a single file but Nipper Studio has many other, more advanced capabilities. Cron also has many other scheduling options that I haven’t covered in this article. Using these capabilities, together with other tools, it is possible to automate complete audits, integrate them with bespoke systems, email updated reports and much more.

Scheduling on Windows

As with Linux, Windows also has a task scheduler. This can be found by going to the “Control Panel” then “System and Security”, then “Administrative tools” and finally “Task Scheduler” (see Figure 4).
Figure 4. Task scheduler on Windows

To create a new task, select the “Create Basic Task” from the “Actions” pane or the “Action” menu (see Figure 5).
Figure 5. Creating a new task


A new task wizard will be shown. In the first step I am calling my task “Nipper”. You can also enter a description for the task (see Figure 6).


Figure 6. Wizard task creation
The next page will then allow you to set the frequency of the schedule, with the usual options of daily, weekly, monthly etc. I have selected daily, the same as the Linux example (see Figure 7).

Figure 7. Task frequency options (a)
The next page then allows you to fine tune your selection, for instance if you chose the monthly option, you would be able to select the specific days of the month. You can also set the time that you want the task to run. I am going to set it to 15 minutes past 3 (see Figure 8).

Figure 8. Task frequency options (b)
On the next page I will choose what type of task it is I want to perform. I am going to select the “Start a Program” option. I am then going to specify the Program or script that I want to run. This will be the “nipper. exe” executable that will be found in the installation directory for Nipper Studio, the default is “C:\Program Files\NipperStudio\nipper.exe”.

In the “Add Arguments” I am going to add the options to pass to the command line. This is in the same format as for Linux, so I have entered --input=c:\configs\myconfig.txt --output=c:\configs\report.html (see Figure 9).

Figure 9. Adding arguments
The last page will just show a review of the task that I have created. Clicking on “Finish” will add the task to the scheduler (see Figure 10).

Figure 10. Complete task
Conclusion

There is a broad range of integration possibilities in Nipper Studio, this article set out to provide an insight into just a few. Features such as scheduling and being able to run Nipper Studio from the command line are included to make the software as useful as possible for network managers and auditors.



No comments:

Post a Comment

Did you find our blog useful? Let us know! We would love to hear your thoughts, opinions and comments regarding any of our blog posts.