Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to social and code_repository modules to detect postman profiles and workspace links in pages #1753

Merged
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
1 change: 1 addition & 0 deletions bbot/modules/code_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class code_repository(BaseModule):
(r"gitlab.(?:com|org)/[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+", False),
],
"docker": (r"hub.docker.com/r/[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+", False),
"postman": (r"www.postman.com/[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+", False),
}

scope_distance_modifier = 1
Expand Down
1 change: 1 addition & 0 deletions bbot/modules/social.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class social(BaseModule):
"discord": (r"discord.gg/([a-zA-Z0-9_-]+)", True),
"docker": (r"hub.docker.com/[ru]/([a-zA-Z0-9_-]+)", False),
"huggingface": (r"huggingface.co/([a-zA-Z0-9_-]+)", False),
"postman": (r"www.postman.com/([a-zA-Z0-9_-]+)", False),
}

scope_distance_modifier = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ async def setup_after_prep(self, module_test):
<a href="https://gitlab.com/blacklanternsecurity/bbot"/>
<a href="https://gitlab.org/blacklanternsecurity/bbot"/>
<a href="https://hub.docker.com/r/blacklanternsecurity/bbot"/>
<a href="https://www.postman.com/blacklanternsecurity/bbot"/>
</html>
"""
}
module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args)

def check(self, module_test, events):
assert 4 == len([e for e in events if e.type == "CODE_REPOSITORY"])
assert 5 == len([e for e in events if e.type == "CODE_REPOSITORY"])
assert 1 == len(
[
e
Expand Down Expand Up @@ -57,3 +58,12 @@ def check(self, module_test, events):
and e.data["url"] == "https://hub.docker.com/r/blacklanternsecurity/bbot"
]
)
assert 1 == len(
[
e
for e in events
if e.type == "CODE_REPOSITORY"
and "postman" in e.tags
and e.data["url"] == "https://www.postman.com/blacklanternsecurity/bbot"
]
)
12 changes: 11 additions & 1 deletion bbot/test/test_step_2/module_tests/test_module_social.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ async def setup_after_prep(self, module_test):
<a href="https://hub.docker.com/r/blacklanternsecurity"/>
<a href="https://hub.docker.com/r/blacklanternsecurity/bbot"/>
<a href="https://hub.docker.com/r/blacklanternSECURITY/bbot"/>
<a href="https://www.postman.com/blacklanternsecurity/bbot"/>
</html>
"""
}
module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args)

def check(self, module_test, events):
assert 3 == len([e for e in events if e.type == "SOCIAL"])
assert 4 == len([e for e in events if e.type == "SOCIAL"])
assert 1 == len(
[
e
Expand All @@ -46,3 +47,12 @@ def check(self, module_test, events):
and e.data["profile_name"] == "blacklanternsecurity"
]
)
assert 1 == len(
[
e
for e in events
if e.type == "SOCIAL"
and e.data["platform"] == "postman"
and e.data["profile_name"] == "blacklanternsecurity"
]
)
Loading