Skip to content

Commit

Permalink
removed moduleman_plugin decorator (fixes xmendez#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmendez committed Feb 12, 2015
1 parent c76e812 commit 7b15dd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
7 changes: 7 additions & 0 deletions framework/fuzzer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# decorator for iterator plugins
def wfuzz_iterator(gen_func):
method_args = ["count", "next", "__iter__"]

class _reiterator:
name = gen_func.name
description = gen_func.description
Expand All @@ -23,7 +25,12 @@ def __getattr__(self, method):
else:
return self.restart

for method in method_args:
if (not (method in dir(gen_func))):
raise Exception("Required method %s not implemented" % method)

_reiterator.__PLUGIN_MODULEMAN_MARK = "Plugin mark"

return _reiterator

class BaseFuzzRequest:
Expand Down
12 changes: 0 additions & 12 deletions plugins/payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
import cPickle as pickle
import gzip

from externals.moduleman.plugin import moduleman_plugin
from framework.core.myexception import FuzzException
from framework.fuzzer.base import wfuzz_iterator
from framework.plugins.api.payloadtools import BingIter
from framework.plugins.api.payloadtools import range_results, filter_results

@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class file:
name = "file"
description = "Returns each word from a file."
Expand Down Expand Up @@ -46,7 +44,6 @@ def next(self):


@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class range:
name = "range"
description = "Returns each number of the given range. ie. 0-10"
Expand Down Expand Up @@ -84,7 +81,6 @@ def __iter__(self):
return self

@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class hexrange:
name = "hexrange"
description = "Returns each hex number of the given hex range. ie. 00-ff"
Expand Down Expand Up @@ -122,7 +118,6 @@ def next(self):
return payl

@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class hexrand:
name = "hexrand"
description = "Returns random hex numbers."
Expand Down Expand Up @@ -157,7 +152,6 @@ def next (self):


@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class buffer_overflow:
name = "buffer_overflow"
description = "Returns a string using the following pattern A * given number."
Expand All @@ -183,7 +177,6 @@ def next (self):
raise StopIteration

@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class list:
name = "list"
description = "Returns each element of the given word list separated by -. ie word1-word2"
Expand Down Expand Up @@ -221,7 +214,6 @@ def next (self):
return elem

@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class stdin:
name = "stdin"
description = "Returns each item read from stdin."
Expand All @@ -247,7 +239,6 @@ def next (self):
return line

@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class names:
name = "names"
description = "Returns possible usernames by mixing the given words, separated by -, using known typical constructions. ie. jon-smith"
Expand Down Expand Up @@ -324,7 +315,6 @@ def next(self):
raise StopIteration

@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class permutation:
name = "permutation"
description = "Returns permutations of the given charset and length. ie. abc-2"
Expand Down Expand Up @@ -378,7 +368,6 @@ def xcombinations(self, items, n):
sys.exit()

@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class bing:
'''
Some examples of bing hacking:
Expand Down Expand Up @@ -411,7 +400,6 @@ def next(self):
return self._it.next()

@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class wfuzz:
name = "wfuzz"
description = "Returns fuzz results' URL from a previous stored wfuzz session."
Expand Down

0 comments on commit 7b15dd2

Please sign in to comment.