add udp support

This commit is contained in:
t3chn0m4g3 2022-03-22 13:51:05 +00:00
parent f518d84da9
commit 7d6c69ae76

View file

@ -37,22 +37,32 @@ function fuCHECKFORARGS {
if [ "$myHOST" != "" ]; if [ "$myHOST" != "" ];
then then
echo "All arguments met. Continuing." echo "All arguments met. Continuing."
echo
else else
echo "Usage: hptest.sh <[host or ip]>" echo "Usage: hptest.sh <[host or ip]>"
echo
exit exit
fi fi
} }
function fuGETPORTS { 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) 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) myUDPPORTS=$(for i in $myDOCKERCOMPOSEUDPPORTS; do echo -n "U:$i,"; done)
echo "$myPORTS" myPORTS=$(for i in $myDOCKERCOMPOSEPORTS; do echo -n "T:$i,"; done)
} }
# Main # Main
fuGETPORTS
fuGOTROOT fuGOTROOT
fuCHECKDEPS fuCHECKDEPS
fuCHECKFORARGS fuCHECKFORARGS
echo "Starting scan ..." echo
nmap -sV -sC -v -p $(fuGETPORTS) $1 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 "Done."
echo