-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1048 from blacklanternsecurity/include-emails-wit…
…h-passwords Include source emails in credential leaks
- Loading branch information
Showing
9 changed files
with
88 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,6 +250,10 @@ async def test_events(events, scan, helpers, bbot_config): | |
corrected_event3 = scan.make_event("wat.asdf.com", "IP_ADDRESS", dummy=True) | ||
assert corrected_event3.type == "DNS_NAME" | ||
|
||
corrected_event4 = scan.make_event("[email protected]", "USERNAME", dummy=True) | ||
assert corrected_event4.type == "EMAIL_ADDRESS" | ||
assert "affiliate" in corrected_event4.tags | ||
|
||
test_vuln = scan.make_event( | ||
{"host": "EVILcorp.com", "severity": "iNfo ", "description": "asdf"}, "VULNERABILITY", dummy=True | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,18 +74,31 @@ def check(self, module_test, events): | |
assert 1 == len([e for e in events if e.type == "EMAIL_ADDRESS" and e.data == "[email protected]"]) | ||
assert 1 == len([e for e in events if e.type == "EMAIL_ADDRESS" and e.data == "[email protected]"]) | ||
assert 1 == len( | ||
[e for e in events if e.type == "HASHED_PASSWORD" and e.data == "539FE8942DEADBEEFBC49E6EB2F175AC"] | ||
[ | ||
e | ||
for e in events | ||
if e.type == "HASHED_PASSWORD" | ||
and e.data == "[email protected]:539FE8942DEADBEEFBC49E6EB2F175AC" | ||
] | ||
) | ||
assert 1 == len( | ||
[e for e in events if e.type == "HASHED_PASSWORD" and e.data == "D2D8F0E9A4A2DEADBEEF1AC80F36D61F"] | ||
[ | ||
e | ||
for e in events | ||
if e.type == "HASHED_PASSWORD" | ||
and e.data == "[email protected]:D2D8F0E9A4A2DEADBEEF1AC80F36D61F" | ||
] | ||
) | ||
assert 1 == len( | ||
[ | ||
e | ||
for e in events | ||
if e.type == "HASHED_PASSWORD" | ||
and e.data == "$2a$12$SHIC49jLIwsobdeadbeefuWb2BKWHUOk2yhpD77A0itiZI1vJqXHm" | ||
and e.data | ||
== "[email protected]:$2a$12$SHIC49jLIwsobdeadbeefuWb2BKWHUOk2yhpD77A0itiZI1vJqXHm" | ||
] | ||
) | ||
assert 1 == len([e for e in events if e.type == "PASSWORD" and e.data == "TimTamSlam69"]) | ||
assert 1 == len([e for e in events if e.type == "USERNAME" and e.data == "tim"]) | ||
assert 1 == len( | ||
[e for e in events if e.type == "PASSWORD" and e.data == "[email protected]:TimTamSlam69"] | ||
) | ||
assert 1 == len([e for e in events if e.type == "USERNAME" and e.data == "[email protected]:tim"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,11 @@ | |
|
||
|
||
class TestDehashed(ModuleTestBase): | ||
config_overrides = {"modules": {"dehashed": {"username": "admin", "api_key": "deadbeef"}}} | ||
modules_overrides = ["dehashed", "speculate"] | ||
config_overrides = { | ||
"scope_report_distance": 2, | ||
"modules": {"dehashed": {"username": "admin", "api_key": "deadbeef"}}, | ||
} | ||
|
||
async def setup_before_prep(self, module_test): | ||
module_test.httpx_mock.add_response( | ||
|
@@ -46,8 +50,9 @@ async def setup_before_prep(self, module_test): | |
) | ||
|
||
def check(self, module_test, events): | ||
assert len(events) == 9 | ||
assert 1 == len([e for e in events if e.type == "EMAIL_ADDRESS" and e.data == "[email protected]"]) | ||
assert len(events) == 11 | ||
assert 1 == len([e for e in events if e.type == "DNS_NAME" and e.data == "blacklanternsecurity.com"]) | ||
assert 1 == len([e for e in events if e.type == "ORG_STUB" and e.data == "blacklanternsecurity"]) | ||
assert 1 == len( | ||
[ | ||
e | ||
|
@@ -56,6 +61,22 @@ def check(self, module_test, events): | |
and e.data == "[email protected]" | ||
and e.scope_distance == 1 | ||
and "affiliate" in e.tags | ||
] | ||
) | ||
assert 1 == len( | ||
[ | ||
e | ||
for e in events | ||
if e.type == "DNS_NAME" and e.data == "bob.com" and e.scope_distance == 1 and "affiliate" in e.tags | ||
] | ||
) | ||
assert 1 == len([e for e in events if e.type == "EMAIL_ADDRESS" and e.data == "[email protected]"]) | ||
assert 1 == len( | ||
[ | ||
e | ||
for e in events | ||
if e.type == "USERNAME" | ||
and e.data == "[email protected]:[email protected]" | ||
and e.source.data == "[email protected]" | ||
] | ||
) | ||
|
@@ -65,8 +86,11 @@ def check(self, module_test, events): | |
e | ||
for e in events | ||
if e.type == "HASHED_PASSWORD" | ||
and e.data == "$2a$12$pVmwJ7pXEr3mE.DmCCE4fOUDdeadbeefd2KuCy/tq1ZUFyEOH2bve" | ||
and e.data | ||
== "[email protected]:$2a$12$pVmwJ7pXEr3mE.DmCCE4fOUDdeadbeefd2KuCy/tq1ZUFyEOH2bve" | ||
] | ||
) | ||
assert 1 == len([e for e in events if e.type == "PASSWORD" and e.data == "TimTamSlam69"]) | ||
assert 1 == len([e for e in events if e.type == "USERNAME" and e.data == "timmy"]) | ||
assert 1 == len( | ||
[e for e in events if e.type == "PASSWORD" and e.data == "[email protected]:TimTamSlam69"] | ||
) | ||
assert 1 == len([e for e in events if e.type == "USERNAME" and e.data == "[email protected]:timmy"]) |