mirror of
https://github.com/nmap/nmap.git
synced 2025-12-28 10:29:03 +00:00
Squashed commit of the following:
commit 7c26e4de2ab365a30fe6e91f3a531eb38c8dfdba Author: Daniel Miller <bonsaiviking@gmail.com> Date: Tue Aug 7 16:36:54 2012 -0500 Fix indentation on netbios.lua (no code change) commit 47dc3e32e6b47bd80620cfbc54e7590193dd0c1a Author: Daniel Miller <bonsaiviking@gmail.com> Date: Tue Jul 31 16:42:27 2012 -0500 Make smbauth.lua use host, not nmap, registry commit 3738f8e6d551a1260463609d8cda86918843a372 Author: Daniel Miller <bonsaiviking@gmail.com> Date: Tue Jul 31 16:35:45 2012 -0500 Make netbios.lua use host registry. Functions now can take host table or IP commit 031cadb9d407ab7fd43aaddffda1a89c24cbdd45 Author: Daniel Miller <bonsaiviking@gmail.com> Date: Tue Jul 31 15:54:12 2012 -0500 Remove mac-geolocation info from snmp-interfaces commit 2218dbaf8ffd4a33de2bc028def9be7301dfb3a2 Author: Daniel Miller <bonsaiviking@gmail.com> Date: Tue Jul 31 15:52:36 2012 -0500 Make path-mtu.nse use host, not nmap, registry commit 5a3d006bdb9cd3e981a8e753c92b5ade5059a29b Author: Daniel Miller <bonsaiviking@gmail.com> Date: Tue Jul 31 15:51:53 2012 -0500 Make cvs-* scripts use host, not nmap, registry
This commit is contained in:
@@ -66,10 +66,8 @@ Driver =
|
||||
if ( not(status) and err:match("I HATE YOU") ) then
|
||||
-- let's store the repositories in the registry so the brute
|
||||
-- script can use them later.
|
||||
nmap.registry.cvs = nmap.registry.cvs or {}
|
||||
nmap.registry.cvs[self.host.ip] = nmap.registry.cvs[self.host.ip] or {}
|
||||
nmap.registry.cvs[self.host.ip].repos = nmap.registry.cvs[self.host.ip].repos or {}
|
||||
table.insert(nmap.registry.cvs[self.host.ip].repos, password)
|
||||
self.host.registry.cvs_repos = self.host.registry.cvs_repos or {}
|
||||
table.insert(self.host.registry.cvs_repos, password)
|
||||
return true, brute.Account:new(username, password, 0)
|
||||
end
|
||||
return false, brute.Error:new( "Incorrect password" )
|
||||
|
||||
@@ -79,14 +79,11 @@ Driver =
|
||||
|
||||
local function getDiscoveredRepos(host)
|
||||
|
||||
if ( not(nmap.registry.cvs) or
|
||||
not(nmap.registry.cvs[host.ip]) or
|
||||
not(nmap.registry.cvs[host.ip].repos)
|
||||
) then
|
||||
if ( not(host.registry.cvs_repos)) then
|
||||
return
|
||||
end
|
||||
|
||||
return nmap.registry.cvs[host.ip].repos
|
||||
return host.registry.cvs_repos
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
|
||||
@@ -80,22 +80,22 @@ action = function(host)
|
||||
|
||||
|
||||
-- Get the list of NetBIOS names
|
||||
status, names, statistics = netbios.do_nbstat(host.ip)
|
||||
status, names, statistics = netbios.do_nbstat(host.ip)
|
||||
status, names, statistics = netbios.do_nbstat(host.ip)
|
||||
status, names, statistics = netbios.do_nbstat(host.ip)
|
||||
status, names, statistics = netbios.do_nbstat(host)
|
||||
status, names, statistics = netbios.do_nbstat(host)
|
||||
status, names, statistics = netbios.do_nbstat(host)
|
||||
status, names, statistics = netbios.do_nbstat(host)
|
||||
if(status == false) then
|
||||
return stdnse.format_output(false, names)
|
||||
end
|
||||
|
||||
-- Get the server name
|
||||
status, server_name = netbios.get_server_name(host.ip, names)
|
||||
status, server_name = netbios.get_server_name(host, names)
|
||||
if(status == false) then
|
||||
return stdnse.format_output(false, server_name)
|
||||
end
|
||||
|
||||
-- Get the logged in user
|
||||
status, user_name = netbios.get_user_name(host.ip, names)
|
||||
status, user_name = netbios.get_user_name(host, names)
|
||||
if(status == false) then
|
||||
return stdnse.format_output(false, user_name)
|
||||
end
|
||||
|
||||
@@ -261,10 +261,7 @@ end
|
||||
|
||||
-- Sets necessary probe data in registry
|
||||
local setreg = function(host, proto, port)
|
||||
if not nmap.registry[host.ip] then
|
||||
nmap.registry[host.ip] = {}
|
||||
end
|
||||
nmap.registry[host.ip]['pathmtuprobe'] = {
|
||||
host.registry['pathmtuprobe'] = {
|
||||
['proto'] = proto,
|
||||
['port'] = port
|
||||
}
|
||||
@@ -301,8 +298,8 @@ action = function(host)
|
||||
local mtuset
|
||||
local sock = nmap.new_dnet()
|
||||
local pcap = nmap.new_socket()
|
||||
local proto = nmap.registry[host.ip]['pathmtuprobe']['proto']
|
||||
local port = nmap.registry[host.ip]['pathmtuprobe']['port']
|
||||
local proto = host.registry['pathmtuprobe']['proto']
|
||||
local port = host.registry['pathmtuprobe']['port']
|
||||
local saddr = packet.toip(host.bin_ip_src)
|
||||
local daddr = packet.toip(host.bin_ip)
|
||||
local try = nmap.new_try()
|
||||
|
||||
@@ -45,6 +45,7 @@ dependencies = {"snmp-brute"}
|
||||
-- Revised 04/11/2010 - v0.2 - moved snmp_walk to snmp library <patrik@cqure.net>
|
||||
-- Revised 08/10/2010 - v0.3 - prerule; add interface addresses to Nmap's target list (Kris Katterjohn)
|
||||
-- Revised 05/27/2011 - v0.4 - action; add MAC addresses to nmap.registry[host.ip]["mac-geolocation"] (Gorjan Petrovski)
|
||||
-- Revised 07/31/2012 - v0.5 - action; remove mac-geolocation changes (script removed from trunk)
|
||||
|
||||
|
||||
|
||||
@@ -419,14 +420,6 @@ action = function(host, port)
|
||||
srvport = port.number
|
||||
end
|
||||
|
||||
-- table for mac-geolocation.nse
|
||||
if not nmap.registry[srvhost] then
|
||||
nmap.registry[srvhost] = {}
|
||||
nmap.registry[srvhost]["mac-geolocation"] = {}
|
||||
elseif not nmap.registry[srvhost]["mac-geolocation"] then
|
||||
nmap.registry[srvhost]["mac-geolocation"] = {}
|
||||
end
|
||||
|
||||
socket:set_timeout(5000)
|
||||
try(socket:connect(srvhost, srvport, "udp"))
|
||||
|
||||
@@ -453,14 +446,6 @@ action = function(host, port)
|
||||
end
|
||||
|
||||
local output = stdnse.format_output( true, build_results(interfaces) )
|
||||
|
||||
-- insert the MAC addresses into the mac-geolocation table
|
||||
for _,item in ipairs(interfaces) do
|
||||
if item.phys_addr then
|
||||
table.insert(nmap.registry[srvhost]["mac-geolocation"], item.phys_addr:match("^(%x+:%x+:%x+:%x+:%x+:%x+)"))
|
||||
end
|
||||
end
|
||||
-- wtf is this? table.insert(nmap.registry[srvhost]["mac-geolocation"], "00:23:69:2a:b1:27")
|
||||
|
||||
if SCRIPT_TYPE == "prerule" and target.ALLOW_NEW_TARGETS then
|
||||
local sum = 0
|
||||
|
||||
Reference in New Issue
Block a user