Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- int_ip=$(ifconfig | grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" | sed '3,3!d')
- echo "Internal IP is:"$int_ip
- subnet=$(ifconfig | grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" | sed '4,4!d')
- echo "Internal Subnet is:"$subnet
- ext_ip=$(curl -s http://whatismyip.org | grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")
- echo "External IP is:"$ext_ip
- subnet_cut=$(ifconfig | grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" | sed '4,4!d' | cut -d '.' -f 1-3)
- echo "Alive hosts on the network: "
- (prefix=$subnet_cut && for i in `seq 254`; do (sleep 0.5 && ping -c1 -w1 $prefix.$i &> /dev/null && arp -n | awk ' /'$prefix'.'$i' / { print $1 " " $3 } ') & done; wait)
- echo "Arp scan: "
- arp-scan --localnet
- nmap -O $subnet_cut.0/24 -vv --open | grep -v 'Nmap' | grep -v 'SYN' | grep -v 'OS detection' | grep -v 'Increasing' | grep -v 'OS:'
- mac_vendors=$(nmap -sP -n $subnet_cut.0/24)
- echo -e "'List of Vendors:' $mac_vendors"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement