Skip to content

Instantly share code, notes, and snippets.

View bdpuk's full-sized avatar

Ben bdpuk

  • AISI
  • Bristol, UK
View GitHub Profile
@bdpuk
bdpuk / bamboohr-console.js
Created August 30, 2019 16:38
Extract People from BambooHR Directory (Browser Console)
var list = document.getElementsByClassName('JobInfo__name');
console.log(list.length);
for (var i=0; i<list.length; i++)
console.log(list[i].innerHTML);
@bdpuk
bdpuk / IP to Cert Name
Created July 29, 2014 11:47
NMap IP to SSL Cert CommonName (Useful when no ReverseDNS)
nmap -sS -p 443 --script=ssl-cert.nse -iL /tmp/foo -vv -PN | grep -E "Nmap scan report for|Subject: commonName" | tr "\n" ":" | sed 's/Nmap scan report for /\n/g' | sed 's/| ssl-cert: Subject: commonName=//g' | cut -f 1 -d "/"
@bdpuk
bdpuk / ping2fullport.sh
Created January 21, 2013 17:01
pingsweep to full portscan
nmap -sP 192.168.0.1/24 -vv -n | grep -v "host down" | grep "scan report" | cut -f 5 -d " " | xargs nmap -p- -sSVC -vv -n --exclude <ownip> -oA filename
@bdpuk
bdpuk / phpinfo2txt.sh
Created January 21, 2013 16:55
Parse phpinfo....
curl http://www.example.com/phpinfo.php | grep "class=\"e\"" | sed -e 's/<tr><td class=\"e\">//g' | sed -e 's/<\/td><\/tr>//g' | sed -e 's/<\/td><td class=\"v\">/ = /g'
@bdpuk
bdpuk / xml2csv.sh
Created January 21, 2013 16:49
NMap XML -> CSV with xmlstarlet
cat nmap-output.xml | grep -v "mac" | xmlstarlet sel -T -t -m "//state[@state='open']" -m ../../.. -v address/@addr -m hostnames/hostname -i @name -o ' (' -v @name -o ')' -b -b -b -o "," -m .. -v @portid -o ',' -v @protocol -o "," -m service -v @name -i "@tunnel='ssl'" -o 's' -b -o "," -v @product -o ' ' -v @version -v @extrainfo -b -n -| sed 's_^\([^\t ]*\)\( ([^)]*)\)\?\t\([^\t ]*\)_\1.\3\2_' | sort -n -t. > nmap-output.csv