mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Further improvements to the output format. It now always prints the vuln table if an infection is found, but it no longer prints anything for clean machines unless verbosity is 2+
This commit is contained in:
@@ -24,26 +24,26 @@ from public sources (most notably the port blacklisting was found by David Fifie
|
|||||||
out to everybody who contributed!
|
out to everybody who contributed!
|
||||||
]]
|
]]
|
||||||
|
|
||||||
-- <pre>nmap -p445 -T4 --script=p2p-conficker --script-args=realip=\"192.168.1.65\" x.x.x.x</pre>
|
-- <pre>nmap -p445 -T4 -vv --script=p2p-conficker --script-args=realip=\"192.168.1.65\" x.x.x.x</pre>
|
||||||
-- @args checkconficker If set to '1' or 'true', the script will always run on active hosts,
|
-- @args checkconficker If set to '1' or 'true', the script will always run on active hosts,
|
||||||
-- it doesn't matter if any open ports were detected.
|
-- it doesn't matter if any open ports were detected.
|
||||||
--
|
--
|
||||||
-- @usage
|
-- @usage
|
||||||
-- # Run the scripts against host(s) that appear to be Windows
|
-- # Run the scripts against host(s) that appear to be Windows
|
||||||
-- nmap --script p2p-conficker,smb-os-discovery,smb-check-vulns --script-args=safe=1 -T4 -p445 <host>
|
-- nmap --script p2p-conficker,smb-os-discovery,smb-check-vulns --script-args=safe=1 -T4 -vv -p445 <host>
|
||||||
-- sudo nmap -sU -sS --script p2p-conficker,smb-os-discovery,smb-check-vulns --script-args=safe=1 -T4 -p U:137,T:139 <host>
|
-- sudo nmap -sU -sS --script p2p-conficker,smb-os-discovery,smb-check-vulns --script-args=safe=1 -vv -T4 -p U:137,T:139 <host>
|
||||||
--
|
--
|
||||||
-- # Run the scripts against all active hosts (recommended)
|
-- # Run the scripts against all active hosts (recommended)
|
||||||
-- nmap -p139,445 --script p2p-conficker,smb-os-discovery,smb-check-vulns --script-args=checkconficker=1,safe=1 -T4 <host>
|
-- nmap -p139,445 -vv --script p2p-conficker,smb-os-discovery,smb-check-vulns --script-args=checkconficker=1,safe=1 -T4 <host>
|
||||||
--
|
--
|
||||||
-- # Run scripts against all 65535 ports (slow)
|
-- # Run scripts against all 65535 ports (slow)
|
||||||
-- nmap --script p2p-conficker,smb-os-discovery,smb-check-vulns -p- --script-args=checkall=1,safe=1 -T4 <host>
|
-- nmap --script p2p-conficker,smb-os-discovery,smb-check-vulns -p- --script-args=checkall=1,safe=1 -vv -T4 <host>
|
||||||
--
|
--
|
||||||
-- # Base checks on a different ip address (NATed)
|
-- # Base checks on a different ip address (NATed)
|
||||||
-- nmap --script p2p-conficker,smb-os-discovery -p445 --script-args=realip=\"192.168.1.65\" -T4 <host>
|
-- nmap --script p2p-conficker,smb-os-discovery -p445 --script-args=realip=\"192.168.1.65\" -vv -T4 <host>
|
||||||
--
|
--
|
||||||
-- @output
|
-- @output
|
||||||
-- Clean machine:
|
-- Clean machine (results printed only if extra verbosity ("-vv")is specified):
|
||||||
-- Host script results:
|
-- Host script results:
|
||||||
-- | p2p-conficker: Checking for Conficker.C or higher...
|
-- | p2p-conficker: Checking for Conficker.C or higher...
|
||||||
-- | | Check 1 (port 44329/tcp): CLEAN (Couldn't connect)
|
-- | | Check 1 (port 44329/tcp): CLEAN (Couldn't connect)
|
||||||
@@ -52,7 +52,7 @@ out to everybody who contributed!
|
|||||||
-- | | Check 4 (port 52600/udp): CLEAN (Failed to receive data)
|
-- | | Check 4 (port 52600/udp): CLEAN (Failed to receive data)
|
||||||
-- |_ |_ 0/4 checks: Host is CLEAN or ports are blocked
|
-- |_ |_ 0/4 checks: Host is CLEAN or ports are blocked
|
||||||
--
|
--
|
||||||
-- Infected machine:
|
-- Infected machine (results always printed):
|
||||||
-- Host script results:
|
-- Host script results:
|
||||||
-- | p2p-conficker: Checking for Conficker.C or higher...
|
-- | p2p-conficker: Checking for Conficker.C or higher...
|
||||||
-- | | Check 1 (port 18707/tcp): INFECTED (Received valid data)
|
-- | | Check 1 (port 18707/tcp): INFECTED (Received valid data)
|
||||||
@@ -615,7 +615,7 @@ local function go(host)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Remove the response if verbose is turned off
|
-- Remove the response if verbose is turned off
|
||||||
if(nmap.verbosity() < 2) then
|
if(count == 0 and nmap.verbosity() < 2) then
|
||||||
response = ""
|
response = ""
|
||||||
else
|
else
|
||||||
response = response .. "|_ "
|
response = response .. "|_ "
|
||||||
@@ -623,7 +623,11 @@ local function go(host)
|
|||||||
|
|
||||||
-- Check how many INFECTED hits we got
|
-- Check how many INFECTED hits we got
|
||||||
if(count == 0) then
|
if(count == 0) then
|
||||||
response = response .. string.format("%d/%d checks are positive: Host is CLEAN or ports are blocked\n", count, checks)
|
if (nmap.verbosity() > 1) then
|
||||||
|
response = response .. string.format("%d/%d checks are positive: Host is CLEAN or ports are blocked\n", count, checks)
|
||||||
|
else
|
||||||
|
response = nil
|
||||||
|
end
|
||||||
else
|
else
|
||||||
response = response .. string.format("%d/%d checks are positive: Host is likely INFECTED\n", count, checks)
|
response = response .. string.format("%d/%d checks are positive: Host is likely INFECTED\n", count, checks)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user