Created
May 17, 2019 17:17
-
-
Save gdemarcsek/b6b902aa1231ca9cd1e7b00d382089a8 to your computer and use it in GitHub Desktop.
autorecon.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# quick and dirty script i wrote for discovery and enumeration - provides nice strcuture on fs to organize results | |
# deps: nmap, xsltproc, parallel | |
# tested on kali 2018.3 | |
if [[ -z "${TARGET}" ]]; then | |
exit 100 | |
fi | |
ts=$(date +%s); | |
function scan_one() { | |
local b="$HOME/.recon/$ts" | |
local host="$1" | |
mkdir -p "$b/$host"; | |
nmap -sS -O -v "$host" -oG "$b/$host/nmap.txt" -oX "$b/$host/nmap.xml" --script="discovery,safe,brute,auth" > "$b/$host/nmap.log" 2>&1; xsltproc "$b/$host/nmap.xml" -o "$b/$host/nmap.html" > /dev/null 2>&1; | |
} | |
export -f scan_one | |
export ts | |
nmap -sL ${TARGET} -oG - | grep -v '^#' | cut -d' ' -f2 | parallel -j4 -a - scan_one |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment