Skip to content

Commit 5355e95

Browse files
committed
2024.10:Release
1 parent 2136705 commit 5355e95

File tree

5 files changed

+93
-13
lines changed

5 files changed

+93
-13
lines changed

ReportExplorer.py

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,17 @@ def update_font_size(delta):
104104
response_text.configure(font=new_font)
105105
web_page_before_text.configure(font=new_font)
106106
web_page_after_text.configure(font=new_font)
107+
request_text_base64.configure(font=new_font)
108+
response_text_base64.configure(font=new_font)
107109

108110
# Adjust Text widget height and width
109111
request_text.config(height=int(font_size * 1.5), width=int(font_size * 8))
110112
response_text.config(height=int(font_size * 1.5), width=int(font_size * 8))
111113
web_page_before_text.config(height=int(font_size * 1.5), width=int(font_size * 4))
112114
web_page_after_text.config(height=int(font_size * 1.5), width=int(font_size * 4))
113-
115+
request_text_base64.config(height=int(font_size * 1.5), width=int(font_size * 8))
116+
response_text_base64.config(height=int(font_size * 1.5), width=int(font_size * 8))
117+
114118
# Update font size for Treeview
115119
style.configure('Treeview', font=new_font)
116120

@@ -244,24 +248,53 @@ def update_font_size(delta):
244248
response_body_length_label = ttk.Label(web_page_after_tab, text="")
245249
response_body_length_label.pack()
246250

251+
# Create tab for Request/Response details base64
252+
request_response_tab_base64 = ttk.Frame(notebook)
253+
notebook.add(request_response_tab_base64, text='Base64')
254+
255+
# Create Panedwindow for Request/Response tabs base64
256+
request_response_paned_window_base64 = ttk.Panedwindow(request_response_tab_base64, orient=tk.HORIZONTAL)
257+
request_response_paned_window_base64.pack(expand=True, fill='both')
258+
259+
# Create frame for Request tab base64
260+
request_tab_base64 = ttk.Frame(request_response_paned_window_base64)
261+
request_response_paned_window_base64.add(request_tab_base64, weight=1)
262+
263+
# Create Text widget for displaying request details base64
264+
request_text_base64 = tk.Text(request_tab_base64, wrap='word', width=80, height=20)
265+
request_text_base64.pack(fill='both', expand=True)
266+
267+
# Create frame for Response tab base64
268+
response_tab_base64 = ttk.Frame(request_response_paned_window_base64)
269+
request_response_paned_window_base64.add(response_tab_base64, weight=1)
270+
271+
# Create Text widget for displaying response details base64
272+
response_text_base64 = tk.Text(response_tab_base64, wrap='word', width=80, height=20)
273+
response_text_base64.pack(fill='both', expand=True)
274+
247275
# Bind keyboard events to notebook
248276
request_text.bind("<KeyPress>", lambda event: ignore_keyboard(event, request_text, root, tk))
249277
response_text.bind("<KeyPress>", lambda event: ignore_keyboard(event, response_text, root, tk))
250278
web_page_before_text.bind("<KeyPress>", lambda event: ignore_keyboard(event, web_page_before_text, root, tk))
251279
web_page_after_text.bind("<KeyPress>", lambda event: ignore_keyboard(event, web_page_after_text, root, tk))
280+
response_text_base64.bind("<KeyPress>", lambda event: ignore_keyboard(event, response_text_base64, root, tk))
281+
request_text_base64.bind("<KeyPress>", lambda event: ignore_keyboard(event, request_text_base64, root, tk))
252282

253283
# Bind Right mouse click to copy selection
254284
request_text.bind("<Button-3>", lambda event: show_context_menu_notebook(event, request_text, root, tk))
255285
response_text.bind("<Button-3>", lambda event: show_context_menu_notebook(event, response_text, root, tk))
256286
web_page_before_text.bind("<Button-3>", lambda event: show_context_menu_notebook(event, web_page_before_text, root, tk))
257287
web_page_after_text.bind("<Button-3>", lambda event: show_context_menu_notebook(event, web_page_after_text, root, tk))
288+
response_text_base64.bind("<Button-3>", lambda event: show_context_menu_notebook(event, response_text_base64, root, tk))
289+
request_text_base64.bind("<Button-3>", lambda event: show_context_menu_notebook(event, request_text_base64, root, tk))
290+
258291

259292
# Bind Treeview click event to show_request_response function
260-
tree.bind('<ButtonRelease-1>', lambda event: show_request_response(event, tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, messagebox))
293+
tree.bind('<ButtonRelease-1>', lambda event: show_request_response(event, tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, request_text_base64, response_text_base64, messagebox))
261294

262295
# Bind Treeview up and down arrow keys to show_request_response function
263-
tree.bind('<Up>', lambda event: show_request_response(event, tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, messagebox))
264-
tree.bind('<Down>', lambda event: show_request_response(event, tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, messagebox))
296+
tree.bind('<Up>', lambda event: show_request_response(event, tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, request_text_base64, response_text_base64, messagebox))
297+
tree.bind('<Down>', lambda event: show_request_response(event, tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, request_text_base64, response_text_base64, messagebox))
265298

