-
Notifications
You must be signed in to change notification settings - Fork 48
/
burpy.py
48 lines (46 loc) · 1.71 KB
/
burpy.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
import core
def initiate(dict_req_resp):
'''
Script initiate.Write the initial part of report
'''
print '[+] Found '+str(len(dict_req_resp))+" request from Porvided Burp Log..."
raw_input('[+] Press Enter to start Test___')
print '[+] Starting Test..'
report_head = core.part1.replace('{number}',str(len(dict_req_resp))).replace('{target}',core.target_domain)
report = open('Report.html','w')
report.write(report_head)
report.close()
# Iterate through all req/response
for item in dict_req_resp:
if base.gerequestinfo(item,"Host") == core.target_domain:# Check whether request in in test scope
for testcase in moduledict:#execute all modules test Case
result = moduledict[testcase](item,core.ssl)
#if +ve then
#result[0] => Test Title
#result[1] => Final Crafted Resposne
#result[2] => reason
#result[3] => response code
#result[4] => dict of response headers
#result[5] => Response body
if len(result) > 5:
# Test case true
print '[+] Test Result Positive'
base.write_report(result[0],result[2],result[3],item,result[1],result[4],result[5])
#def write_report(self,title,res_reason,res_code,base_request,crafted_request,res_head_dict,latest_response):
else:
print '[+] Test Result Negative'
else:
print '[+] Skipping....Request not associated with ',core.target_domain
print '[+] Test Completed...Report.html Generated'
report = open('Report.html','a')# When test done, Close the report.
report.write(core.part3)
report.close()
if __name__ == '__main__':
base = core.Core()
base.banner()
base.cmd_option()
result = base.parse_log(core.burp_suite_log)
global target
target = core.target_domain
moduledict = base.loadallmodules()
initiate(result)