Skip to content

Commit

Permalink
fix gowitness file error
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Dec 19, 2024
1 parent 42eebcd commit 0997b7c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bbot/modules/gowitness.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ async def handle_batch(self, *events):
url = screenshot["url"]
final_url = screenshot["final_url"]
filename = self.screenshot_path / screenshot["filename"]
filename = filename.relative_to(self.scan.home)
filename = self.helpers.truncate_filename(filename)
webscreenshot_data = {"path": str(filename), "url": final_url}
parent_event = event_dict[url]
await self.emit_event(
Expand Down
20 changes: 20 additions & 0 deletions bbot/test/test_step_2/module_tests/test_module_gowitness.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,23 @@ def check(self, module_test, events):
webscreenshots = [e for e in events if e.type == "WEBSCREENSHOT"]
assert webscreenshots, "failed to raise WEBSCREENSHOT events"
assert all("blob" in e.data and e.data["blob"] for e in webscreenshots), "blob not found in WEBSCREENSHOT data"


class TestGoWitnessLongFilename(TestGowitness):
"""
Make sure long filenames are truncated properly
"""
targets = ["http://127.0.0.1:8888/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity"]
config_overrides = {"file_blobs": True}

async def setup_after_prep(self, module_test):
request_args = {"uri": "/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity/blacklanternsecurity"}
respond_args = {
"response_data": "<html><head><title>BBOT is life</title></head><body>BBOT is life</body></html>",
"headers": {"Server": "Apache/2.4.41 (Ubuntu)"},
}
module_test.set_expect_requests(request_args, respond_args)

def check(self, module_test, events):
webscreenshots = [e for e in events if e.type == "WEBSCREENSHOT"]
assert webscreenshots, "failed to raise WEBSCREENSHOT events"

0 comments on commit 0997b7c

Please sign in to comment.