forked from xmendez/wfuzz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwfuzz.py
executable file
·53 lines (42 loc) · 1.43 KB
/
wfuzz.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python
#Covered by GPL V2.0
import sys
from framework.fuzzer.Fuzzer import Fuzzer
from framework.core.facade import Facade
from framework.core.myexception import FuzzException
from framework.ui.console.keystroke import KeyPress
from framework.ui.console.controller import Controller
from framework.ui.console.clparser import CLParser
kb = None
fz = None
printer = None
try:
# parse command line
session_options = CLParser(sys.argv).parse_cl()
# Create fuzzer's engine
fz = Fuzzer(session_options)
if session_options.get("interactive"):
# initialise controller
try:
kb = KeyPress()
except ImportError, e:
raise FuzzException(FuzzException.FATAL, "Error importing necessary modules for interactive mode: %s" % str(e))
else:
mc = Controller(fz, kb)
kb.start()
printer = Facade().get_printer(session_options.get("printer_tool"))
printer.header(fz.genReq.stats)
for res in fz:
printer.result(res) if res.is_visible else printer.noresult(res)
printer.footer(fz.genReq.stats)
except FuzzException, e:
print "\nFatal exception: %s" % e.msg
if fz: fz.cancel_job()
except KeyboardInterrupt:
print "\nFinishing pending requests..."
if fz: fz.cancel_job()
except NotImplementedError, e:
print "\nFatal exception: Error importing wfuzz extensions"
finally:
if kb: kb.cancel_job()
Facade().sett.save()