Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- NAVIIP=`which naviip`
- NMAP=`which nmap`
- echo -n "Retrieving your homebox IP through gmail: "
- IP=`$NAVIIP`
- if [ -n "$IP" ] && [ "$IP" != '\n' ]; then
- echo -en "$IP\nScanning the service behind secret port: "
- SCAN=` $NMAP -sV -p2247 $IP | sed '/2247/!d' `
- STATE=` echo $SCAN | awk '{print $2}' `
- SERVICE=` echo $SCAN | awk '{print $4" "$5}'`
- echo $SERVICE $STATE
- if [ "$STATE" = "open" ]; then
- echo "Proceeding with ssh connection: "
- ssh -l zeh -p 2247 $IP
- fi
- else
- echo -e "FAILED.\nSorry, I could not retrieve your IP"
- echo "Exiting..."
- fi
- # EOF #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement