Files
baremetal-basics/nms
T

37 lines
1.3 KiB
Bash
Raw Normal View History

2026-05-11 11:33:26 +00:00
#!/bin/bash
2026-07-29 21:40:07 +00:00
for arg in "$@"; do
2026-08-25 01:00:41 +00:00
rm nms-"$@".log
2026-08-25 00:52:34 +00:00
ts=$(date +%Y-%m-%d-%T)
2026-05-11 11:33:26 +00:00
clear
2026-08-25 01:00:41 +00:00
echo "================================================================================" | tee nms-"$@".log
echo "DATE: $ts" | tee -a nms-"$@".log
echo "HOST: $@" | tee -a nms-"$@".log
echo "--------------------------------------------------------------------------------" | tee -a nms-"$@".log
2026-07-29 21:40:07 +00:00
#read x
2026-08-25 00:55:11 +00:00
echo "Running Nmap scan on $@..."
2026-08-25 01:00:41 +00:00
nmap -A -v -sV -sC -Pn --script vulners,http-sql-injection,http-unsafe-output-escaping,http-enum.nse "$@" | tee -a nms-"$@".log
2026-08-25 00:34:25 +00:00
echo "--------------------------------------------------------------------------------"
echo " PRESS R FOR REPORT OR Q TO EXIT "
echo "================================================================================"
2026-08-25 00:33:02 +00:00
read -r -n 1 -s key
if [ "$key" = "R" ] || [ "$key" = "r" ]; then
echo "================================================================================"
echo " GENERATING REPORT FILE: "$@".pdf..."
echo "--------------------------------------------------------------------------------"
2026-08-25 01:00:41 +00:00
soffice --headless --convert-to pdf --outdir ./nms-"$@" nms-"$@".log
rm nms-"$@".log
open nms-"$@".pdf
2026-08-25 00:33:02 +00:00
exit
else
if [ "$key" = "q" ] || [ "$key" = "Q" ]; then
2026-08-25 01:00:41 +00:00
rm nms-"$@".log
2026-08-25 00:33:02 +00:00
exit
fi
fi
2026-05-11 11:33:26 +00:00
echo 'Done.'
2026-07-29 21:40:07 +00:00
#read -n1
#clear
2026-08-25 01:00:41 +00:00
rm nms-"$@".log
2026-07-29 21:40:07 +00:00
done