diff --git a/etc/text_files/nmap_opts.lst b/etc/text_files/nmap_opts.lst index 818bc5e..10dc88d 100644 --- a/etc/text_files/nmap_opts.lst +++ b/etc/text_files/nmap_opts.lst @@ -89,6 +89,8 @@ -oG -oA -v +-vv +-vvv -d --reason --open diff --git a/lib/banner.py b/lib/banner.py index bb59e3e..64e29c3 100644 --- a/lib/banner.py +++ b/lib/banner.py @@ -1,7 +1,7 @@ import os import random -VERSION = "4.0" +VERSION = "4.0.6" def banner_1(line_sep="#--", space=" " * 30): diff --git a/lib/cmdline/cmd.py b/lib/cmdline/cmd.py index 647e8b3..2b9e82a 100644 --- a/lib/cmdline/cmd.py +++ b/lib/cmdline/cmd.py @@ -12,6 +12,7 @@ import lib.exploitation.exploiter +# I'm just pushing to say FUCK YOU @cryptollama class AutoSploitParser(argparse.ArgumentParser): def __init__(self): diff --git a/lib/exploitation/exploiter.py b/lib/exploitation/exploiter.py index f5863a8..c5b73d3 100644 --- a/lib/exploitation/exploiter.py +++ b/lib/exploitation/exploiter.py @@ -137,7 +137,7 @@ def start_exploit(self, sep="*" * 10): ) cmd_template = ( - "sudo {use_ruby} {msf_path} -r {rc_script_path} -q" + "{use_sudo} {use_ruby} {msf_path} -r {rc_script_path} -q" ) use_ruby = "ruby" if self.ruby_exec else "" @@ -162,6 +162,7 @@ def start_exploit(self, sep="*" * 10): lhost = self.configuration[1] lport = self.configuration[2] rhost = host.strip() + is_docker = "sudo" if lib.settings.we_dockered() else "" current_rc_script_path = path.join(current_host_path, mod.replace("/", '-').strip()) with open(current_rc_script_path, 'w') as f: @@ -172,7 +173,8 @@ def start_exploit(self, sep="*" * 10): lhost=lhost, lport=lport, rhost=rhost, - rhosts=rhost + rhosts=rhost, + use_sudo=is_docker )) with open(report_path, 'a') as f: diff --git a/lib/scanner/nmap.py b/lib/scanner/nmap.py index 71187f7..c219b97 100644 --- a/lib/scanner/nmap.py +++ b/lib/scanner/nmap.py @@ -120,7 +120,12 @@ def do_scan(host, nmap_path, ports=None, arguments=None): perform the nmap scan """ if arguments is None: - arguments = "-sV" + lib.output.misc_info("using default scan arguments") + arguments = [ + "-sF", "-Pn", "-sV", + "-O", "-F", "--reason", + "-vvv" + ] launch_arguments = [ nmap_path, '-oX', '-', host, '-p ' + ports if ports is not None else "", @@ -150,106 +155,235 @@ def do_scan(host, nmap_path, ports=None, arguments=None): return output_data, "".join(nmap_warn_tracestack), "".join(nmap_error_tracestack) +# copy pasta :DD +# https://github.com/komand/python-nmap/blob/master/nmap/nmap.py#L273 def parse_xml_output(output, warnings, error): """ - parse the XML data out of the file into a dict + Analyses NMAP xml scan ouput + May raise PortScannerError exception if nmap output was not xml + Test existance of the following key to know if something went wrong : ['nmap']['scaninfo']['error'] + If not present, everything was ok. + :param nmap_xml_output: xml string to analyse + :returns: scan_result as dictionnary """ - results = {} + # nmap xml output looks like : + # + # + #
+ # + # + # + # + # + # + # + # + # + # + # + # + #