266299
# Bind the right-click event to the show_request_response function
267300
tree.bind("<Button-3>", lambda event: show_context_menu(event, tree, tk, root))

modules/misc_functions/print_banner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def print_banner():
2828
{global_variable.GREEN}### {global_variable.GREEN}###
2929
{global_variable.GREEN}### {global_variable.GREEN}###
3030
{global_variable.GREEN}### {global_variable.YELLOW}The First-Ever! Advance Browser Based Automated Web Form Fuzzing Tool {global_variable.GREEN}###
31-
{global_variable.GREEN}### {global_variable.YELLOW}Version : {global_variable.BLUE}v2024.5 {global_variable.GREEN}###
31+
{global_variable.GREEN}### {global_variable.YELLOW}Version : {global_variable.BLUE}v2024.10 {global_variable.GREEN}###
3232
{global_variable.GREEN}### {global_variable.YELLOW}Github : {global_variable.BLUE}https://github.com/netsquare/BrowserBruter {global_variable.GREEN}###
3333
{global_variable.GREEN}### {global_variable.YELLOW}Copyright : {global_variable.BLUE}Net-Square Solutions PVT LTD. (https://net-square.com) {global_variable.GREEN}###
3434
{global_variable.GREEN}### {global_variable.YELLOW}Documentation: {global_variable.BLUE}https://net-square.com/browserbruter {global_variable.GREEN}###

