bbot 2.1.0.5021rc0__py3-none-any.whl → 2.1.0.5028rc0__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.
bbot/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # version placeholder (replaced by poetry-dynamic-versioning)
2
- __version__ = "v2.1.0.5021rc"
2
+ __version__ = "v2.1.0.5028rc"
3
3
 
4
4
  from .scanner import Scanner, Preset
bbot/core/event/base.py CHANGED
@@ -158,7 +158,7 @@ class BaseEvent:
158
158
  Raises:
159
159
  ValidationError: If either `scan` or `parent` are not specified and `_dummy` is False.
160
160
  """
161
- self.uuid = uuid.uuid4()
161
+ self._uuid = uuid.uuid4()
162
162
  self._id = None
163
163
  self._hash = None
164
164
  self._data = None
@@ -456,6 +456,13 @@ class BaseEvent:
456
456
  self._id = f"{self.type}:{self.data_hash.hex()}"
457
457
  return self._id
458
458
 
459
+ @property
460
+ def uuid(self):
461
+ """
462
+ A universally unique identifier for the event
463
+ """
464
+ return f"{self.type}:{self._uuid}"
465
+
459
466
  @property
460
467
  def data_hash(self):
461
468
  """
@@ -1718,7 +1725,7 @@ def event_from_json(j, siem_friendly=False):
1718
1725
  event = make_event(**kwargs)
1719
1726
  event_uuid = j.get("uuid", None)
1720
1727
  if event_uuid is not None:
1721
- event.uuid = uuid.UUID(event_uuid)
1728
+ event._uuid = uuid.UUID(event_uuid.split(":")[-1])
1722
1729
 
1723
1730
  resolved_hosts = j.get("resolved_hosts", [])
1724
1731
  event._resolved_hosts = set(resolved_hosts)
@@ -1730,7 +1737,8 @@ def event_from_json(j, siem_friendly=False):
1730
1737
  event._parent_id = parent_id
1731
1738
  parent_uuid = j.get("parent_uuid", None)
1732
1739
  if parent_uuid is not None:
1733
- event._parent_uuid = uuid.UUID(parent_uuid)
1740
+ parent_type, parent_uuid = parent_uuid.split(":", 1)
1741
+ event._parent_uuid = parent_type + ":" + str(uuid.UUID(parent_uuid))
1734
1742
  return event
1735
1743
  except KeyError as e:
1736
1744
  raise ValidationError(f"Event missing required field: {e}")
@@ -54,6 +54,9 @@ ptr_regex = re.compile(_ptr_regex)
54
54
  # uuid regex
55
55
  _uuid_regex = r"[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}"
56
56
  uuid_regex = re.compile(_uuid_regex, re.I)
57
+ # event uuid regex
58
+ _event_uuid_regex = r"[0-9A-Z_]+:[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}"
59
+ event_uuid_regex = re.compile(_event_uuid_regex, re.I)
57
60
 
58
61
  _open_port_regexes = (
59
62
  _dns_name_regex + r":[0-9]{1,5}",
@@ -844,8 +844,6 @@ class Preset:
844
844
 
845
845
  if module in self.exclude_modules:
846
846
  reason = "the module has been excluded"
847
- if raise_error:
848
- raise ValidationError(f'Unable to add {module_type} module "{module}" because {reason}')
849
847
  return False, reason, {}
850
848
 
851
849
  module_flags = preloaded.get("flags", [])
@@ -351,14 +351,6 @@ async def test_cli_args(monkeypatch, caplog, capsys, clean_default_config):
351
351
  result = await cli._main()
352
352
  assert result == True
353
353
 
354
- # enable and exclude the same module
355
- caplog.clear()
356
- assert not caplog.text
357
- monkeypatch.setattr("sys.argv", ["bbot", "-m", "ffuf_shortnames", "-em", "ffuf_shortnames"])
358
- result = await cli._main()
359
- assert result == None
360
- assert 'Unable to add scan module "ffuf_shortnames" because the module has been excluded' in caplog.text
361
-
362
354
  # require flags
363
355
  monkeypatch.setattr("sys.argv", ["bbot", "-f", "active", "-rf", "passive"])
364
356
  result = await cli._main()
@@ -4,7 +4,7 @@ import ipaddress
4
4
 
5
5
  from ..bbot_fixtures import *
6
6
  from bbot.scanner import Scanner
7
- from bbot.core.helpers.regexes import uuid_regex
7
+ from bbot.core.helpers.regexes import event_uuid_regex
8
8
 
9
9
 
10
10
  @pytest.mark.asyncio
@@ -443,11 +443,17 @@ async def test_events(events, helpers):
443
443
  parent_event2 = scan.make_event("evilcorp.com", parent=scan.root_event, context="test context")
444
444
 
445
445
  event1 = scan.make_event("evilcorp.com:80", parent=parent_event1, context="test context")
446
+ assert hasattr(event1, "_uuid")
446
447
  assert hasattr(event1, "uuid")
447
- assert isinstance(event1.uuid, uuid.UUID)
448
+ assert isinstance(event1._uuid, uuid.UUID)
449
+ assert isinstance(event1.uuid, str)
450
+ assert event1.uuid == f"{event1.type}:{event1._uuid}"
448
451
  event2 = scan.make_event("evilcorp.com:80", parent=parent_event2, context="test context")
452
+ assert hasattr(event2, "_uuid")
449
453
  assert hasattr(event2, "uuid")
450
- assert isinstance(event2.uuid, uuid.UUID)
454
+ assert isinstance(event2._uuid, uuid.UUID)
455
+ assert isinstance(event2.uuid, str)
456
+ assert event2.uuid == f"{event2.type}:{event2._uuid}"
451
457
  # ids should match because the event type + data is the same
452
458
  assert event1.id == event2.id
453
459
  # but uuids should be unique!
@@ -470,7 +476,7 @@ async def test_events(events, helpers):
470
476
  assert db_event.discovery_context == "test context"
471
477
  assert db_event.discovery_path == ["test context"]
472
478
  assert len(db_event.parent_chain) == 1
473
- assert all([uuid_regex.match(u) for u in db_event.parent_chain])
479
+ assert all([event_uuid_regex.match(u) for u in db_event.parent_chain])
474
480
  assert db_event.parent_chain[0] == str(db_event.uuid)
475
481
  assert db_event.parent.uuid == scan.root_event.uuid
476
482
  assert db_event.parent_uuid == scan.root_event.uuid
@@ -490,7 +496,7 @@ async def test_events(events, helpers):
490
496
  assert json_event["parent_chain"] == db_event.parent_chain
491
497
  assert json_event["parent_chain"][0] == str(db_event.uuid)
492
498
  reconstituted_event = event_from_json(json_event)
493
- assert isinstance(reconstituted_event.uuid, uuid.UUID)
499
+ assert isinstance(reconstituted_event._uuid, uuid.UUID)
494
500
  assert str(reconstituted_event.uuid) == json_event["uuid"]
495
501
  assert str(reconstituted_event.parent_uuid) == json_event["parent_uuid"]
496
502
  assert reconstituted_event.uuid == db_event.uuid
@@ -532,9 +532,22 @@ def test_preset_module_resolution(clean_default_config):
532
532
  assert set(preset.scan_modules) == {"wayback"}
533
533
 
534
534
  # modules + module exclusions
535
- with pytest.raises(ValidationError) as error:
536
- preset = Preset(exclude_modules=["sslcert"], modules=["sslcert", "wappalyzer", "wayback"]).bake()
537
- assert str(error.value) == 'Unable to add scan module "sslcert" because the module has been excluded'
535
+ preset = Preset(exclude_modules=["sslcert"], modules=["sslcert", "wappalyzer", "wayback"]).bake()
536
+ baked_preset = preset.bake()
537
+ assert baked_preset.modules == {
538
+ "wayback",
539
+ "cloudcheck",
540
+ "python",
541
+ "json",
542
+ "speculate",
543
+ "dnsresolve",
544
+ "aggregate",
545
+ "excavate",
546
+ "txt",
547
+ "httpx",
548
+ "csv",
549
+ "wappalyzer",
550
+ }
538
551
 
539
552
 
540
553
  @pytest.mark.asyncio
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bbot
3
- Version: 2.1.0.5021rc0
3
+ Version: 2.1.0.5028rc0
4
4
  Summary: OSINT automation for hackers.
5
5
  Home-page: https://github.com/blacklanternsecurity/bbot
6
6
  License: GPL-3.0
@@ -1,4 +1,4 @@
1
- bbot/__init__.py,sha256=YFdfhQ1yOTXBbFgjrv-VG1B22MQAijLczIvIUzcDfdc,130
1
+ bbot/__init__.py,sha256=uGNlVZLVuhzc5H4GbnGYmOTRrPsfNQvnztWI-cJlTjE,130
2
2
  bbot/cli.py,sha256=7S3a4eB-Dl8yodc5WC-927Z30CNlLl9EXimGvIVypJo,10434
3
3
  bbot/core/__init__.py,sha256=l255GJE_DvUnWvrRb0J5lG-iMztJ8zVvoweDOfegGtI,46
4
4
  bbot/core/config/__init__.py,sha256=zYNw2Me6tsEr8hOOkLb4BQ97GB7Kis2k--G81S8vofU,342
@@ -7,7 +7,7 @@ bbot/core/config/logger.py,sha256=C9txmKQtqSFnWU1AapwFS9cZgDBtNZQh4io_13d3AxA,95
7
7
  bbot/core/core.py,sha256=twd7-fiaaxzgcWTPwT1zbSWfAa_gHHfl7gAFvLYvFYg,6358
8
8
  bbot/core/engine.py,sha256=wGopKa2GNs61r16Pr_xtp6Si9AT6I-lE83iWhEgtxwA,29290
9
9
  bbot/core/event/__init__.py,sha256=8ut88ZUg0kbtWkOx2j3XzNr_3kTfgoM-3UdiWHFA_ag,56
10
- bbot/core/event/base.py,sha256=MYgwrrIck5bF9GlxQe5jNWnFM-o1zvfVgFDQlb1Jh14,59235
10
+ bbot/core/event/base.py,sha256=YHWevdDo5sHIIMKz_9TkWFYGTVtoD3fv957TpMO-6DQ,59498
11
11
  bbot/core/event/helpers.py,sha256=PUN4Trq5_wpKVuhmwUQWAr40apgMXhJ9Gz-VfZ0j3lA,1554
12
12
  bbot/core/flags.py,sha256=Ltvm8Bc4D65I55HuU5bzyjO1R3yMDNpVmreGU83ZBXE,1266
13
13
  bbot/core/helpers/__init__.py,sha256=0UNwcZjNsX41hbHdo3yZPuARkYWch-okI68DScexve4,86
@@ -34,7 +34,7 @@ bbot/core/helpers/ntlm.py,sha256=P2Xj4-GPos2iAzw4dfk0FJp6oGyycGhu2x6sLDVjYjs,257
34
34
  bbot/core/helpers/process.py,sha256=6D9_LYZrhQ0Jb7Rn58rWMafmAZn7rVVA2LqMKwpR_xg,2271
35
35
  bbot/core/helpers/ratelimiter.py,sha256=K8qFIyJPJtfdb9kSW6_lL6ahWqxR2uWyCBkDlg6uJgo,1990
36
36
  bbot/core/helpers/regex.py,sha256=XURaY6ijpOYYU9lzWMAKg12G1VFtGJjlJl07_eN1xxk,4170
37
- bbot/core/helpers/regexes.py,sha256=BlbfziycPctQIvVSpD9dIz6HGyeNqRFnktCbwDRA56A,5686
37
+ bbot/core/helpers/regexes.py,sha256=kz3y3hyEJvsnF7-4NrkrHTwwhkbRqEYi_wqA_rmZlgQ,5859
38
38
  bbot/core/helpers/url.py,sha256=1NDrvirODzzD6Mcssu-4WDNerMeMdekHCFzhRCS0m3g,5947
39
39
  bbot/core/helpers/validators.py,sha256=cglRDybXiFDh2vKwqjqv7Ruu1TWmSzPcbuQ3Rvky5JU,9696
40
40
  bbot/core/helpers/web/__init__.py,sha256=pIEkL3DhjaGTSmZ7D3yKKYwWpntoLRILekV2wWsbsws,27
@@ -212,7 +212,7 @@ bbot/scanner/preset/args.py,sha256=9Nmir2dHJWzN66m6N-mA0QEKiOgt8vWq23O8BG50eMA,1
212
212
  bbot/scanner/preset/conditions.py,sha256=hFL9cSIWGEsv2TfM5UGurf0c91cyaM8egb5IngBmIjA,1569
213
213
  bbot/scanner/preset/environ.py,sha256=-wbFk1YHpU8IJLKVw23Q3btQTICeX0iulURo7D673L0,4732
214
214
  bbot/scanner/preset/path.py,sha256=p9tZC7XcgZv2jXpbEJAg1lU2b4ZLX5COFnCxEUOXz2g,2234
215
- bbot/scanner/preset/preset.py,sha256=nhAPjV-9P-udAs_CK5oOVuCeQP_c-a6Nem0SaNF98Ss,40216
215
+ bbot/scanner/preset/preset.py,sha256=7q6PB9LalIzHyb4eiMDVKE6CapWBCKVw7350M0fSiwM,40083
216
216
  bbot/scanner/scanner.py,sha256=62DKCjgV1uLxNAwpxjvE5h1uzQCxG-nzBxp1PBCSVKc,53674
217
217
  bbot/scanner/stats.py,sha256=re93sArKXZSiD0Owgqk2J3Kdvfm3RL4Y9Qy_VOcaVk8,3623
218
218
  bbot/scanner/target.py,sha256=X25gpgRv5HmqQjGADiSe6b8744yOkRhAGAvKKYbXnSI,19886
@@ -228,20 +228,20 @@ bbot/test/test_output.ndjson,sha256=Jfor8nUJ3QTEwXxD6UULrFXM4zhP5wflWo_UNekM3V8,
228
228
  bbot/test/test_step_1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
229
229
  bbot/test/test_step_1/test__module__tests.py,sha256=RpD4yuVuQRgbbUkfuasxUlyoVxhTm6TeDyi87y_AaK0,1461
230
230
  bbot/test/test_step_1/test_bloom_filter.py,sha256=OpiZXsBX-I8QdTK0LqSYkGMDLA6vL_6t0wco9ypxxtQ,2114
231
- bbot/test/test_step_1/test_cli.py,sha256=vJ_tERHP3-7PukHO0cfL_gEIKjHhAdTe4dsVR2yDct0,25039
231
+ bbot/test/test_step_1/test_cli.py,sha256=m4LyIiiedR41f5SpnlkxgE-f42fF7qoGcuthpYxQ_m8,24688
232
232
  bbot/test/test_step_1/test_command.py,sha256=5IeGV6TKB0xtFEsfsU_0mNrOmEdIQiQ3FHkUmsBNoOI,6485
233
233
  bbot/test/test_step_1/test_config.py,sha256=Q38hygpke2GDcv8OguVZuiSOnfDJxEMrRy20dN5Qsn0,887
234
234
  bbot/test/test_step_1/test_depsinstaller.py,sha256=zr9f-wJDotD1ZvKXGEuDRWzFYMAYBI6209mI_PWPtTQ,703
235
235
  bbot/test/test_step_1/test_dns.py,sha256=YZtSbja-Z76KC9MWBieRExolVWHm0WqssL0WHUpUiC8,30932
236
236
  bbot/test/test_step_1/test_docs.py,sha256=YWVGNRfzcrvDmFekX0Cq9gutQplsqvhKTpZ0XK4tWvo,82
237
237
  bbot/test/test_step_1/test_engine.py,sha256=Bfid3-D9ziN93w4vym97tFEn_l2Iof08wjITTv_lAZw,4269
238
- bbot/test/test_step_1/test_events.py,sha256=0SV3BEagDCsoRw6yui_DvkQ0Vr3VVjwHyRhtmCDGdPQ,44847
238
+ bbot/test/test_step_1/test_events.py,sha256=D9W3zGxRWUIm0SYklsWRE3IeAPcMdWLAOIMWkI24Rpc,45130
239
239
  bbot/test/test_step_1/test_files.py,sha256=5Q_3jPpMXULxDHsanSDUaj8zF8bXzKdiJZHOmoYpLhQ,699
240
240
  bbot/test/test_step_1/test_helpers.py,sha256=oY2hWhgL-TCB67ve1bAyIwZO3wNRWpx4SjCHNUxHep8,38676
241
241
  bbot/test/test_step_1/test_manager_deduplication.py,sha256=hZQpDXzg6zvzxFolVOcJuY-ME8NXjZUsqS70BRNXp8A,15594
242
242
  bbot/test/test_step_1/test_manager_scope_accuracy.py,sha256=_4O5bW9PA2DIeguvqzb4CMm0i1joqqBBppw7qElL2a0,79767
243
243
  bbot/test/test_step_1/test_modules_basic.py,sha256=h4eCe-UhniwXZGhTEa6tH-RGeBF8tyjpSHAPsSu-ssw,20295
244
- bbot/test/test_step_1/test_presets.py,sha256=I9-T7QOtw5ZbzwJcOnTC-_n2toFlOkhV-E42utaSSf4,37155
244
+ bbot/test/test_step_1/test_presets.py,sha256=RXdRCGBgwLBJk_npn5Pyph3IhLTfy0ULkb4v_aZjABA,37299
245
245
  bbot/test/test_step_1/test_python_api.py,sha256=BYIVREUy7rd7tKfUsnIX-w_eqQDTEo5UplMZeGMb4bs,5317
246
246
  bbot/test/test_step_1/test_regexes.py,sha256=btlDgwM5crSkXFZNydLYn8lCDmyLW_8oX_6Aos5xAHk,14376
247
247
  bbot/test/test_step_1/test_scan.py,sha256=yLQAZ5tvIwTULBGgUmXVg8KwMmujal7kB2p-S2_ORzA,5461
@@ -393,8 +393,8 @@ bbot/wordlists/raft-small-extensions-lowercase_CLEANED.txt,sha256=ruUQwVfia1_m2u
393
393
  bbot/wordlists/top_open_ports_nmap.txt,sha256=LmdFYkfapSxn1pVuQC2LkOIY2hMLgG-Xts7DVtYzweM,42727
394
394
  bbot/wordlists/valid_url_schemes.txt,sha256=VciB-ww0y-O8Ii1wpTR6rJzGDiC2r-dhVsIJApS1ZYU,3309
395
395
  bbot/wordlists/wordninja_dns.txt.gz,sha256=DYHvvfW0TvzrVwyprqODAk4tGOxv5ezNmCPSdPuDUnQ,570241
396
- bbot-2.1.0.5021rc0.dist-info/LICENSE,sha256=GzeCzK17hhQQDNow0_r0L8OfLpeTKQjFQwBQU7ZUymg,32473
397
- bbot-2.1.0.5021rc0.dist-info/METADATA,sha256=nNxiHMIeFanIaheXaCaAImw6khiqaG55DiVtRbmFUno,16930
398
- bbot-2.1.0.5021rc0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
399
- bbot-2.1.0.5021rc0.dist-info/entry_points.txt,sha256=cWjvcU_lLrzzJgjcjF7yeGuRA_eDS8pQ-kmPUAyOBfo,38
400
- bbot-2.1.0.5021rc0.dist-info/RECORD,,
396
+ bbot-2.1.0.5028rc0.dist-info/LICENSE,sha256=GzeCzK17hhQQDNow0_r0L8OfLpeTKQjFQwBQU7ZUymg,32473
397
+ bbot-2.1.0.5028rc0.dist-info/METADATA,sha256=3Y7ocHDJJpm5Ebb7PhjejhASPdJO6tK52qlUo_6RUQI,16930
398
+ bbot-2.1.0.5028rc0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
399
+ bbot-2.1.0.5028rc0.dist-info/entry_points.txt,sha256=cWjvcU_lLrzzJgjcjF7yeGuRA_eDS8pQ-kmPUAyOBfo,38
400
+ bbot-2.1.0.5028rc0.dist-info/RECORD,,