Created
April 21, 2016 22:37
-
-
Save t3h2mas/6b349f0c2ec1c7d64b2dd0e6e270f858 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -e | |
IP=`hostname -I | cut -d ' ' -f1` | |
HOST=`python ./parse_ip.py $IP` | |
nmap -sP $IP/24 -oG hosts | |
cat hosts | grep Up | cut -d ' ' -f2 > hosts_clean | |
mv hosts_clean hosts | |
while read p; do | |
if [ "$p" == "$IP" ]; then | |
continue | |
fi | |
echo $p | |
nmap -sS -O $p -oG $p.results | |
done <hosts |
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
#!/usr/bin/python | |
from sys import argv | |
if __name__ == "__main__": | |
addr = argv[1].split('.') | |
addr[-1] = '0' | |
print '.'.join(addr) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment