Skip to content

Commit

Permalink
limit in shodanp
Browse files Browse the repository at this point in the history
  • Loading branch information
xmendez committed Apr 15, 2019
1 parent cb509e8 commit fa28eb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/wfuzz/plugin_api/payloadtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def __init__(self, dork, page, limit):
self.api = shodan.Shodan(key)
self._dork = dork
self._page = MyCounter(page)
self._page_limit = limit

self.results_queue = Queue(self.MAX_ENQUEUED_RES)
self.page_queue = Queue()
Expand All @@ -165,6 +166,11 @@ def _do_search(self):
self.page_queue.task_done()
continue

if page > self._page_limit:
self.page_queue.task_done()
self.results_queue.put(None)
continue

try:
results = self.api.search(self._dork, page=page)
for item in results['matches']:
Expand Down
2 changes: 1 addition & 1 deletion src/wfuzz/plugins/payloads/shodanp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class shodanp(BasePayload):
parameters = (
("search", "", True, "Shodan search string."),
("page", "0", False, "Offset page, starting at zero."),
# TODO: ("limit", "0", False, "Number of results (1 query credit = 100 results). Zero for all."),
("limit", "0", False, "Number of pages (1 query credit = 100 results). Zero for all."),
)

default_parameter = "search"
Expand Down

0 comments on commit fa28eb2

Please sign in to comment.