Skip to content

DNS Engine - Offload DNS to Dedicated Process#1231

Merged
TheTechromancer merged 108 commits intopresetsfrom
dns-engine
Apr 26, 2024
Merged

DNS Engine - Offload DNS to Dedicated Process#1231
TheTechromancer merged 108 commits intopresetsfrom
dns-engine

Conversation

@TheTechromancer
Copy link
Copy Markdown
Collaborator

@TheTechromancer TheTechromancer commented Apr 2, 2024

This PR adds an abstract Engine system in BBOT which uses pyzmq in ROUTER/DEALER mode to farm out resource-intensive tasks to a dedicated process. Pyzmq communicates using binary data over a local unix socket, which is very fast.

The DNS Engine is built on top of the abstract Engine class, but the same class should be able to be used for HTTP.

Original issue: #1223

Speed Benchmark

Command:

bbot -t tesla.com -f subdomain-enum -rf passive -em massdns

dev: 1 minute 57 seconds

dns-engine: 1 minute 0 seconds

TODO:

  • remove massdns queue logic added when dns parallelization was nerfed
  • ensure processes are always cleaned up properly
  • ensure zmq sockets are always cleaned up properly
  • Only start process when needed
  • reintroduce dns rate limit (or let it run free)?

Will be merged into #1058.

@TheTechromancer TheTechromancer self-assigned this Apr 2, 2024
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 86.97027% with 206 lines in your changes are missing coverage. Please review.

Project coverage is 91%. Comparing base (1dd8ab2) to head (18694c1).

Files Patch % Lines
bbot/core/engine.py 57% 71 Missing ⚠️
bbot/scanner/scanner.py 61% 58 Missing ⚠️
bbot/core/core.py 53% 11 Missing ⚠️
bbot/core/helpers/dns/engine.py 91% 11 Missing ⚠️
bbot/modules/base.py 90% 9 Missing ⚠️
bbot/core/helpers/dns/mock.py 84% 6 Missing ⚠️
bbot/modules/massdns.py 73% 6 Missing ⚠️
bbot/modules/internal/dns.py 98% 5 Missing ⚠️
bbot/core/config/logger.py 88% 4 Missing ⚠️
bbot/core/helpers/dns/dns.py 95% 4 Missing ⚠️
... and 11 more
Additional details and impacted files
@@           Coverage Diff            @@
##           presets   #1231    +/-   ##
========================================
- Coverage       92%     91%    -0%     
========================================
  Files          316     325     +9     
  Lines        21213   21611   +398     
========================================
+ Hits         19374   19662   +288     
- Misses        1839    1949   +110     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheTechromancer TheTechromancer mentioned this pull request Apr 4, 2024
42 tasks
@TheTechromancer TheTechromancer marked this pull request as ready for review April 4, 2024 16:30
@TheTechromancer TheTechromancer changed the base branch from presets to bbot-2.0 April 5, 2024 15:12
Copy link
Copy Markdown
Contributor

@stryker2k2 stryker2k2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Author walked me through this Pull Request. All questions were answered. Code looks good. Test(s) look legit. Realtime BBOT Demo of multi-processor usage was beneficial.

@TheTechromancer TheTechromancer merged commit 81ba613 into presets Apr 26, 2024
@TheTechromancer TheTechromancer deleted the dns-engine branch May 16, 2024 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants