-
Notifications
You must be signed in to change notification settings - Fork 0
Classes
Spitzer has many classes to make it run, some of which you can use when creating your own module. Let's go over some of the useful one's.
from Spitzer.result import result
The result class contains a few methods to save the results from your module ready to be exported. The following methods are in result.py
:
add_pages(host, pages)
add(host, title, text)
add_pages
is to add the found webpages to the list. It expects a string of a ip-address for host
and a list of found webpages.
add
adds a found vuln to the list, it expects a string of the host again, a string for the title of the finding and a string for the body of the finding. The body often can just be the raw output from the tool you ran.
from Spitzer import command
The command class runs shell commands. The commands are not filtered in any way, so go nuts.
run(cmd, capture_output=False, check=True, verbose=None)
Where cmd
is a list of strings, the strings being the commands and flags. Example:
['nmap', '10.10.10.10', '-sC', '-sV']
capture_output
is whether you want the output of the command, it is still printed to the stdout.
check
is whether there should be check what the return code is. If check
is true and the returncode is not 0, the class will raise an exception.
verbose
is the amount of -v
's you want added to your command. If verbose
is -1, nothing will be printed to the stdout.