Add - 2 new examples using nmap (#61)

add - two examples using nmap
This commit is contained in:
cr0hn
2019-10-23 18:56:01 +02:00
committed by pancho horrillo
parent 52ae3375a4
commit 73308cebeb
2 changed files with 43 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#
# Streams nmap execution. When processes finishes print the value ##########"
# as separator and then print the Nmap XML report
#
# Call example:
#
# > curl -v http://localhost:9001/nmap-stream -d "ip=127.0.0.1"
#
kapow route add -X POST /nmap-stream - <<-'EOF'
{
RESULT_FILE="/tmp/${RANDOM}${RANDOM}${RANDOM}"
nmap -Pn -n -p 9000 -oX $RESULT_FILE $(kapow get /request/form/ip)
echo "##########"
cat $RESULT_FILE
rm -f $RESULT_FILE
} | kapow set /response/stream
EOF