From aebe8392bff07e06facc487d315a8f9de4bb7c6e Mon Sep 17 00:00:00 2001 From: N04h Date: Wed, 24 Jul 2024 19:55:23 +0200 Subject: [PATCH 1/9] sed: 1: "/PORT.*STATE.*SERVICE/, ...": bad flag in substitute command: '}' --- nmapAutomator.sh | 71 ++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/nmapAutomator.sh b/nmapAutomator.sh index 9c55af3..02a26a4 100755 --- a/nmapAutomator.sh +++ b/nmapAutomator.sh @@ -245,46 +245,51 @@ cmpPorts() { # Print nmap progress bar # $1 is $scanType, $2 is $percent, $3 is $elapsed, $4 is $remaining progressBar() { - [ -z "${2##*[!0-9]*}" ] && return 1 - [ "$(stty size | cut -d ' ' -f 2)" -le 120 ] && width=50 || width=100 - fill="$(printf "%-$((width == 100 ? $2 : ($2 / 2)))s" "#" | tr ' ' '#')" - empty="$(printf "%-$((width - (width == 100 ? $2 : ($2 / 2))))s" " ")" - printf "In progress: $1 Scan ($3 elapsed - $4 remaining) \n" - printf "[${fill}>${empty}] $2%% done \n" - printf "\e[2A" + [ -z "${2##*[!0-9]*}" ] && return 1 + [ "$(stty size | cut -d ' ' -f 2)" -le 120 ] && width=50 || width=100 + fill="$(printf "%-${width}s" "#" | tr ' ' '#')" + fill="${fill:0:$((width * $2 / 100))}" + empty="$(printf "%-${width}s" " ")" + empty="${empty:0:$((width - ${#fill}))}" + printf "In progress: $1 Scan ($3 elapsed - $4 remaining) \n" + printf "[${fill}>${empty}] $2%% done \n" + printf "\e[2A" } + # Calculate current progress bar status based on nmap stats (with --stats-every) # $1 is nmap command to be run, $2 is progress bar $refreshRate nmapProgressBar() { - refreshRate="${2:-1}" - outputFile="$(echo $1 | sed -e 's/.*-oN \(.*\).nmap.*/\1/').nmap" - tmpOutputFile="${outputFile}.tmp" - - # Run the nmap command - if [ ! -e "${outputFile}" ]; then - $1 --stats-every "${refreshRate}s" >"${tmpOutputFile}" 2>&1 & - fi + refreshRate="${2:-1}" + outputFile="$(echo $1 | sed -e 's/.*-oN \(.*\).nmap.*/\1/').nmap" + tmpOutputFile="${outputFile}.tmp" + + # Run the nmap command + if [ ! -e "${outputFile}" ]; then + $1 --stats-every "${refreshRate}s" >"${tmpOutputFile}" 2>&1 & + fi + + # Keep checking nmap stats and calling progressBar() every $refreshRate + while { [ ! -e "${outputFile}" ] || ! grep -q "Nmap done at" "${outputFile}"; } && { [ ! -e "${tmpOutputFile}" ] || ! grep -i -q "quitting" "${tmpOutputFile}"; }; do + scanType="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | sed -n -e '/elapsed/s/.*undergoing \(.*\) Scan.*/\1/p')" + percent="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | sed -n -e '/% done/s/.*About \(.*\)\..*% done.*/\1/p')" + elapsed="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | sed -n -e '/elapsed/s/Stats: \(.*\) elapsed.*/\1/p')" + remaining="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | sed -n -e '/remaining/s/.* (\(.*\) remaining.*/\1/p')" + progressBar "${scanType:-No}" "${percent:-0}" "${elapsed:-0:00:00}" "${remaining:-0:00:00}" + sleep "${refreshRate}" + done + printf "\033[0K\r\n\033[0K\r\n" + + # Print final output, remove extra nmap noise + if [ -e "${outputFile}" ]; then + sed -n '/PORT.*STATE.*SERVICE/,/^# Nmap/H;${x;s/^\n\|\n[^\n]*\n# Nmap.*//gp}' "${outputFile}" | awk '!/^SF(:|-).*$/' | grep -v 'service unrecognized despite' + else + cat "${tmpOutputFile}" + fi + rm -f "${tmpOutputFile}" +} - # Keep checking nmap stats and calling progressBar() every $refreshRate - while { [ ! -e "${outputFile}" ] || ! grep -q "Nmap done at" "${outputFile}"; } && { [ ! -e "${tmpOutputFile}" ] || ! grep -i -q "quitting" "${tmpOutputFile}"; }; do - scanType="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | sed -ne '/elapsed/{s/.*undergoing \(.*\) Scan.*/\1/p}')" - percent="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | sed -ne '/% done/{s/.*About \(.*\)\..*% done.*/\1/p}')" - elapsed="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | sed -ne '/elapsed/{s/Stats: \(.*\) elapsed.*/\1/p}')" - remaining="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | sed -ne '/remaining/{s/.* (\(.*\) remaining.*/\1/p}')" - progressBar "${scanType:-No}" "${percent:-0}" "${elapsed:-0:00:00}" "${remaining:-0:00:00}" - sleep "${refreshRate}" - done - printf "\033[0K\r\n\033[0K\r\n" - # Print final output, remove extra nmap noise - if [ -e "${outputFile}" ]; then - sed -n '/PORT.*STATE.*SERVICE/,/^# Nmap/H;${x;s/^\n\|\n[^\n]*\n# Nmap.*//gp}' "${outputFile}" | awk '!/^SF(:|-).*$/' | grep -v 'service unrecognized despite' - else - cat "${tmpOutputFile}" - fi - rm -f "${tmpOutputFile}" -} # Nmap scan for live hosts networkScan() { From 46c748b7443e8b95cadd91a7436803132b4cac2d Mon Sep 17 00:00:00 2001 From: N04h Date: Wed, 24 Jul 2024 19:58:43 +0200 Subject: [PATCH 2/9] sed2 --- nmapAutomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmapAutomator.sh b/nmapAutomator.sh index 02a26a4..a7a7ce1 100755 --- a/nmapAutomator.sh +++ b/nmapAutomator.sh @@ -282,7 +282,7 @@ nmapProgressBar() { # Print final output, remove extra nmap noise if [ -e "${outputFile}" ]; then - sed -n '/PORT.*STATE.*SERVICE/,/^# Nmap/H;${x;s/^\n\|\n[^\n]*\n# Nmap.*//gp}' "${outputFile}" | awk '!/^SF(:|-).*$/' | grep -v 'service unrecognized despite' + sed -n '/PORT.*STATE.*SERVICE/,/^# Nmap/{H; $!d; x; s/^\n//; s/\n# Nmap.*//; p}' "${outputFile}" | awk '!/^SF(:|-).*$/' | grep -v 'service unrecognized despite' else cat "${tmpOutputFile}" fi From 05e5b4e505f572d5d9daa516d5c6bfe14382455c Mon Sep 17 00:00:00 2001 From: N04h Date: Wed, 24 Jul 2024 20:12:58 +0200 Subject: [PATCH 3/9] update sed --- nmapAutomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmapAutomator.sh b/nmapAutomator.sh index a7a7ce1..100597b 100755 --- a/nmapAutomator.sh +++ b/nmapAutomator.sh @@ -282,7 +282,7 @@ nmapProgressBar() { # Print final output, remove extra nmap noise if [ -e "${outputFile}" ]; then - sed -n '/PORT.*STATE.*SERVICE/,/^# Nmap/{H; $!d; x; s/^\n//; s/\n# Nmap.*//; p}' "${outputFile}" | awk '!/^SF(:|-).*$/' | grep -v 'service unrecognized despite' + sed -n '/PORT.*STATE.*SERVICE/,/^# Nmap/{p;}' "${outputFile}" | awk '!/^SF(:|-).*$/' | grep -v 'service unrecognized despite' else cat "${tmpOutputFile}" fi From c8df4fc2f8f4466f68f3f847b470e0d602eace07 Mon Sep 17 00:00:00 2001 From: N04h Date: Thu, 25 Jul 2024 20:23:36 +0200 Subject: [PATCH 4/9] update sed and for macos --- .DS_Store | Bin 0 -> 6148 bytes nmapAutomator.sh | 54 +++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..075329f563cd0e3e9a0651028476246b6b85ac72 GIT binary patch literal 6148 zcmeHKO-sW-5Pef4ws!FY`tqORG}Kt_MW@H*pt55T?*OOtBB6P z?Aw{0x0`)|Y!-kN>-i~=0_f8fdjmE*Ovlx?tQRu-MA13wWph7UHZ#ULq1o?OK;K=0 zAr^SVDtdn-jtxJZxs4oQj4NDXifhy;aKm2B_>BA~%)4wkiP#4?XZ08r852}d^?OvE z;+b>a;RPeCu|ne_#aFKOhKGp%5%C9n#){k$7sMUU*IPskhGwRKDPRix69sr?tMv~( zT5AfJ0;a%50sTH?bj3Vi>(PBW*tjbIF=5&n`|j7Dm}!ET2W&kuLlaLWda8sghJ>4g zcsj@PP~Up=bckD-^MsWp+)yN3JS21FkldrSrhqBXRbbDDsh(=J/dev/null | sed -n -e '/elapsed/s/.*undergoing \(.*\) Scan.*/\1/p')" - percent="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | sed -n -e '/% done/s/.*About \(.*\)\..*% done.*/\1/p')" - elapsed="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | sed -n -e '/elapsed/s/Stats: \(.*\) elapsed.*/\1/p')" - remaining="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | sed -n -e '/remaining/s/.* (\(.*\) remaining.*/\1/p')" + scanType="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | gsed -n -e '/elapsed/s/.*undergoing \(.*\) Scan.*/\1/p')" + percent="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | gsed -n -e '/% done/s/.*About \(.*\)\..*% done.*/\1/p')" + elapsed="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | gsed -n -e '/elapsed/s/Stats: \(.*\) elapsed.*/\1/p')" + remaining="$(tail -n 2 "${tmpOutputFile}" 2>/dev/null | gsed -n -e '/remaining/s/.* (\(.*\) remaining.*/\1/p')" progressBar "${scanType:-No}" "${percent:-0}" "${elapsed:-0:00:00}" "${remaining:-0:00:00}" sleep "${refreshRate}" done @@ -282,7 +282,7 @@ nmapProgressBar() { # Print final output, remove extra nmap noise if [ -e "${outputFile}" ]; then - sed -n '/PORT.*STATE.*SERVICE/,/^# Nmap/{p;}' "${outputFile}" | awk '!/^SF(:|-).*$/' | grep -v 'service unrecognized despite' + gsed -n '/PORT.*STATE.*SERVICE/,/^# Nmap/{p;}' "${outputFile}" | awk '!/^SF(:|-).*$/' | grep -v 'service unrecognized despite' else cat "${tmpOutputFile}" fi @@ -304,15 +304,15 @@ networkScan() { # Discover live hosts with nmap nmapProgressBar "${nmapType} -T4 --max-retries 1 --max-scan-delay 20 -n -sn -oN nmap/Network_${HOST}.nmap ${subnet}/24" printf "${YELLOW}Found the following live hosts:${NC}\n\n" - cat nmap/Network_${HOST}.nmap | grep -v '#' | grep "$(echo $subnet | sed 's/..$//')" | awk {'print $5'} + cat nmap/Network_${HOST}.nmap | grep -v '#' | grep "$(echo $subnet | gsed 's/..$//')" | awk {'print $5'} elif $pingable; then # Discover live hosts with ping echo >"nmap/Network_${HOST}.nmap" for ip in $(seq 0 254); do - (ping -c 1 -${TW} 1 "$(echo $subnet | sed 's/..$//').$ip" 2>/dev/null | grep 'stat' -A1 | xargs | grep -v ', 0.*received' | awk {'print $2'} >>"nmap/Network_${HOST}.nmap") & + (ping -c 1 -${TW} 1 "$(echo $subnet | gsed 's/..$//').$ip" 2>/dev/null | grep 'stat' -A1 | xargs | grep -v ', 0.*received' | awk {'print $2'} >>"nmap/Network_${HOST}.nmap") & done wait - sed -i '/^$/d' "nmap/Network_${HOST}.nmap" + gsed -i '/^$/d' "nmap/Network_${HOST}.nmap" sort -t . -k 3,3n -k 4,4n "nmap/Network_${HOST}.nmap" else printf "${YELLOW}No ping detected.. TCP Network Scan is not implemented yet in Remote mode.\n${NC}" @@ -356,7 +356,7 @@ scriptScan() { # Modify detected OS if Nmap detects a different OS if [ -f "nmap/Script_${HOST}.nmap" ] && grep -q "Service Info: OS:" "nmap/Script_${HOST}.nmap"; then - serviceOS="$(sed -n '/Service Info/{s/.* \([^;]*\);.*/\1/p;q}' "nmap/Script_${HOST}.nmap")" + serviceOS="$(gsed -n '/Service Info/{s/.* \([^;]*\);.*/\1/p;q}' "nmap/Script_${HOST}.nmap")" if [ "${osType}" != "${serviceOS}" ]; then osType="${serviceOS}" printf "${NC}\n" @@ -403,7 +403,7 @@ fullScan() { else echo echo - printf "${YELLOW}Making a script scan on extra ports: $(echo "${extraPorts}" | sed 's/,/, /g')\n" + printf "${YELLOW}Making a script scan on extra ports: $(echo "${extraPorts}" | gsed 's/,/, /g')\n" printf "${NC}\n" nmapProgressBar "${nmapType} -sCV -p${extraPorts} --open -oN nmap/Full_Extra_${HOST}.nmap ${HOST} ${DNSSTRING}" 2 assignPorts "${HOST}" @@ -438,9 +438,9 @@ UDPScan() { if [ -n "${udpPorts}" ]; then echo echo - printf "${YELLOW}Making a script scan on UDP ports: $(echo "${udpPorts}" | sed 's/,/, /g')\n" + printf "${YELLOW}Making a script scan on UDP ports: $(echo "${udpPorts}" | gsed 's/,/, /g')\n" printf "${NC}\n" - if [ -f /usr/share/nmap/scripts/vulners.nse ]; then + if [ -f /usr/local/share/nmap/scripts/vulners.nse ]; then sudo -v nmapProgressBar "sudo ${nmapType} -sCVU --script vulners --script-args mincvss=7.0 -p${udpPorts} --open -oN nmap/UDP_Extra_${HOST}.nmap ${HOST} ${DNSSTRING}" 2 else @@ -478,7 +478,7 @@ vulnsScan() { fi # Ensure the vulners script is available, then run it with nmap - if [ ! -f /usr/share/nmap/scripts/vulners.nse ]; then + if [ ! -f /usr/local/share/nmap/scripts/vulners.nse ]; then printf "${RED}Please install 'vulners.nse' nmap script:\n" printf "${RED}https://github.com/vulnersCom/nmap-vulners\n" printf "${RED}\n" @@ -529,9 +529,9 @@ recon() { printf "${YELLOW}sudo apt install ${missingTools} -y\n" printf "${NC}\n\n" - availableRecon="$(echo "${allRecon}" | tr " " "\n" | awk -vORS=', ' '!/'"$(echo "${missingTools}" | tr " " "|")"'/' | sed 's/..$//')" + availableRecon="$(echo "${allRecon}" | tr " " "\n" | awk -vORS=', ' '!/'"$(echo "${missingTools}" | tr " " "|")"'/' | gsed 's/..$//')" else - availableRecon="$(echo "${allRecon}" | tr "\n" " " | sed 's/\ /,\ /g' | sed 's/..$//')" + availableRecon="$(echo "${allRecon}" | tr "\n" " " | gsed 's/\ /,\ /g' | gsed 's/..$//')" fi secs=30 @@ -599,7 +599,7 @@ reconRecommend() { printf "${NC}\n" printf "${YELLOW}SMTP Recon:\n" printf "${NC}\n" - echo "smtp-user-enum -U /usr/share/wordlists/metasploit/unix_users.txt -t \"${HOST}\" | tee \"recon/smtp_user_enum_${HOST}.txt\"" + echo "smtp-user-enum -U /users/share/wordlists/metasploit/unix_users.txt -t \"${HOST}\" | tee \"recon/smtp_user_enum_${HOST}.txt\"" echo fi @@ -634,11 +634,11 @@ reconRecommend() { echo "nikto -host \"${urlType}${HOST}:${port}\" | tee \"recon/nikto_${HOST}_${port}.txt\"" fi if type ffuf >/dev/null 2>&1; then - extensions="$(echo 'index' >./index && ffuf -s -w ./index:FUZZ -mc '200,302' -e '.asp,.aspx,.html,.jsp,.php' -u "${urlType}${HOST}:${port}/FUZZ" 2>/dev/null | awk -vORS=, -F 'index' '{print $2}' | sed 's/.$//' && rm ./index)" - echo "ffuf -ic -w /usr/share/wordlists/dirb/common.txt -e '${extensions}' -u \"${urlType}${HOST}:${port}/FUZZ\" | tee \"recon/ffuf_${HOST}_${port}.txt\"" + extensions="$(echo 'index' >./index && ffuf -s -w ./index:FUZZ -mc '200,302' -e '.asp,.aspx,.html,.jsp,.php' -u "${urlType}${HOST}:${port}/FUZZ" 2>/dev/null | awk -vORS=, -F 'index' '{print $2}' | gsed 's/.$//' && rm ./index)" + echo "ffuf -ic -w /users/share/wordlists/dirb/common.txt -e '${extensions}' -u \"${urlType}${HOST}:${port}/FUZZ\" | tee \"recon/ffuf_${HOST}_${port}.txt\"" else - extensions="$(echo 'index' >./index && gobuster dir -w ./index -t 30 -qnkx '.asp,.aspx,.html,.jsp,.php' -s '200,302' -u "${urlType}${HOST}:${port}" 2>/dev/null | awk -vORS=, -F 'index' '{print $2}' | sed 's/.$//' && rm ./index)" - echo "gobuster dir -w /usr/share/wordlists/dirb/common.txt -t 30 -ekx '${extensions}' -u \"${urlType}${HOST}:${port}\" -o \"recon/gobuster_${HOST}_${port}.txt\"" + extensions="$(echo 'index' >./index && gobuster dir -w ./index -t 30 -qnkx '.asp,.aspx,.html,.jsp,.php' -s '200,302' -u "${urlType}${HOST}:${port}" 2>/dev/null | awk -vORS=, -F 'index' '{print $2}' | gsed 's/.$//' && rm ./index)" + echo "gobuster dir -w /users/share/wordlists/dirb/common.txt -t 30 -ekx '${extensions}' -u \"${urlType}${HOST}:${port}\" -o \"recon/gobuster_${HOST}_${port}.txt\"" fi echo fi @@ -648,7 +648,7 @@ reconRecommend() { cms="$(grep http-generator "nmap/Script_${HOST}.nmap" | cut -d " " -f 2)" if [ -n "${cms}" ]; then for line in ${cms}; do - port="$(sed -n 'H;x;s/\/.*'"${line}"'.*//p' "nmap/Script_${HOST}.nmap")" + port="$(gsed -n 'H;x;s/\/.*'"${line}"'.*//p' "nmap/Script_${HOST}.nmap")" # case returns 0 by default (no match), so ! case returns 1 if ! case "${cms}" in Joomla | WordPress | Drupal) false ;; esac then From ebeafdc59d16b00abc1a370653852d0040c628ca Mon Sep 17 00:00:00 2001 From: Haoling Liu Date: Tue, 30 Jul 2024 20:28:39 +0200 Subject: [PATCH 5/9] both path for arm and amd --- nmapAutomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmapAutomator.sh b/nmapAutomator.sh index eaa71ef..90a4978 100755 --- a/nmapAutomator.sh +++ b/nmapAutomator.sh @@ -478,7 +478,7 @@ vulnsScan() { fi # Ensure the vulners script is available, then run it with nmap - if [ ! -f /usr/local/share/nmap/scripts/vulners.nse ]; then + if [ ! -f /usr/local/share/nmap/scripts/vulners.nse ]&& [ ! -f "/usr/local/share/nmap/scripts/vulners.nse" ]; then printf "${RED}Please install 'vulners.nse' nmap script:\n" printf "${RED}https://github.com/vulnersCom/nmap-vulners\n" printf "${RED}\n" From 7ba19fe8524a98d2049d29576988f5e9a4dcc2d1 Mon Sep 17 00:00:00 2001 From: System Administrator Date: Tue, 30 Jul 2024 21:03:52 +0200 Subject: [PATCH 6/9] update to || or --- nmapAutomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmapAutomator.sh b/nmapAutomator.sh index 90a4978..3fe38f0 100755 --- a/nmapAutomator.sh +++ b/nmapAutomator.sh @@ -478,7 +478,7 @@ vulnsScan() { fi # Ensure the vulners script is available, then run it with nmap - if [ ! -f /usr/local/share/nmap/scripts/vulners.nse ]&& [ ! -f "/usr/local/share/nmap/scripts/vulners.nse" ]; then + if [ ! -f /usr/local/share/nmap/scripts/vulners.nse ]|| [ ! -f "/usr/local/share/nmap/scripts/vulners.nse" ]; then printf "${RED}Please install 'vulners.nse' nmap script:\n" printf "${RED}https://github.com/vulnersCom/nmap-vulners\n" printf "${RED}\n" From e5bfc8ce5d7e1cc325eb51164b6553b01eace8ce Mon Sep 17 00:00:00 2001 From: Haoling Liu Date: Tue, 30 Jul 2024 21:19:03 +0200 Subject: [PATCH 7/9] 1 --- nmapAutomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmapAutomator.sh b/nmapAutomator.sh index 3fe38f0..cf0b894 100755 --- a/nmapAutomator.sh +++ b/nmapAutomator.sh @@ -478,7 +478,7 @@ vulnsScan() { fi # Ensure the vulners script is available, then run it with nmap - if [ ! -f /usr/local/share/nmap/scripts/vulners.nse ]|| [ ! -f "/usr/local/share/nmap/scripts/vulners.nse" ]; then + if [ ! -f /opt/homebrew/share/nmap/scripts/vulners.nse ]|| [ ! -f /usr/local/share/nmap/scripts/vulners.nse ]; then printf "${RED}Please install 'vulners.nse' nmap script:\n" printf "${RED}https://github.com/vulnersCom/nmap-vulners\n" printf "${RED}\n" From a8e006fde8301de6dea1160f782b8d4b0c46564e Mon Sep 17 00:00:00 2001 From: Haoling Liu Date: Tue, 30 Jul 2024 21:29:49 +0200 Subject: [PATCH 8/9] 2 --- nmapAutomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmapAutomator.sh b/nmapAutomator.sh index cf0b894..e027d72 100755 --- a/nmapAutomator.sh +++ b/nmapAutomator.sh @@ -478,7 +478,7 @@ vulnsScan() { fi # Ensure the vulners script is available, then run it with nmap - if [ ! -f /opt/homebrew/share/nmap/scripts/vulners.nse ]|| [ ! -f /usr/local/share/nmap/scripts/vulners.nse ]; then + if [ ! -f "/opt/homebrew/share/nmap/scripts/vulners.nse" ]|| [ ! -f "/usr/local/share/nmap/scripts/vulners.nse" ]; then printf "${RED}Please install 'vulners.nse' nmap script:\n" printf "${RED}https://github.com/vulnersCom/nmap-vulners\n" printf "${RED}\n" From 885aba2d29b831975975b8aec0ad29d80bbc2582 Mon Sep 17 00:00:00 2001 From: Haoling Liu Date: Tue, 30 Jul 2024 21:52:07 +0200 Subject: [PATCH 9/9] 3 --- nmapAutomator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmapAutomator.sh b/nmapAutomator.sh index e027d72..65ee3c4 100755 --- a/nmapAutomator.sh +++ b/nmapAutomator.sh @@ -478,7 +478,7 @@ vulnsScan() { fi # Ensure the vulners script is available, then run it with nmap - if [ ! -f "/opt/homebrew/share/nmap/scripts/vulners.nse" ]|| [ ! -f "/usr/local/share/nmap/scripts/vulners.nse" ]; then + if [ ! -f /opt/homebrew/share/nmap/scripts/vulners.nse ] && [ ! -f /usr/local/share/nmap/scripts/vulners.nse ]; then printf "${RED}Please install 'vulners.nse' nmap script:\n" printf "${RED}https://github.com/vulnersCom/nmap-vulners\n" printf "${RED}\n"