Skip to content

Commit

Permalink
blacked
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 6, 2024
1 parent bc61c59 commit c72eccf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bbot/test/test_step_1/test_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,12 @@ async def test_blacklist_regex(bbot_scanner, bbot_httpserver):
assert "http://test.com/asdf/123456.aspx?a=asdf" in blacklist
assert "http://test.com/asdf/123456.aspx" in blacklist

bbot_httpserver.expect_request(uri="/").respond_with_data("""
bbot_httpserver.expect_request(uri="/").respond_with_data(
"""
<a href='http://127.0.0.1:8888/asdfevil333asdf'/>
<a href='http://127.0.0.1:8888/logout.aspx'/>
""")
"""
)
bbot_httpserver.expect_request(uri="/asdfevilasdf").respond_with_data("")
bbot_httpserver.expect_request(uri="/logout.aspx").respond_with_data("")

Expand All @@ -396,7 +398,10 @@ async def test_blacklist_regex(bbot_scanner, bbot_httpserver):
)
print(scan.target.blacklist.blacklist_regexes)
assert scan.target.blacklist.blacklist_regexes
assert set([r.pattern for r in scan.target.blacklist.blacklist_regexes]) == {r"evil[0-9]{3}", r"/.*(sign[_-]?out|log[_-]?out)"}
assert set([r.pattern for r in scan.target.blacklist.blacklist_regexes]) == {
r"evil[0-9]{3}",
r"/.*(sign[_-]?out|log[_-]?out)",
}
events = [e async for e in scan.async_start()]
urls = [e.data for e in events if e.type == "URL"]
assert len(urls) == 1
Expand Down

0 comments on commit c72eccf

Please sign in to comment.