Skip to content

Instantly share code, notes, and snippets.

@gdemarcsek
Created May 17, 2019 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdemarcsek/b6b902aa1231ca9cd1e7b00d382089a8 to your computer and use it in GitHub Desktop.
Save gdemarcsek/b6b902aa1231ca9cd1e7b00d382089a8 to your computer and use it in GitHub Desktop.
autorecon.sh
#!/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