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

Dev --> Stable 1.1.1 #668

Merged
merged 152 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
2fb24fb
webhook output modules
TheTechromancer Aug 14, 2023
993f44e
Merge pull request #663 from blacklanternsecurity/webhook-output
TheTechromancer Aug 14, 2023
25fa2db
updated docs, fixed docs publishing pipeline
TheTechromancer Aug 14, 2023
78837f1
Refresh module docs
blsaccess Aug 14, 2023
6a05ccb
increment version
TheTechromancer Aug 14, 2023
331d581
updated versioning template
TheTechromancer Aug 14, 2023
66a52e4
update for PEP 440
TheTechromancer Aug 14, 2023
2c1195a
added chaos module
TheTechromancer Aug 14, 2023
a4f283e
Merge pull request #664 from blacklanternsecurity/fix-docs-pipeline
TheTechromancer Aug 15, 2023
ef122de
Merge pull request #665 from blacklanternsecurity/chaos
TheTechromancer Aug 15, 2023
33c15f0
Refresh module docs
blsaccess Aug 15, 2023
cd41be4
include findings in webhook output modules
TheTechromancer Aug 15, 2023
0ef1f1a
fixed names
TheTechromancer Aug 15, 2023
16ef2c6
Merge pull request #667 from blacklanternsecurity/webhook-output
TheTechromancer Aug 15, 2023
e07b91f
fix publish actions, update docs for webhook modules
TheTechromancer Aug 15, 2023
c6bf1f9
Refresh module docs
blsaccess Aug 15, 2023
7ec5d19
fix version
TheTechromancer Aug 15, 2023
99b5023
Merge pull request #669 from blacklanternsecurity/webhook-output
TheTechromancer Aug 15, 2023
e416fcb
more aggressive task cancelling
TheTechromancer Aug 16, 2023
d8955a8
fix missing import
TheTechromancer Aug 16, 2023
39e02ec
fix tests
TheTechromancer Aug 16, 2023
11e714c
pytest timeouts
TheTechromancer Aug 17, 2023
625fdb2
better error handling for canary check
liquidsec Aug 17, 2023
4fe76a4
Merge pull request #674 from blacklanternsecurity/url_manipulation_er…
TheTechromancer Aug 17, 2023
1f81ad2
fix oauth module, suppress cancellederrors
TheTechromancer Aug 17, 2023
4d60184
httpx race condition temporary fix
TheTechromancer Aug 18, 2023
a644205
temporarily disabled ntlm cancellations
TheTechromancer Aug 21, 2023
f4bc30e
fixed URL parsing bug
TheTechromancer Aug 22, 2023
b3fff6c
fix dns tests
TheTechromancer Aug 22, 2023
437367c
reverted httpcore version
TheTechromancer Aug 22, 2023
13b8bf9
Merge pull request #671 from blacklanternsecurity/webhook-output
TheTechromancer Aug 22, 2023
fca2ff8
log to scan folders
TheTechromancer Aug 22, 2023
ab09a9d
fix logging in tests
TheTechromancer Aug 22, 2023
71a3161
improve logging tests
TheTechromancer Aug 22, 2023
bb8f440
make double sure scan homedir is created
TheTechromancer Aug 22, 2023
084d753
keep more scans during tests
TheTechromancer Aug 22, 2023
2080895
don't clean up older scans during tests
TheTechromancer Aug 22, 2023
43b4dab
improved scan logging
TheTechromancer Aug 23, 2023
f4b3fa0
merge dev
TheTechromancer Aug 23, 2023
1f36524
fix inconsistency with human output
TheTechromancer Aug 24, 2023
90dd0d2
Merge pull request #677 from blacklanternsecurity/better-scan-logging
TheTechromancer Aug 28, 2023
c0f63a5
introduce AZURE_TENANT event type
TheTechromancer Aug 28, 2023
ddc3a9a
temporary fix - ntlm tests
TheTechromancer Aug 30, 2023
26db909
fix bug with tags
TheTechromancer Aug 30, 2023
7e4891f
don't update docs except on push
TheTechromancer Aug 30, 2023
d533ea5
fixed event loop error with agent tests
TheTechromancer Aug 30, 2023
b57fdbc
temporarily squash ntlm bug
TheTechromancer Aug 30, 2023
12a1d43
blacked
TheTechromancer Aug 30, 2023
53bde9c
tests for web_spider_links_per_page
TheTechromancer Aug 30, 2023
2ad3555
Merge pull request #683 from blacklanternsecurity/azure-tenant
TheTechromancer Aug 31, 2023
ee16634
Update nuclei.py for usability and impoves error handling
AkikoOrenji Aug 29, 2023
ea66ab7
code formatting, tweaking source correlation logic
TheTechromancer Aug 30, 2023
6b1bd1c
add '/control/' to websocket url
batgoose Aug 24, 2023
b5e9e62
add '/control/ to another spot
batgoose Aug 25, 2023
3656e30
formatting
batgoose Aug 25, 2023
7bb5597
updated agent tests
TheTechromancer Aug 31, 2023
0da5a94
Merge pull request #682 from blacklanternsecurity/681-agent-url-for-w…
TheTechromancer Sep 1, 2023
c84d50d
Merge pull request #684 from AkikoOrenji/AkikoOrenji-nuclei.py-fixes-1
TheTechromancer Sep 1, 2023
5dd6da3
Create ip2locationio.py
ip2location Sep 8, 2023
d224aa2
blacked, code cleanup
TheTechromancer Sep 12, 2023
2e2acbe
wrote module tests
TheTechromancer Sep 12, 2023
786f950
add test file
TheTechromancer Sep 12, 2023
bb250eb
azure_tenant bugfix
TheTechromancer Sep 12, 2023
896f74e
fix produced_events for azure_realm
TheTechromancer Sep 12, 2023
b976982
Merge pull request #691 from blacklanternsecurity/azure-tenant-bugfix
TheTechromancer Sep 12, 2023
017a5d5
Merge pull request #689 from ip2location/stable
TheTechromancer Sep 12, 2023
ba4fc61
Refresh module docs
blsaccess Sep 12, 2023
995358f
Update json.py to NDJSON terminology
nicpenning Sep 17, 2023
82b6f91
Update output.md to use output.ndjson
nicpenning Sep 17, 2023
3170cad
Rename test_output.json to test_output.ndjson
nicpenning Sep 17, 2023
4935d03
Update test_python_api.py to use output.ndjson
nicpenning Sep 17, 2023
d3c84e4
Update test_module_json.py to use output.ndjson
nicpenning Sep 17, 2023
d7b5673
Update test_cli.py to use output.ndjson
nicpenning Sep 17, 2023
5847e2b
Merge branch 'dev' into stable
nicpenning Sep 17, 2023
bc5b82f
fix NSEC infinite loop bug
TheTechromancer Sep 17, 2023
9c6c490
fixed tests, updated docs image
TheTechromancer Sep 18, 2023
36e07b2
update nuclei version
TheTechromancer Sep 18, 2023
763268f
improve punycode support
TheTechromancer Sep 18, 2023
5d4d434
blacked
TheTechromancer Sep 18, 2023
72524fc
added pre-commit
TheTechromancer Sep 18, 2023
641eec4
Merge pull request #740 from blacklanternsecurity/update-nuclei
TheTechromancer Sep 18, 2023
e381ed2
Merge pull request #737 from blacklanternsecurity/nsec-fix
TheTechromancer Sep 18, 2023
5e3de3a
Refresh module docs
blsaccess Sep 18, 2023
2833060
update docs, custom poetry script
TheTechromancer Sep 18, 2023
e4af629
fix pyproject.toml
TheTechromancer Sep 18, 2023
b32a8a6
update docs
TheTechromancer Sep 18, 2023
0640bce
fix tests
TheTechromancer Sep 18, 2023
c43b30c
fix minor but with waf events scope distance
TheTechromancer Sep 18, 2023
c87a5a5
Merge pull request #744 from blacklanternsecurity/waf-event-bugfix
TheTechromancer Sep 19, 2023
6e17307
Merge pull request #743 from blacklanternsecurity/pre-commit
TheTechromancer Sep 19, 2023
7c34499
don't punycode-encode non-host segments
TheTechromancer Sep 19, 2023
7daaf75
smart decode in extract_host
TheTechromancer Sep 19, 2023
3c795dc
fixed tests
TheTechromancer Sep 19, 2023
edb4f59
continued work on tests
TheTechromancer Sep 19, 2023
54d33d6
include traceback
TheTechromancer Sep 19, 2023
4574532
revised split_host_port() helper
TheTechromancer Sep 19, 2023
60d1af1
utilize target for source event correlation in massdns
TheTechromancer Sep 20, 2023
02faebe
reintroduce custom dns resolvers for projectdiscovery tools
TheTechromancer Sep 20, 2023
9cb214b
Added ability to kill modules during scan
TheTechromancer Sep 20, 2023
1e88022
Merge pull request #748 from blacklanternsecurity/target-for-event-co…
TheTechromancer Sep 22, 2023
76b4315
Merge pull request #751 from blacklanternsecurity/kill-modules
TheTechromancer Sep 22, 2023
54fb4c3
Merge pull request #741 from blacklanternsecurity/punycode-fix
TheTechromancer Sep 22, 2023
fba1e62
Merge pull request #749 from blacklanternsecurity/projectdiscovery-cu…
TheTechromancer Sep 22, 2023
98627fd
Merge pull request #735 from nicpenning/stable
TheTechromancer Sep 22, 2023
aaa3aba
Refresh module docs
blsaccess Sep 22, 2023
a11e7b8
fix poetry.lock conflicts
TheTechromancer Sep 20, 2023
c36be66
documenting Scanner() class
TheTechromancer Sep 12, 2023
590b4a2
steadily working through helpers
TheTechromancer Sep 12, 2023
ae0f173
refactor module inheritance
TheTechromancer Sep 13, 2023
3753724
code cleanup in geoip modules
TheTechromancer Sep 13, 2023
0fd2ad2
fix tests
TheTechromancer Sep 13, 2023
4e3b107
resolve conflicts in modules/base.py
TheTechromancer Sep 22, 2023
8c8ff8d
tweak scanner docs
TheTechromancer Sep 13, 2023
9b2a7ce
documentation for Target
TheTechromancer Sep 14, 2023
d4d1cb3
documentation for ScanManager, Event
TheTechromancer Sep 14, 2023
baa1d46
fix agent tests
TheTechromancer Sep 14, 2023
8d03b1a
more scanner documentation
TheTechromancer Sep 14, 2023
b38ca86
even more scanner docs
TheTechromancer Sep 14, 2023
64380fe
blacked
TheTechromancer Sep 14, 2023
65041f5
resolve conflicts in helpers/misc.py
TheTechromancer Sep 22, 2023
6c51348
finished documenting misc helpers
TheTechromancer Sep 15, 2023
2f10635
steady work on developer documentation
TheTechromancer Sep 15, 2023
e6afb1c
fix tests, started interact.sh developer docs
TheTechromancer Sep 15, 2023
bf5fd41
interactsh developer documentation
TheTechromancer Sep 16, 2023
b6160e6
resolve conflicts in helpers/regexes.py
TheTechromancer Sep 22, 2023
c2dd699
docs for dns mutator, massdns module
TheTechromancer Sep 18, 2023
803386f
blacked
TheTechromancer Sep 18, 2023
14e78c3
add per_domain_only module attribute (cleaning up module inheritance)
TheTechromancer Sep 19, 2023
fefa3b5
remove unused root_domains template
TheTechromancer Sep 20, 2023
441caff
small update to docs index.md
TheTechromancer Sep 21, 2023
99e36eb
Add Discord Bot Example
TheTechromancer Sep 22, 2023
bce1335
update discord bot docs
TheTechromancer Sep 22, 2023
42a3ad2
cleaned up README
TheTechromancer Sep 22, 2023
8081379
cleaned up README
TheTechromancer Sep 22, 2023
7ea2311
fixed unhandled websockets error in agent
TheTechromancer Sep 25, 2023
6918978
fix 'unknown command: ping' error
TheTechromancer Sep 25, 2023
1d92059
fix websocket output URL from agent
TheTechromancer Sep 25, 2023
20edb21
fix agent tests
TheTechromancer Sep 25, 2023
1c27596
Merge pull request #761 from blacklanternsecurity/agent-fixes
TheTechromancer Sep 25, 2023
62d7a16
fix wayback URL validation error
TheTechromancer Sep 28, 2023
6c51461
Merge pull request #692 from blacklanternsecurity/mkdocstring
TheTechromancer Sep 29, 2023
b70d41e
Refresh module docs
blsaccess Sep 29, 2023
2aa711b
fix docs publishing
TheTechromancer Oct 2, 2023
85ff49a
update for current branch
TheTechromancer Oct 2, 2023
065ae62
fix tests
TheTechromancer Oct 2, 2023
70b029e
tests troubleshooting
TheTechromancer Oct 2, 2023
2e8d17e
fix test dedup concurrency
TheTechromancer Oct 3, 2023
e2d887c
restore branch criteria
TheTechromancer Oct 3, 2023
37b9de2
Merge pull request #764 from blacklanternsecurity/wayback-error-fix
TheTechromancer Oct 10, 2023
2728157
fix py2neo situation
TheTechromancer Oct 11, 2023
ee6b935
Merge pull request #773 from blacklanternsecurity/py2neo-emergency-fix
TheTechromancer Oct 11, 2023
09f492c
Merge pull request #767 from blacklanternsecurity/fix-docs-publishing
TheTechromancer Oct 11, 2023
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
23 changes: 12 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
- stable
- dev
pull_request:
pull_request_target:
types:
- closed

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -46,7 +43,7 @@ jobs:
poetry install
- name: Run tests
run: |
poetry run pytest --exitfirst --reruns 2 --disable-warnings --log-cli-level=DEBUG --cov-report xml:cov.xml --cov=bbot .
poetry run pytest --exitfirst --reruns 2 -o timeout_func_only=true --timeout 600 --disable-warnings --log-cli-level=DEBUG --cov-report xml:cov.xml --cov=bbot .
- name: Upload Code Coverage
uses: codecov/codecov-action@v3
with:
Expand All @@ -56,6 +53,7 @@ jobs:
update_docs:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/stable')
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -82,7 +80,7 @@ jobs:
publish_docs:
needs: update_docs
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.event.pull_request.base.ref == 'dev'
if: github.event_name == 'push' && (github.ref == 'refs/heads/dev')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -95,12 +93,15 @@ jobs:
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material mkdocs-extra-sass-plugin livereload
- run: mkdocs gh-deploy --force
- name: Install dependencies
run: |
pip install poetry
poetry install --only=docs
- run: poetry run mkdocs gh-deploy --force
publish_code:
needs: update_docs
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_target' && github.event.pull_request.merged == true && (github.event.pull_request.base.ref == 'dev' || github.event.pull_request.base.ref == 'stable')
if: github.event_name == 'push' && (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/stable')
continue-on-error: true
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -128,23 +129,23 @@ jobs:
run: |
echo "::set-output name=BBOT_VERSION::$(poetry version | cut -d' ' -f2 | tr -d v)"
- name: Publish to Docker Hub (dev)
if: github.ref == 'refs/heads/dev'
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: blacklanternsecurity/bbot
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "latest,dev,${{ steps.version.outputs.BBOT_VERSION }}"
- name: Publish to Docker Hub (stable)
if: github.ref == 'refs/heads/stable'
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: blacklanternsecurity/bbot
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "stable,${{ steps.version.outputs.BBOT_VERSION }}"
- name: Docker Hub Description
if: github.ref == 'refs/heads/dev'
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
Expand Down
36 changes: 29 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### OSINT automation for hackers.

[![Python Version](https://img.shields.io/badge/python-3.9+-FF8400)](https://www.python.org) [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![License](https://img.shields.io/badge/license-GPLv3-FF8400.svg)](https://github.com/blacklanternsecurity/bbot/blob/dev/LICENSE) [![DEF CON Demo Labs 2023](https://img.shields.io/badge/DEF%20CON%20Demo%20Labs-2023-FF8400.svg)](https://forum.defcon.org/node/246338) [![Tests](https://github.com/blacklanternsecurity/bbot/actions/workflows/tests.yml/badge.svg?branch=stable)](https://github.com/blacklanternsecurity/bbot/actions?query=workflow%3A"tests") [![Codecov](https://codecov.io/gh/blacklanternsecurity/bbot/branch/dev/graph/badge.svg?token=IR5AZBDM5K)](https://codecov.io/gh/blacklanternsecurity/bbot) [![Pypi Downloads](https://img.shields.io/pypi/dm/bbot)](https://pypi.org/project/bbot) [![Discord](https://img.shields.io/discord/859164869970362439)](https://discord.com/invite/PZqkgxu5SA)
[![Python Version](https://img.shields.io/badge/python-3.9+-FF8400)](https://www.python.org) [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![License](https://img.shields.io/badge/license-GPLv3-FF8400.svg)](https://github.com/blacklanternsecurity/bbot/blob/dev/LICENSE) [![DEF CON Demo Labs 2023](https://img.shields.io/badge/DEF%20CON%20Demo%20Labs-2023-FF8400.svg)](https://forum.defcon.org/node/246338) [![Tests](https://github.com/blacklanternsecurity/bbot/actions/workflows/tests.yml/badge.svg?branch=stable)](https://github.com/blacklanternsecurity/bbot/actions?query=workflow%3A"tests") [![Codecov](https://codecov.io/gh/blacklanternsecurity/bbot/branch/dev/graph/badge.svg?token=IR5AZBDM5K)](https://codecov.io/gh/blacklanternsecurity/bbot) [![Pypi Downloads](https://img.shields.io/pypi/dm/bbot)](https://pypistats.org/packages/bbot) [![Discord](https://img.shields.io/discord/859164869970362439)](https://discord.com/invite/PZqkgxu5SA)

BBOT (Bighuge BLS OSINT Tool) is a modular, recursive OSINT framework that can execute the entire OSINT workflow in a single command.

Expand All @@ -18,13 +18,9 @@ BBOT typically outperforms other subdomain enumeration tools by 20-25%. To learn

## Installation ([pip](https://pypi.org/project/bbot/))

For more installation methods including [Docker](https://hub.docker.com/r/blacklanternsecurity/bbot), see [Installation](https://www.blacklanternsecurity.com/bbot/#installation).
Note: Requires Linux and Python 3.9+. For more installation methods including [Docker](https://hub.docker.com/r/blacklanternsecurity/bbot), see [Installation](https://www.blacklanternsecurity.com/bbot/#installation).

```bash
# Prerequisites:
# - Linux (Windows and macOS are *not* supported)
# - Python 3.9 or newer

# stable version
pipx install bbot

Expand Down Expand Up @@ -84,7 +80,7 @@ bbot -t evilcorp.com -f subdomain-enum email-enum cloud-enum web-basic -m nmap g

## Targets

BBOT accepts an unlimited number of targets. You can specify targets either directly on the command line or in files (or both!). Targets can be any of the following:
BBOT accepts an unlimited number of targets via `-t`. You can specify targets either directly on the command line or in files (or both!). Targets can be any of the following:

- `DNS_NAME` (`evilcorp.com`)
- `IP_ADDRESS` (`1.2.3.4`)
Expand All @@ -94,8 +90,34 @@ BBOT accepts an unlimited number of targets. You can specify targets either dire

For more information, see [Targets](https://www.blacklanternsecurity.com/bbot/scanning/#targets-t). To learn how BBOT handles scope, see [Scope](https://www.blacklanternsecurity.com/bbot/scanning/#scope).

## API Keys

Similar to Amass or Subfinder, BBOT supports API keys for various third-party services such as SecurityTrails, etc.

The standard way to do this is to enter your API keys in **`~/.config/bbot/secrets.yml`**:
```yaml
modules:
shodan_dns:
api_key: 4f41243847da693a4f356c0486114bc6
c99:
api_key: 21a270d5f59c9b05813a72bb41707266
virustotal:
api_key: dd5f0eee2e4a99b71a939bded450b246
securitytrails:
api_key: d9a05c3fd9a514497713c54b4455d0b0
```

If you like, you can also specify them on the command line:
```bash
bbot -c modules.virustotal.api_key=dd5f0eee2e4a99b71a939bded450b246
```

For details, see [Configuration](https://www.blacklanternsecurity.com/bbot/scanning/configuration/)

## BBOT as a Python library

BBOT exposes a Python API that allows it to be used for all kinds of fun and nefarious purposes, like a [Discord Bot that responds to `/scan evilcorp.com`](https://www.blacklanternsecurity.com/bbot/dev/#bbot-python-library-advanced-usage#discord-bot-example).

**Synchronous**

```python
Expand Down
15 changes: 12 additions & 3 deletions bbot/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,17 @@ async def ws(self, rebuild=False):
verbs = ("Building", "Built")
if rebuild:
verbs = ("Rebuilding", "Rebuilt")
log.debug(f"{verbs[0]} websocket connection to {self.url}")
self._ws = await websockets.connect(self.url, **kwargs)
log.debug(f"{verbs[1]} websocket connection to {self.url}")
url = f"{self.url}/control/"
log.debug(f"{verbs[0]} websocket connection to {url}")
while 1:
try:
self._ws = await websockets.connect(url, **kwargs)
break
except Exception as e:
log.error(f'Failed to establish websockets connection to URL "{url}": {e}')
log.trace(traceback.format_exc())
await asyncio.sleep(1)
log.debug(f"{verbs[1]} websocket connection to {url}")
return self._ws

async def start(self):
Expand All @@ -69,6 +77,7 @@ async def start(self):
if message.command == "ping":
if self.scan is None:
await self.send({"conversation": str(message.conversation), "message_type": "pong"})
continue

command_type = getattr(messages, message.command, None)
if command_type is None:
Expand Down
17 changes: 15 additions & 2 deletions bbot/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3

import os
import re
import sys
import asyncio
import logging
Expand Down Expand Up @@ -138,6 +139,7 @@ async def _main():
*options.targets,
modules=list(modules),
output_modules=list(output_modules),
output_dir=options.output_dir,
config=config,
name=options.name,
whitelist=options.whitelist,
Expand Down Expand Up @@ -297,7 +299,7 @@ async def _main():

scanner.helpers.word_cloud.load()

await scanner.prep()
await scanner._prep()

if not options.dry_run:
if not options.agent_mode and not options.yes and sys.stdin.isatty():
Expand All @@ -306,14 +308,25 @@ async def _main():

def keyboard_listen():
allowed_errors = 10
kill_regex = re.compile(r"kill (?P<module>[a-z0-9_]+)")
while 1:
keyboard_input = "a"
try:
keyboard_input = input()
allowed_errors = 10
except Exception:
allowed_errors -= 1
if not keyboard_input:
if keyboard_input:
log.verbose(f'Got keyboard input: "{keyboard_input}"')
kill_match = kill_regex.match(keyboard_input)
if kill_match:
module = kill_match.group("module")
if module in scanner.modules:
log.hugewarning(f'Killing module: "{module}"')
scanner.manager.kill_module(module, message="killed by user")
else:
log.warning(f'Invalid module: "{module}"')
else:
toggle_log_level(logger=log)
scanner.manager.modules_status(_log=True)
if allowed_errors <= 0:
Expand Down
2 changes: 1 addition & 1 deletion bbot/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# logging
from .logger import init_logging

logging_queue, logging_handlers = init_logging()
init_logging()
2 changes: 0 additions & 2 deletions bbot/core/configurator/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ def prepare_environment(bbot_config):
# debug
bbot_config["debug"] = args.cli_options.debug
bbot_config["silent"] = args.cli_options.silent
if args.cli_options.output_dir:
bbot_config["output_dir"] = args.cli_options.output_dir

import logging

Expand Down
Loading
Loading