Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions bbot/core/helpers/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ async def _baseline(self):
baseline_1_json = xmltodict.parse(baseline_1.text)
baseline_2_json = xmltodict.parse(baseline_2.text)
except ExpatError:
log.debug(f"Can't HTML parse for {self.baseline_url}. Switching to text parsing as a backup")
baseline_1_json = baseline_1.text.split("\n")
baseline_2_json = baseline_2.text.split("\n")

Expand Down Expand Up @@ -139,7 +138,6 @@ def compare_headers(self, headers_1, headers_2):
for header, value in list(headers.items()):
if header.lower() in self.baseline_ignore_headers:
with suppress(KeyError):
log.debug(f'found ignored header "{header}" in headers_{i + 1} and removed')
del headers[header]

ddiff = DeepDiff(headers_1, headers_2, ignore_order=True, view="tree", threshold_to_diff_deeper=0)
Expand Down Expand Up @@ -237,25 +235,18 @@ async def compare(
subject_json = xmltodict.parse(subject_response.text)

except ExpatError:
log.debug(f"Can't HTML parse for {subject.split('?')[0]}. Switching to text parsing as a backup")
subject_json = subject_response.text.split("\n")

diff_reasons = []

if self.baseline.status_code != subject_response.status_code:
log.debug(
f"status code was different [{str(self.baseline.status_code)}] -> [{str(subject_response.status_code)}], no match"
)
diff_reasons.append("code")

different_headers = self.compare_headers(self.baseline.headers, subject_response.headers)
if different_headers:
log.debug("headers were different, no match")
diff_reasons.append("header")

if self.compare_body(self.baseline_json, subject_json) is False:
log.debug("difference in HTML body, no match")

diff_reasons.append("body")

if not diff_reasons:
Expand Down
13 changes: 1 addition & 12 deletions bbot/modules/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@ async def _events_waiting(self, batch_size=None):
break
try:
event = self.incoming_event_queue.get_nowait()
self.debug(f"Got {event} from {getattr(event, 'module', 'unknown_module')}")
acceptable, reason = await self._event_postcheck(event)
if acceptable:
if event.type == "FINISHED":
Expand Down Expand Up @@ -766,7 +765,6 @@ async def _worker(self):
break
except asyncio.queues.QueueEmpty:
continue
self.debug(f"Got {event} from {getattr(event, 'module', 'unknown_module')}")
try:
async with self._task_counter.count(f"event_postcheck({event})"):
acceptable, reason = await self._event_postcheck(event)
Expand All @@ -781,13 +779,12 @@ async def _worker(self):
else:
context = f"{self.name}.handle_event({event})"
self.scan.stats.event_consumed(event, self)
self.debug(f"Handling {event}")
self.debug(f"Handling {event} from {getattr(event, 'module', 'unknown_module')}")
try:
await self.run_task(self.handle_event(event), context)
except asyncio.CancelledError:
self.debug(f"{context} was cancelled")
continue
self.debug(f"Finished handling {event}")
else:
self.debug(f"Not accepting {event} because {reason}")
finally:
Expand Down Expand Up @@ -940,7 +937,6 @@ async def _event_postcheck_inner(self, event):
if not filter_result:
return False, msg

self.debug(f"{event} passed post-check")
return True, ""

def _scope_distance_check(self, event):
Expand Down Expand Up @@ -1024,11 +1020,7 @@ async def queue_event(self, event):
return
acceptable, reason = self._event_precheck(event)
if not acceptable:
if reason and reason != "its type is not in watched_events":
self.debug(f"Not queueing {event} because {reason}")
return
else:
self.debug(f"Queueing {event} because {reason}")
try:
self.incoming_event_queue.put_nowait(event)
event._module_consumers += 1
Expand Down Expand Up @@ -1862,12 +1854,10 @@ async def _worker(self):
async with self._task_counter.count(f"event_precheck({event})"):
precheck_pass, reason = self._event_precheck(event)
if not precheck_pass:
self.debug(f"Not intercepting {event} because precheck failed ({reason})")
acceptable = False
async with self._task_counter.count(f"event_postcheck({event})"):
postcheck_pass, reason = await self._event_postcheck(event)
if not postcheck_pass:
self.debug(f"Not intercepting {event} because postcheck failed ({reason})")
acceptable = False

# whether to pass the event on to the rest of the scan
Expand All @@ -1891,7 +1881,6 @@ async def _worker(self):
self.debug(f"Not forwarding {event} because {forward_event_reason}")
continue

self.debug(f"Forwarding {event}")
await self.forward_event(event, kwargs)

except asyncio.CancelledError:
Expand Down
6 changes: 0 additions & 6 deletions bbot/modules/lightfuzz/submodules/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,8 @@ async def fuzz(self):
continue

if matches_baseline:
self.debug(f"Payload {payload_type} matches baseline, skipping")
continue

self.debug(f"Probe result for {payload_type}: {response}")

status_code = getattr(response, "status_code", 0)
if status_code == 0:
continue
Expand All @@ -159,8 +156,6 @@ async def fuzz(self):
self.debug(f"Status code {status_code} not in (200, 500), skipping")
continue

# if the status code changed to 200, and the response doesn't match our general error exclusions, we have a finding
self.debug(f"Potential finding detected for {payload_type}, needs confirmation")
if (
status_code == 200
and "code" in diff_reasons
Expand Down Expand Up @@ -199,7 +194,6 @@ def get_title(text):
# if the first case doesn't match, we check for a telltale error string like "java.io.optionaldataexception" in the response.
# but only if the response is a 500, or a 200 with a body diff
elif status_code == 500 or (status_code == 200 and diff_reasons == ["body"]):
self.debug(f"500 status code or body match for {payload_type}")
for serialization_error in serialization_errors:
# check for the error string, but also ensure the error string isn't just always present in the response
if (
Expand Down
7 changes: 1 addition & 6 deletions bbot/modules/paramminer_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ async def handle_event(self, event):
if self.config.get("skip_boring_words", True) and parameter_name in self.boring_words:
return
if parameter_name not in self.wl: # Ensure it's not already in the wordlist
self.debug(f"Adding {parameter_name} to wordlist")
self.extracted_words_master.add(parameter_name)

elif event.type == "HTTP_RESPONSE":
Expand Down Expand Up @@ -224,7 +223,7 @@ def gen_count_args(self, url):
async def binary_search(self, compare_helper, url, group, reasons=None, reflection=False):
if reasons is None:
reasons = []
self.debug(f"Entering recursive binary_search with {len(group):,} sized group")
self.debug(f"Entering binary_search with {len(group):,} sized group for URL [{url}]")
if len(group) == 1 and len(reasons) > 0:
yield group[0], reasons, reflection
elif len(group) > 1 or (len(group) == 1 and len(reasons) == 0):
Expand All @@ -233,10 +232,6 @@ async def binary_search(self, compare_helper, url, group, reasons=None, reflecti
if match is False:
async for r in self.binary_search(compare_helper, url, group_slice, reasons, reflection):
yield r
else:
self.debug(
f"binary_search() failed to start with group of size {str(len(group))} and {str(len(reasons))} length reasons"
)

async def check_batch(self, compare_helper, url, header_list):
rand = self.rand_string()
Expand Down
1 change: 0 additions & 1 deletion bbot/modules/telerik.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ async def handle_event(self, event):
if base_url not in self.RAUConfirmed:
self.RAUConfirmed.append(base_url)
root_tool_path = self.scan.helpers.tools_dir / "telerik"
self.debug(root_tool_path)

for version in self.telerikVersions:
command = [
Expand Down
Loading