Created
August 28, 2014 11:43
-
-
Save aarroyoc/1b3cecaca4b3280df47c to your computer and use it in GitHub Desktop.
Screenshoot ALL the things
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
#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