mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 06:01:28 +00:00
Make an iterator to read the data file in http-wordpress-plugins.
This commit is contained in:
@@ -47,6 +47,13 @@ local DEFAULT_PLUGINS_SEARCH = 100
|
|||||||
|
|
||||||
portrule = shortport.service("http")
|
portrule = shortport.service("http")
|
||||||
|
|
||||||
|
local function read_data_file(file)
|
||||||
|
return coroutine.wrap(function()
|
||||||
|
for line in file:lines(file) do
|
||||||
|
coroutine.yield(line)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
action = function(host, port)
|
action = function(host, port)
|
||||||
|
|
||||||
@@ -104,12 +111,7 @@ action = function(host, port)
|
|||||||
|
|
||||||
--build a table of both directories to brute force and the corresponding WP plugins' name
|
--build a table of both directories to brute force and the corresponding WP plugins' name
|
||||||
local plugin_count = 0
|
local plugin_count = 0
|
||||||
while true do
|
for line in read_data_file(file) do
|
||||||
local line = file:read()
|
|
||||||
if not line then
|
|
||||||
break
|
|
||||||
end
|
|
||||||
|
|
||||||
if plugins_search and plugin_count >= plugins_search then
|
if plugins_search and plugin_count >= plugins_search then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user