From 7d6c69ae76799c4ad2954b285a7dbaead178bfac Mon Sep 17 00:00:00 2001 From: t3chn0m4g3 Date: Tue, 22 Mar 2022 13:51:05 +0000 Subject: [PATCH] add udp support --- bin/hptest.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/bin/hptest.sh b/bin/hptest.sh index efe1e346..9410cbba 100755 --- a/bin/hptest.sh +++ b/bin/hptest.sh @@ -37,22 +37,32 @@ function fuCHECKFORARGS { if [ "$myHOST" != "" ]; then echo "All arguments met. Continuing." + echo else echo "Usage: hptest.sh <[host or ip]>" + echo exit fi } function fuGETPORTS { +myDOCKERCOMPOSEUDPPORTS=$(cat $myDOCKERCOMPOSEYML | grep "udp" | tr -d '"\|#\-' | cut -d ":" -f2 | cut -d "/" -f1 | sort -gu) myDOCKERCOMPOSEPORTS=$(cat $myDOCKERCOMPOSEYML | yq -r '.services[].ports' | grep ':' | sed -e s/127.0.0.1// | tr -d '", ' | sed -e s/^:// | cut -f1 -d ':' | grep -v "6429\|6430" | sort -gu) -myPORTS=$(for i in $myDOCKERCOMPOSEPORTS; do echo -n "$i,"; done) -echo "$myPORTS" +myUDPPORTS=$(for i in $myDOCKERCOMPOSEUDPPORTS; do echo -n "U:$i,"; done) +myPORTS=$(for i in $myDOCKERCOMPOSEPORTS; do echo -n "T:$i,"; done) } # Main +fuGETPORTS fuGOTROOT fuCHECKDEPS fuCHECKFORARGS -echo "Starting scan ..." -nmap -sV -sC -v -p $(fuGETPORTS) $1 -echo "Done." \ No newline at end of file +echo +echo "Starting scan on all UDP / TCP ports defined in /opt/tpot/etc/tpot.yml ..." +nmap -sV -sC -v -p $myPORTS $1 & +nmap -sU -sV -sC -v -p $myUDPPORTS $1 & +echo +wait +echo "Done." +echo +