Created
February 10, 2019 16:03
-
-
Save julianfbeck/2e4ebea6439b94a6946b851e4dacd13b to your computer and use it in GitHub Desktop.
Scan local Network for hosts with port 80 open and open their ips chrome
This file contains hidden or 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 | |
| NETWORK=$(fing -r 1) | |
| #grepIP | |
| IPDubs=$(echo "$NETWORK" | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}') | |
| #Remove dubs | |
| IP=$(echo "$IPDubs" | sort -u) | |
| #scanports | |
| PORT80OPEN=$(echo "$IP" | xargs nmap -p80 --open | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}') | |
| #openInchrome | |
| while read line; do | |
| /usr/bin/open -a "/Applications/Google Chrome.app" "http://$line" | |
| done < <(echo "$PORT80OPEN") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment