Skip to content

Instantly share code, notes, and snippets.



Last active Jul 20, 2016
What would you like to do?
Simple script used to set to run automatically via bash script + cronjob, serve up the content and send out e-mail notifications.
# Utilizing LaNMaSteR53's script to auto-scrape web servers and send out notifications.
# Optimized for Kali Linux
# greg.foss[at]
# cronjob to run this script once a week every Sunday at Midnight
# 0 0 * * 0 /usr/share/peepingtom/
# prepare storage location, remove old data, and migrate existing folders
if [ -f /var/www/hosts/archive/*.* ]
rm /var/www/hosts/archive/*.*
mv /var/www/hosts/*.* /var/www/hosts/archive/
# run nmap sweep of host-range to find new services
if [ -f /usr/share/peepingtom/hosts.xml ]
rm /usr/share/peepingtom/hosts.xml
nmap -sS -Pn -p 80,81,82,443,1000,8000,8080,8443,3780,3790 [IP ADDRESS RANGE] -oX /usr/share/peepingtom/hosts.xml
python /usr/share/peepingtom/ -x /usr/share/peepingtom/hosts.xml
# use text file of existing services
#python /usr/share/peepingtom/ -l /usr/share/peepingtom/host-list.txt
# serve up files
mv /usr/share/peepingtom/hosts/* /var/www/hosts/
echo -y | rm -rf /usr/share/peepingtom/hosts/
mv /var/www/hosts/peepingtom.html /var/www/hosts/index.html
# email notification
sendEmail -f [] -t [] -u 'Application Sweep Completed' -m 'Application sweep has been completed, you may view the results here: http://[SITE]/hosts/index.html' -s [SEND.SITE.COM]:25 -o tls=no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment