Skip to content

Instantly share code, notes, and snippets.

@julianfbeck
Created February 10, 2019 16:03
Show Gist options
  • Select an option

  • Save julianfbeck/2e4ebea6439b94a6946b851e4dacd13b to your computer and use it in GitHub Desktop.

Select an option

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
#!/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