mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Let tftp-enum substitute host's MAC address into filenames when known
This commit is contained in:
@@ -180,10 +180,18 @@ action = function(host, port)
|
|||||||
local filenames = generate_filenames(host)
|
local filenames = generate_filenames(host)
|
||||||
|
|
||||||
for i, filename in ipairs(filenames) do
|
for i, filename in ipairs(filenames) do
|
||||||
|
if filename:match('{[Mm][Aa][Cc]}') then
|
||||||
|
if not host.mac_addr then
|
||||||
|
goto next_filename
|
||||||
|
end
|
||||||
|
filename = filename:gsub('{MAC}', string.upper(stdnse.tohex(host.mac_addr)))
|
||||||
|
filename = filename:gsub('{mac}', stdnse.tohex(host.mac_addr))
|
||||||
|
end
|
||||||
local request_status = check_file_present(host, port, filename)
|
local request_status = check_file_present(host, port, filename)
|
||||||
if (request_status == FILE_FOUND) then
|
if (request_status == FILE_FOUND) then
|
||||||
table.insert(results, filename)
|
table.insert(results, filename)
|
||||||
end
|
end
|
||||||
|
::next_filename::
|
||||||
end
|
end
|
||||||
|
|
||||||
return stdnse.format_output(true, results)
|
return stdnse.format_output(true, results)
|
||||||
|
|||||||
Reference in New Issue
Block a user