Created
August 22, 2014 23:50
-
-
Save jwerle/8c33c2ec6551d87d5dbe 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 | |
HOST="$1" | |
PORT="$2" | |
umq recv ${PORT} & | |
while read -r buf; do | |
nmap "${HOST}" -p "${PORT}" --open 2>/dev/null | \ | |
awk '/scan report for/ {$1=$2=$3=$4=""; print $0}' | \ | |
tr -d ' ' | { | |
while read -r host; do | |
echo "me => $host"; | |
echo "${buf}" | umq push $host ${PORT}; | |
{ | |
umq recv $host ${PORT} | while read -r reply; do | |
if [[ -z "$reply" ]]; then continue; fi | |
echo "$host <= me" | |
echo $reply | |
done | |
} & | |
done | |
} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment