Skip to content

Instantly share code, notes, and snippets.

@rhovelz
Created December 2, 2019 18:30
Show Gist options
  • Save rhovelz/3ec03a395bbb5103d598746fbeaf2817 to your computer and use it in GitHub Desktop.
Save rhovelz/3ec03a395bbb5103d598746fbeaf2817 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import os, sys, argparse, datetime
def scan(cmd, ip, dir, log, name, tool):
print("[%s / %s] %s starting...." % (ip, name, tool))
os.system(cmd)
print("\tLog: %s" % log)
print("\tResults: %s" % dir)
print("[%s / %s] %s complete." % (ip, name, tool))
def main():
# binaries
_gobuster = "/root/go/bin/gobuster"
_eyewitness = "/usr/bin/eyewitness"
_whatweb = "/usr/bin/whatweb"
_nikto = "/usr/bin/nikto"
_valid_codes = "'200,204,301,307,405,500'"
_agent = "'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36'"
_date = datetime.datetime.now().strftime('%Y%m%d')
# tool args
_gob_args = "-n -q -r -e -t 30 -k -s %s -a %s" % (_valid_codes, _agent)
_eye_args = "--web --threads 10 --no-prompt --results 20 --user-agent %s" % (_agent)
_nikto_args = "-Format txt -Save ."
# user argumentss
parser = argparse.ArgumentParser()
parser.add_argument("--ip", dest="_ip")
args = parser.parse_args()
# whatweb scan
_ww_dir = "Enumeration/whatweb_%s.log" % _date
_ww_log = "Logs/whatweb_%s.log" % _date
_cmd = "%s --log-brief=%s %s > %s 2>&1" % (_whatweb, _ww_dir, args._ip, _ww_log)
scan(_cmd, args._ip, _ww_dir, _ww_log, "normal", _whatweb)
# nikto scan
_nikto_dir = "Enumeration/nikto_%s.log" % _date
_nikto_log = "Logs/nikto_%s.log" % _date
_cmd = "%s %s -host %s -output %s > %s 2>&1" % (_nikto, _nikto_args, args._ip, _nikto_dir, _nikto_log)
scan(_cmd, args._ip, _nikto_dir, _nikto_log, "normal", _nikto)
# first gobuster scan
_gob_dir = "Enumeration/gobuster_%s_%s.log" % ("fast", _date)
_gob_log="Logs/gobuster_fast_%s.log" % (_date)
_cmd = "%s %s -u %s -o %s -w %s > %s 2>&1" % (_gobuster, _gob_args, args._ip, _gob_dir, "/mnt/resources/WordLists/wordlist_small_20190319.log", _gob_log)
scan(_cmd, args._ip, _gob_dir, _gob_log, "fast", _gobuster)
# first eyewitness scan
_eye_dir = "Enumeration/eyewitness_%s_%s.log" % ("fast", _date)
_eye_log="Logs/eyewitness_fast_%s.log" % (_date)
_cmd = "%s %s -d %s -f %s > %s 2>&1" % (_eyewitness, _eye_args, _eye_log, _gob_dir, _eye_log)
scan(_cmd, args._ip, _eye_dir, _eye_log, "fast", _eyewitness)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment