bbot 2.3.0.5467rc0__py3-none-any.whl → 2.3.0.5473rc0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bbot might be problematic. Click here for more details.

bbot/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # version placeholder (replaced by poetry-dynamic-versioning)
2
- __version__ = "v2.3.0.5467rc"
2
+ __version__ = "v2.3.0.5473rc"
3
3
 
4
4
  from .scanner import Scanner, Preset
bbot/cli.py CHANGED
@@ -260,9 +260,7 @@ async def _main():
260
260
  finally:
261
261
  # save word cloud
262
262
  with suppress(BaseException):
263
- save_success, filename = scan.helpers.word_cloud.save()
264
- if save_success:
265
- log_to_stderr(f"Saved word cloud ({len(scan.helpers.word_cloud):,} words) to {filename}")
263
+ scan.helpers.word_cloud.save()
266
264
  # remove output directory if empty
267
265
  with suppress(BaseException):
268
266
  scan.home.rmdir()
@@ -3,7 +3,11 @@ from bbot.modules.templates.sql import SQLTemplate
3
3
 
4
4
  class MySQL(SQLTemplate):
5
5
  watched_events = ["*"]
6
- meta = {"description": "Output scan data to a MySQL database", "created_date": "2024-11-13", "author": "@TheTechromancer"}
6
+ meta = {
7
+ "description": "Output scan data to a MySQL database",
8
+ "created_date": "2024-11-13",
9
+ "author": "@TheTechromancer",
10
+ }
7
11
  options = {
8
12
  "username": "root",
9
13
  "password": "bbotislife",
bbot/scanner/scanner.py CHANGED
@@ -124,6 +124,7 @@ class Scanner:
124
124
  self.duration_seconds = None
125
125
 
126
126
  self._success = False
127
+ self._scan_finish_status_message = None
127
128
 
128
129
  if scan_id is not None:
129
130
  self.id = str(scan_id)
@@ -425,14 +426,19 @@ class Scanner:
425
426
 
426
427
  self._stop_log_handlers()
427
428
 
429
+ if self._scan_finish_status_message:
430
+ log_fn = self.hugesuccess
431
+ if self.status.startswith("ABORT"):
432
+ log_fn = self.hugewarning
433
+ elif not self._success:
434
+ log_fn = self.critical
435
+ log_fn(self._scan_finish_status_message)
436
+
428
437
  async def _mark_finished(self):
429
- log_fn = self.hugesuccess
430
438
  if self.status == "ABORTING":
431
439
  status = "ABORTED"
432
- log_fn = self.hugewarning
433
440
  elif not self._success:
434
441
  status = "FAILED"
435
- log_fn = self.critical
436
442
  else:
437
443
  status = "FINISHED"
438
444
 
@@ -441,9 +447,9 @@ class Scanner:
441
447
  self.duration_seconds = self.duration.total_seconds()
442
448
  self.duration_human = self.helpers.human_timedelta(self.duration)
443
449
 
444
- status_message = f"Scan {self.name} completed in {self.duration_human} with status {status}"
450
+ self._scan_finish_status_message = f"Scan {self.name} completed in {self.duration_human} with status {status}"
445
451
 
446
- scan_finish_event = self.finish_event(status_message, status)
452
+ scan_finish_event = self.finish_event(self._scan_finish_status_message, status)
447
453
 
448
454
  # queue final scan event with output modules
449
455
  output_modules = [m for m in self.modules.values() if m._type == "output" and m.name != "python"]
@@ -457,7 +463,6 @@ class Scanner:
457
463
  await asyncio.sleep(0.05)
458
464
 
459
465
  self.status = status
460
- log_fn(status_message)
461
466
  return scan_finish_event
462
467
 
463
468
  def _start_modules(self):
bbot/scanner/target.py CHANGED
@@ -101,7 +101,7 @@ class BaseTarget(RadixTarget):
101
101
  events.add(event)
102
102
 
103
103
  # sort by host size to ensure consistency
104
- events = sorted(events, key=lambda e: (0 if not e.host else host_size_key(e.host)))
104
+ events = sorted(events, key=lambda e: ((0, 0) if not e.host else host_size_key(e.host)))
105
105
  for event in events:
106
106
  self.events.add(event)
107
107
  self._add(event.host, data=event)
@@ -2,7 +2,7 @@ from ..bbot_fixtures import * # noqa: F401
2
2
 
3
3
 
4
4
  @pytest.mark.asyncio
5
- async def test_target(bbot_scanner):
5
+ async def test_target_basic(bbot_scanner):
6
6
  from radixtarget import RadixTarget
7
7
  from ipaddress import ip_address, ip_network
8
8
  from bbot.scanner.target import BBOTTarget, ScanSeeds
@@ -245,6 +245,17 @@ async def test_target(bbot_scanner):
245
245
  assert len(events) == 3
246
246
  assert {e.type for e in events} == {"SCAN", "USERNAME"}
247
247
 
248
+ # users + orgs + domains
249
+ scan = bbot_scanner("USER:evilcorp", "ORG:evilcorp", "evilcorp.com")
250
+ await scan.helpers.dns._mock_dns(
251
+ {
252
+ "evilcorp.com": {"A": ["1.2.3.4"]},
253
+ },
254
+ )
255
+ events = [e async for e in scan.async_start()]
256
+ assert len(events) == 5
257
+ assert {e.type for e in events} == {"SCAN", "USERNAME", "ORG_STUB", "DNS_NAME"}
258
+
248
259
  # verify hash values
249
260
  bbottarget = BBOTTarget(
250
261
  "1.2.3.0/24",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bbot
3
- Version: 2.3.0.5467rc0
3
+ Version: 2.3.0.5473rc0
4
4
  Summary: OSINT automation for hackers.
5
5
  Home-page: https://github.com/blacklanternsecurity/bbot
6
6
  License: GPL-3.0
@@ -1,5 +1,5 @@
1
- bbot/__init__.py,sha256=o-HxRaR7bKz8Xphwgy9o1DxUfSQwwBitR7Gh9ipUc0Y,130
2
- bbot/cli.py,sha256=Qlgqabm8N6r6uO1RuwGaM7-VXDSP_NH-YUnDUTsDYPM,10877
1
+ bbot/__init__.py,sha256=bghIkQycSLymbVcV4jVa_CprXDUdqUPECcnUyWKcL1o,130
2
+ bbot/cli.py,sha256=SUEd4CcI-9QzFnqXpezza1sq_TNPcfDtJaSwL4MAl9g,10717
3
3
  bbot/core/__init__.py,sha256=l255GJE_DvUnWvrRb0J5lG-iMztJ8zVvoweDOfegGtI,46
4
4
  bbot/core/config/__init__.py,sha256=zYNw2Me6tsEr8hOOkLb4BQ97GB7Kis2k--G81S8vofU,342
5
5
  bbot/core/config/files.py,sha256=zANvrTRLJQIOWSNkxd9MpWmf9cQFr0gRZLUxeIbTwQc,1412
@@ -144,7 +144,7 @@ bbot/modules/output/discord.py,sha256=BzZW0T-DgZHo3xwaQbZ6DAA59wKIvCDV1LK82ev7A2
144
144
  bbot/modules/output/emails.py,sha256=mzZideMCNfB8-naQANO5g8Y9HdgviAihRsdY_xPQjbQ,1095
145
145
  bbot/modules/output/http.py,sha256=4UWKpbQx3EHpi24VIem6oSvXr0W0NZ3lDpJOmQ3Mwik,2582
146
146
  bbot/modules/output/json.py,sha256=zvM2NwWScGk3pN4wF0mm-OqVW_0ADYy95Am4T02VVD4,1289
147
- bbot/modules/output/mysql.py,sha256=mdIdu17otSuElA-_1OwnB3DV31lL0WcMrti38vqGsrY,1944
147
+ bbot/modules/output/mysql.py,sha256=IbH_1f7Dgtx5bCfX3yN61jzDAi9tuHjZsBaf5Eco8Wo,1975
148
148
  bbot/modules/output/neo4j.py,sha256=u950eUwu8YMql_WaBA38TN2bUhx7xnZdIIvYfR3xVcY,6114
149
149
  bbot/modules/output/nmap_xml.py,sha256=RZx3LFNi_OWxd0lJXY6Nk-_sSQBRidRnoWKyZEaUXrQ,7048
150
150
  bbot/modules/output/postgres.py,sha256=vsz3Gl9SKoWKhDidMFczksJzTeM0TZ7G9qY2rIYETF0,1938
@@ -226,9 +226,9 @@ bbot/scanner/preset/conditions.py,sha256=hFL9cSIWGEsv2TfM5UGurf0c91cyaM8egb5IngB
226
226
  bbot/scanner/preset/environ.py,sha256=9KbEOLWkUdoAf5Ez_2A1NNm6QduQElbnNnrPi6VDhZs,4731
227
227
  bbot/scanner/preset/path.py,sha256=Q29MO8cOEn690yW6bB08P72kbZ3C-H_TOEoXuwWnFM8,2274
228
228
  bbot/scanner/preset/preset.py,sha256=R8-RNEstx4kLMZcfz878qzmTpEH45kgg3itRK-FWw5I,40038
229
- bbot/scanner/scanner.py,sha256=GTTimZPPjX7vFIAgmMpPcxnn4ZijHE3yjMEfTORKy88,53853
229
+ bbot/scanner/scanner.py,sha256=9Lpl7N7lAurMB1gWknbxv3Ph28QQWoZlGmcwTQarHJY,54129
230
230
  bbot/scanner/stats.py,sha256=re93sArKXZSiD0Owgqk2J3Kdvfm3RL4Y9Qy_VOcaVk8,3623
231
- bbot/scanner/target.py,sha256=kYB2ItVzZDPaz1tj3iOe0LTkpntK7S8mfJ4qEJSOiSQ,11551
231
+ bbot/scanner/target.py,sha256=svWRL8CtmAhZ0gNjvslMp_GHtTUx9aysyiNENzPNwPQ,11556
232
232
  bbot/scripts/docs.py,sha256=ZLY9-O6OeEElzOUvTglO5EMkRv1s4aEuxJb2CthCVsI,10782
233
233
  bbot/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
234
234
  bbot/test/bbot_fixtures.py,sha256=PNIycAMcNWM8oZ6BvvQmSbif1sztdOgyQ_e9lfQA6gA,9981
@@ -261,7 +261,7 @@ bbot/test/test_step_1/test_python_api.py,sha256=GM5Kp2AAFl92ozo1kL6axsM87F8Gdq2_
261
261
  bbot/test/test_step_1/test_regexes.py,sha256=34-BHzDE5qdltE-sQIzkrTmJTL49QUYoTn2uT1DZLwI,14356
262
262
  bbot/test/test_step_1/test_scan.py,sha256=h3JP5RXnOUH8dqqq2Q_7yLpx1LCAEvqfE1bpHL7bDS0,5756
263
263
  bbot/test/test_step_1/test_scope.py,sha256=S2nssENKJKCvgXUMyU8MFQmXHeUIz0C_sbWGkdYti2A,3063
264
- bbot/test/test_step_1/test_target.py,sha256=O-r7WxLdO6C3FmhjhA9rfRWb3uX4xW0eEQX4qCMFG7Q,19127
264
+ bbot/test/test_step_1/test_target.py,sha256=CDfcCTuhh1Z-MdcSHC3lZ94ucDI2M-xacdv6-SchqxE,19512
265
265
  bbot/test/test_step_1/test_web.py,sha256=n9p9WhsEyN5I7S8RUUOEzF8v1CyeJjkmk4l6hnpOblY,18804
266
266
  bbot/test/test_step_2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
267
267
  bbot/test/test_step_2/module_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -416,8 +416,8 @@ bbot/wordlists/raft-small-extensions-lowercase_CLEANED.txt,sha256=ZSIVebs7ptMvHx
416
416
  bbot/wordlists/top_open_ports_nmap.txt,sha256=LmdFYkfapSxn1pVuQC2LkOIY2hMLgG-Xts7DVtYzweM,42727
417
417
  bbot/wordlists/valid_url_schemes.txt,sha256=0B_VAr9Dv7aYhwi6JSBDU-3M76vNtzN0qEC_RNLo7HE,3310
418
418
  bbot/wordlists/wordninja_dns.txt.gz,sha256=DYHvvfW0TvzrVwyprqODAk4tGOxv5ezNmCPSdPuDUnQ,570241
419
- bbot-2.3.0.5467rc0.dist-info/LICENSE,sha256=GzeCzK17hhQQDNow0_r0L8OfLpeTKQjFQwBQU7ZUymg,32473
420
- bbot-2.3.0.5467rc0.dist-info/METADATA,sha256=juUHmsiQQ5xi4za6EaWNTkTxP4IIspwsACBxEOT5cAw,17988
421
- bbot-2.3.0.5467rc0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
422
- bbot-2.3.0.5467rc0.dist-info/entry_points.txt,sha256=cWjvcU_lLrzzJgjcjF7yeGuRA_eDS8pQ-kmPUAyOBfo,38
423
- bbot-2.3.0.5467rc0.dist-info/RECORD,,
419
+ bbot-2.3.0.5473rc0.dist-info/LICENSE,sha256=GzeCzK17hhQQDNow0_r0L8OfLpeTKQjFQwBQU7ZUymg,32473
420
+ bbot-2.3.0.5473rc0.dist-info/METADATA,sha256=7QT7k3a3jRu02K-1pb7d4ApdhBF726OypEmQq3Ak6iI,17988
421
+ bbot-2.3.0.5473rc0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
422
+ bbot-2.3.0.5473rc0.dist-info/entry_points.txt,sha256=cWjvcU_lLrzzJgjcjF7yeGuRA_eDS8pQ-kmPUAyOBfo,38
423
+ bbot-2.3.0.5473rc0.dist-info/RECORD,,