-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfuzz_http.py
More file actions
47 lines (39 loc) · 1.34 KB
/
fuzz_http.py
File metadata and controls
47 lines (39 loc) · 1.34 KB
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
#!/usr/bin/env python
# Designed for use with boofuzz v0.0.9
from boofuzz import *
def check_service():
target_ip = "192.168.2.2"
port = 5000
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
try:
s.connect((target_ip,int(port)))
print(target_ip)
s.shutdown(2)
print('{0} is open'.format(port))
return True
except:
print('{0} is close'.format(port))
return False
def main():
#session = Session(
# target=Target(
# connection=SocketConnection("192.168.2.2", 5000 , proto='tcp')
# ),
#)
session = Session()
target=Target(connection=SocketConnection("192.168.2.2", 5000, proto='tcp'))
target.procmon = instrumentation.External(pre=None, post=check_service, start=reset_target, stop=None)
session.add_target(target)
s_initialize(name="Request")
with s_block("Request-Line"):
s_group("Method", ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE'])
s_delim(" ", name='space-1')
s_string("/index.html", name='Request-URI')
s_delim(" ", name='space-2')
s_string('HTTP/1.1', name='HTTP-Version')
s_static("\r\n", name="Request-Line-CRLF")
s_static("\r\n", "Request-CRLF")
session.connect(s_get("Request"))
session.fuzz()
if __name__ == "__main__":
main()