1from wfuzz.externals.moduleman.plugin import moduleman_plugin
2from wfuzz.plugin_api.payloadtools import BingIter
3from wfuzz.plugin_api.base import BasePayload
4from wfuzz.fuzzobjects import FuzzWordType
5
6
7@moduleman_plugin
8class bing(BasePayload):
9    name = "bing"
10    author = ("Xavi Mendez (@xmendez)",)
11    version = "0.2"
12    description = (
13        'intitle:"JBoss JMX Management Console"',
14        "Some examples of bing hacking:",
15        "http://www.elladodelmal.com/2010/02/un-poco-de-bing-hacking-i-de-iii.html",
16    )
17
18    summary = "Returns URL results of a given bing API search (needs api key)."
19    category = ["default"]
20    priority = 99
21
22    parameters = (
23        ("dork", "", True, "Google dork search string."),
24        ("offset", "0", False, "Offset index, starting at zero."),
25        ("limit", "0", False, "Number of results. Zero for all."),
26    )
27
28    default_parameter = "dork"
29
30    def __init__(self, params):
31        BasePayload.__init__(self, params)
32
33        offset = int(params["offset"])
34        limit = int(params["limit"])
35
36        self._it = BingIter(params["dork"], offset, limit)
37
38    def count(self):
39        return self._it.max_count
40
41    def get_next(self):
42        return next(self._it)
43
44    def get_type(self):
45        return FuzzWordType.WORD
46