-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
337 additions
and
177 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
*.txt text eol=lf | ||
*.json text eol=lf | ||
*.md text eol=lf | ||
*.sh text eol=lf | ||
*.sh text eol=lf |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[submodule "bbot/modules/playground"] | ||
path = bbot/modules/playground | ||
url = https://github.com/blacklanternsecurity/bbot-module-playground | ||
branch = main | ||
branch = main |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Learn more about this config here: https://pre-commit.com/ | ||
|
||
# To enable these pre-commit hooks run: | ||
# `pipx install pre-commit` or `brew install pre-commit` | ||
# Then in the project root directory run `pre-commit install` | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-byte-order-marker | ||
- id: check-case-conflict | ||
# - id: check-docstring-first | ||
# - id: check-executables-have-shebangs | ||
- id: check-json | ||
- id: check-merge-conflict | ||
# - id: check-shebang-scripts-are-executable | ||
- id: check-symlinks | ||
- id: check-toml | ||
- id: check-vcs-permalinks | ||
- id: check-xml | ||
# - id: check-yaml | ||
- id: debug-statements | ||
- id: destroyed-symlinks | ||
# - id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: file-contents-sorter | ||
- id: fix-byte-order-marker | ||
- id: forbid-new-submodules | ||
- id: forbid-submodules | ||
- id: mixed-line-ending | ||
- id: requirements-txt-fixer | ||
- id: sort-simple-yaml | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.8.0 | ||
hooks: | ||
- id: ruff | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/abravalheri/validate-pyproject | ||
rev: v0.23 | ||
hooks: | ||
- id: validate-pyproject |
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 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 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import json | ||
import aio_pika | ||
|
||
from bbot.modules.output.base import BaseOutputModule | ||
|
||
|
||
class RabbitMQ(BaseOutputModule): | ||
watched_events = ["*"] | ||
meta = { | ||
"description": "Output scan data to a RabbitMQ queue", | ||
"created_date": "2024-11-22", | ||
"author": "@TheTechromancer", | ||
} | ||
options = { | ||
"url": "amqp://guest:guest@localhost/", | ||
"queue": "bbot_events", | ||
} | ||
options_desc = { | ||
"url": "The RabbitMQ connection URL", | ||
"queue": "The RabbitMQ queue to publish events to", | ||
} | ||
deps_pip = ["aio_pika~=9.5.0"] | ||
|
||
async def setup(self): | ||
self.rabbitmq_url = self.config.get("url", "amqp://guest:guest@localhost/") | ||
self.queue_name = self.config.get("queue", "bbot_events") | ||
|
||
# Connect to RabbitMQ | ||
self.connection = await aio_pika.connect_robust(self.rabbitmq_url) | ||
self.channel = await self.connection.channel() | ||
|
||
# Declare the queue | ||
self.queue = await self.channel.declare_queue(self.queue_name, durable=True) | ||
self.verbose("RabbitMQ connection and queue setup successfully") | ||
return True | ||
|
||
async def handle_event(self, event): | ||
event_json = event.json() | ||
event_data = json.dumps(event_json).encode("utf-8") | ||
|
||
# Publish the message to the queue | ||
while 1: | ||
try: | ||
await self.channel.default_exchange.publish( | ||
aio_pika.Message(body=event_data), | ||
routing_key=self.queue_name, | ||
) | ||
break | ||
except Exception as e: | ||
self.error(f"Error publishing message to RabbitMQ: {e}, rerying...") | ||
await self.helpers.sleep(1) | ||
|
||
async def cleanup(self): | ||
# Close the connection | ||
await self.connection.close() | ||
self.verbose("RabbitMQ connection closed successfully") |
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 |
---|---|---|
|
@@ -16,5 +16,3 @@ config: | |
modules: | ||
baddns: | ||
enable_references: 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 |
---|---|---|
|
@@ -19,4 +19,3 @@ config: | |
extensions: asp,aspx,ashx,asmx,ascx | ||
telerik: | ||
exploit_RAU_crypto: 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
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 |
---|---|---|
|
@@ -15,7 +15,6 @@ | |
|
||
|
||
def test__module__tests(): | ||
|
||
preset = Preset() | ||
|
||
# make sure each module has a .py file | ||
|
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 |
---|---|---|
|
@@ -17,7 +17,6 @@ def run_bbot_multiprocess(queue): | |
|
||
|
||
def test_bbot_multiprocess(bbot_httpserver): | ||
|
||
bbot_httpserver.expect_request("/").respond_with_data("[email protected]") | ||
|
||
queue = multiprocessing.Queue() | ||
|
@@ -32,12 +31,10 @@ def test_bbot_multiprocess(bbot_httpserver): | |
|
||
|
||
def test_bbot_fastapi(bbot_httpserver): | ||
|
||
bbot_httpserver.expect_request("/").respond_with_data("[email protected]") | ||
fastapi_process = start_fastapi_server() | ||
|
||
try: | ||
|
||
# wait for the server to start with a timeout of 60 seconds | ||
start_time = time.time() | ||
while 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
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
Oops, something went wrong.