modules/report_explorer/show_data/show_request_response.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@
3030
"""
3131
##################################################################
3232

33-
def show_request_response(event, tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, messagebox):
33+
def show_request_response(event, tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, request_text_base64, response_text_base64, messagebox):
3434
# Allow time for selection to change
35-
tree.after(1, lambda: _process_selection(tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, messagebox))
35+
tree.after(1, lambda: _process_selection(tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, request_text_base64, response_text_base64, messagebox))
3636

37-
def _process_selection(tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, messagebox):
37+
def _process_selection(tree, tk, request_text, response_text, web_page_before_text, web_page_after_text, request_text_base64, response_text_base64, messagebox):
3838
# Get the newly selected item from the Treeview
3939
selected_item = tree.selection()
4040
if selected_item:
4141
iid = selected_item[0]
4242
index = tree.index(iid)
4343

4444
# Define required columns for request/response details
45-
required_columns = ['Method', 'URL', 'Request Headers', 'Response Status Code', 'Web Page Before', 'Web Page After', 'Response Body', 'Request Body']
45+
required_columns = ['Method', 'URL', 'Request Headers', 'Response Status Code', 'Web Page Before', 'Web Page After', 'Response Body', 'Request Body', 'Base64 Request', 'Base64 Response']
4646

4747
# Check if required columns are present in the DataFrame
4848
if all(col in re_global_variable.df.columns for col in required_columns):
@@ -61,6 +61,9 @@ def _process_selection(tree, tk, request_text, response_text, web_page_before_te
6161
web_page_before = re_global_variable.df.at[index, 'Web Page Before']
6262
web_page_after = re_global_variable.df.at[index, 'Web Page After']
6363

64+
request_base64 = re_global_variable.df.at[index, 'Base64 Request']
65+
response_base64 = re_global_variable.df.at[index, 'Base64 Response']
66+
6467
# Build full request and response strings
6568
full_request = f"{method} {url}\n{request_headers}\n{request_body}"
6669
full_response = f"HTTP/1.1 {response_status} {response_reason}\n{response_headers}\n{response_body}"
@@ -70,7 +73,13 @@ def _process_selection(tree, tk, request_text, response_text, web_page_before_te
7073
response_text.delete(1.0, tk.END)
7174
request_text.insert(tk.END, full_request)
7275
response_text.insert(tk.END, full_response)
73-
76+
77+
# Display the base64 data
78+
request_text_base64.delete(1.0, tk.END)
79+
response_text_base64.delete(1.0, tk.END)
80+
request_text_base64.insert(tk.END, request_base64)
81+
response_text_base64.insert(tk.END, response_base64)
82+
7483
# Display web page before and after details in the respective Text widgets
7584
web_page_before_text.delete(1.0, tk.END)
7685
web_page_after_text.delete(1.0, tk.END)

modules/reporting/final_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def generate_final_report():
7979
# Algorithm step: 9 get the csv writer object which writes csv data into report
8080
writer = csv.writer(final)
8181
# Algorithm step: 10 Insert column names or, in other words, headings
82-
writer.writerow(['Index', 'Request Time', 'Fuzzing', 'Payload', 'Method', 'URL', 'Request Headers', 'Request Body', 'Response Time', 'Cycle Time MilliSeconds', 'Response Status Code', 'Response Reason', 'Response Headers', 'Response Body', 'Response Length', 'Web Page Before', 'Web Page After'])
82+
writer.writerow(['Index', 'Request Time', 'Fuzzing', 'Payload', 'Method', 'URL', 'Request Headers', 'Request Body', 'Response Time', 'Cycle Time MilliSeconds', 'Response Status Code', 'Response Reason', 'Response Headers', 'Response Body', 'Response Length', 'Web Page Before', 'Web Page After', 'Base64 Request', 'Base64 Response'])
8383
# Algorithm step: 11 Iterate over each CSV file
8484
for csv_file in all_threads_files:
8585
# Algorithm step: 11.a get the temporary file

modules/reporting/write_single_fuzz_traffic.py

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import zlib # used for zlib decompression of http response
2323
import brotli # used for brotli decompression of http response
2424
import zstandard # used for zstd decompression of http response
25+
import base64 # used to encode the raw http request and response
2526
from traceback import format_exc
2627
from bs4 import BeautifulSoup as bs # used to make html into pretty format
2728
from urllib.parse import urlparse # used to parse the url
@@ -75,11 +76,48 @@ def write_http_request_response(element, this_threads_file, driver, payload, web
7576
writer = csv.writer(report)
7677
# Algorithm step: 6.
7778
for request in filtered_requests: # For each request
79+
try:
80+
base64_request = None
81+
base64_response = None
82+
# Converting request into base64
83+
request_headers_for_bs64 = "\r\n".join(f"{header}: {value}" for header, value in request.headers.items())
84+
85+
# Combine headers and raw body
86+
if request.body:
87+
raw_data_request = f"{request.method} {request.path} HTTP/1.1\r\n{request_headers_for_bs64}\r\n\r\n".encode('utf-8') + request.body
88+
else:
89+
raw_data_request = f"{request.method} {request.path} HTTP/1.1\r\n{request_headers_for_bs64}\r\n\r\n".encode('utf-8')
90+
91+
# Encode the raw data in Base64
92+
base64_request = base64.b64encode(raw_data_request).decode('utf-8')
93+
94+
# Converting response into base64
95+
response_headers_for_bs64 = "\r\n".join(f"{header}: {value}" for header, value in request.response.headers.items())
96+
# Combine headers and raw body
97+
if request.response.body:
98+
raw_data_response = f"HTTP/1.1 {request.response.status_code} {request.response.reason}\r\n{response_headers_for_bs64}\r\n\r\n".encode('utf-8') + request.response.body
99+
else:
100+
raw_data_response = f"HTTP/1.1 {request.response.status_code} {request.response.reason}\r\n{response_headers_for_bs64}\r\n\r\n".encode('utf-8')
101+
# Encode the raw data in Base64
102+
base64_response = base64.b64encode(raw_data_response).decode('utf-8')
103+
except Exception as e:
104+
log_error(format_exc())
105+
if global_variable.args.debug:
106+
print(e)
107+
pass
108+
else:
109+
pass
110+
78111
try: # Algorithm step: 6.a decode the request body
79112
request_body = request.body.decode("UTF-8")
80113
except UnicodeDecodeError:
81114
request_body = request.body
82115
try:
116+
# Check if the base64 request or base64 response are not none
117+
if base64_response is None:
118+
base64_response = "N/A"
119+
if base64_request is None:
120+
base64_request = "N/A"
83121
# Algorithm step: 6.b Get request response time
84122
request_time = request.date
85123
response_time = request.response.date
@@ -115,7 +153,7 @@ def write_http_request_response(element, this_threads_file, driver, payload, web
115153
[request_time.strftime('%Y-%m-%d %H:%M:%S'), str(element), str(payload), request.method, urllib.parse.unquote(request.url), request.headers, request_body, response_time.strftime('%Y-%m-%d %H:%M:%S'),
116154
cycle_time_in_milliseconds, request.response.status_code, request.response.reason, request.response.headers, response_body,
117155
len(request.response.body), bs(webpage_before,features="html.parser").prettify(),
118-
bs(webpage_after,features="html.parser").prettify()]]
156+
bs(webpage_after,features="html.parser").prettify(), base64_request, base64_response]]
119157
# Algorithm step: 6.i write the row in report
120158
writer.writerow(row)
121159
# Algorithm step: 6.j Check whether the output should be printed on the console or not
@@ -149,6 +187,6 @@ def write_http_request_response(element, this_threads_file, driver, payload, web
149187
[request_time.strftime('%Y-%m-%d %H:%M:%S'), str(element), str(payload), request.method, urllib.parse.unquote(request.url), request.headers, request_body, request_time.strftime('%Y-%m-%d %H:%M:%S'),
150188
'0', '0', "N/A", "N/A", "N/A",
151189
'0', bs(webpage_before,features="html.parser").prettify(),
152-
bs(webpage_after,features="html.parser").prettify()]]
190+
bs(webpage_after,features="html.parser").prettify(), base64_request, base64_response]]
153191
# write the row to report
154192
writer.writerow(row)

0 commit comments

Comments
 (0)