Skip to content

Commit

Permalink
Merge pull request #986 from blacklanternsecurity/ffuf-options-passth…
Browse files Browse the repository at this point in the history
…rough

adding support for FFUF to use global custom headers
  • Loading branch information
TheTechromancer authored Jan 11, 2024
2 parents 22474d5 + 7122513 commit ef1983a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bbot/modules/deadly/ffuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ async def execute_ffuf(
command.append("-mc")
command.append("all")

for hk, hv in self.scan.config.get("http_headers", {}).items():
command += ["-H", f"{hk}: {hv}"]

async for found in self.helpers.run_live(command):
try:
found_json = json.loads(found)
Expand Down
21 changes: 21 additions & 0 deletions bbot/test/test_step_2/module_tests/test_module_ffuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,24 @@ async def setup_before_prep(self, module_test):
def check(self, module_test, events):
assert any(e.type == "URL_UNVERIFIED" and "console" in e.data for e in events)
assert not any(e.type == "URL_UNVERIFIED" and "11111111" in e.data for e in events)


class TestFFUFHeaders(TestFFUF):
test_wordlist = ["11111111", "console", "junkword1", "zzzjunkword2"]
config_overrides = {
"modules": {"ffuf": {"wordlist": tempwordlist(test_wordlist), "extensions": "php"}},
"http_headers": {"test": "test2"},
}

async def setup_before_prep(self, module_test):
expect_args = {"method": "GET", "headers": {"test": "test2"}, "uri": "/console.php"}
respond_args = {"response_data": "alive admin page"}
module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args)

expect_args = {"method": "GET", "uri": "/"}
respond_args = {"response_data": "alive"}
module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args)

def check(self, module_test, events):
assert any(e.type == "URL_UNVERIFIED" and "console" in e.data for e in events)
assert not any(e.type == "URL_UNVERIFIED" and "11111111" in e.data for e in events)

0 comments on commit ef1983a

Please sign in to comment.