bbot 2.2.0.5279rc0__py3-none-any.whl → 2.2.0.5309rc0__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.

Files changed (62) hide show
  1. bbot/__init__.py +1 -1
  2. bbot/cli.py +1 -1
  3. bbot/core/engine.py +2 -2
  4. bbot/core/event/base.py +23 -2
  5. bbot/core/helpers/bloom.py +8 -1
  6. bbot/core/helpers/dns/helpers.py +2 -2
  7. bbot/core/helpers/helper.py +4 -3
  8. bbot/core/helpers/misc.py +11 -5
  9. bbot/core/helpers/regexes.py +2 -1
  10. bbot/core/helpers/web/web.py +1 -1
  11. bbot/modules/anubisdb.py +1 -1
  12. bbot/modules/baddns.py +1 -1
  13. bbot/modules/bevigil.py +2 -2
  14. bbot/modules/binaryedge.py +1 -1
  15. bbot/modules/bufferoverrun.py +2 -3
  16. bbot/modules/builtwith.py +2 -2
  17. bbot/modules/c99.py +4 -2
  18. bbot/modules/certspotter.py +4 -2
  19. bbot/modules/chaos.py +4 -2
  20. bbot/modules/columbus.py +1 -1
  21. bbot/modules/crt.py +4 -2
  22. bbot/modules/digitorus.py +1 -1
  23. bbot/modules/dnscaa.py +3 -3
  24. bbot/modules/fullhunt.py +1 -1
  25. bbot/modules/hackertarget.py +4 -2
  26. bbot/modules/internal/excavate.py +2 -3
  27. bbot/modules/internal/speculate.py +1 -1
  28. bbot/modules/leakix.py +4 -2
  29. bbot/modules/myssl.py +1 -1
  30. bbot/modules/otx.py +4 -2
  31. bbot/modules/passivetotal.py +4 -2
  32. bbot/modules/rapiddns.py +2 -7
  33. bbot/modules/securitytrails.py +4 -2
  34. bbot/modules/shodan_dns.py +1 -1
  35. bbot/modules/subdomaincenter.py +1 -1
  36. bbot/modules/templates/subdomain_enum.py +3 -3
  37. bbot/modules/trickest.py +1 -1
  38. bbot/modules/virustotal.py +2 -7
  39. bbot/modules/zoomeye.py +5 -3
  40. bbot/presets/spider.yml +4 -0
  41. bbot/scanner/manager.py +1 -2
  42. bbot/scanner/preset/args.py +3 -3
  43. bbot/scanner/preset/path.py +3 -1
  44. bbot/scanner/preset/preset.py +10 -4
  45. bbot/scanner/scanner.py +7 -2
  46. bbot/scanner/target.py +236 -434
  47. bbot/test/test_step_1/test_bloom_filter.py +2 -0
  48. bbot/test/test_step_1/test_cli.py +7 -0
  49. bbot/test/test_step_1/test_dns.py +2 -1
  50. bbot/test/test_step_1/test_events.py +16 -2
  51. bbot/test/test_step_1/test_helpers.py +17 -0
  52. bbot/test/test_step_1/test_presets.py +50 -36
  53. bbot/test/test_step_1/test_python_api.py +4 -0
  54. bbot/test/test_step_1/test_scan.py +8 -2
  55. bbot/test/test_step_1/test_target.py +227 -129
  56. bbot/test/test_step_2/module_tests/test_module_dastardly.py +1 -1
  57. bbot/test/test_step_2/module_tests/test_module_ffuf_shortnames.py +1 -1
  58. {bbot-2.2.0.5279rc0.dist-info → bbot-2.2.0.5309rc0.dist-info}/METADATA +4 -4
  59. {bbot-2.2.0.5279rc0.dist-info → bbot-2.2.0.5309rc0.dist-info}/RECORD +62 -62
  60. {bbot-2.2.0.5279rc0.dist-info → bbot-2.2.0.5309rc0.dist-info}/LICENSE +0 -0
  61. {bbot-2.2.0.5279rc0.dist-info → bbot-2.2.0.5309rc0.dist-info}/WHEEL +0 -0
  62. {bbot-2.2.0.5279rc0.dist-info → bbot-2.2.0.5309rc0.dist-info}/entry_points.txt +0 -0
bbot/scanner/manager.py CHANGED
@@ -38,7 +38,7 @@ class ScanIngress(BaseInterceptModule):
38
38
  - It also marks the Scan object as finished with initialization by setting `_finished_init` to True.
39
39
  """
40
40
  if events is None:
41
- events = self.scan.target.events
41
+ events = self.scan.target.seeds.events
42
42
  async with self.scan._acatch(self.init_events), self._task_counter.count(self.init_events):
43
43
  sorted_events = sorted(events, key=lambda e: len(e.data))
44
44
  for event in [self.scan.root_event] + sorted_events:
@@ -49,7 +49,6 @@ class ScanIngress(BaseInterceptModule):
49
49
  event.parent = self.scan.root_event
50
50
  if event.module is None:
51
51
  event.module = self.scan._make_dummy_module(name="TARGET", _type="TARGET")
52
- event.add_tag("target")
53
52
  if event != self.scan.root_event:
54
53
  event.discovery_context = f"Scan {self.scan.name} seeded with " + "{event.type}: {event.data}"
55
54
  self.verbose(f"Target: {event}")
@@ -223,7 +223,7 @@ class BBOTArgs:
223
223
  "--modules",
224
224
  nargs="+",
225
225
  default=[],
226
- help=f'Modules to enable. Choices: {",".join(self.preset.module_loader.scan_module_choices)}',
226
+ help=f'Modules to enable. Choices: {",".join(sorted(self.preset.module_loader.scan_module_choices))}',
227
227
  metavar="MODULE",
228
228
  )
229
229
  modules.add_argument("-l", "--list-modules", action="store_true", help=f"List available modules.")
@@ -238,7 +238,7 @@ class BBOTArgs:
238
238
  "--flags",
239
239
  nargs="+",
240
240
  default=[],
241
- help=f'Enable modules by flag. Choices: {",".join(self.preset.module_loader.flag_choices)}',
241
+ help=f'Enable modules by flag. Choices: {",".join(sorted(self.preset.module_loader.flag_choices))}',
242
242
  metavar="FLAG",
243
243
  )
244
244
  modules.add_argument("-lf", "--list-flags", action="store_true", help=f"List available flags.")
@@ -300,7 +300,7 @@ class BBOTArgs:
300
300
  "--output-modules",
301
301
  nargs="+",
302
302
  default=[],
303
- help=f'Output module(s). Choices: {",".join(self.preset.module_loader.output_module_choices)}',
303
+ help=f'Output module(s). Choices: {",".join(sorted(self.preset.module_loader.output_module_choices))}',
304
304
  metavar="MODULE",
305
305
  )
306
306
  output.add_argument("--json", "-j", action="store_true", help="Output scan data in JSON format")
@@ -33,7 +33,9 @@ class PresetPath:
33
33
  if "/" in str(filename):
34
34
  if filename_path.parent not in paths_to_search:
35
35
  paths_to_search.append(filename_path.parent)
36
- log.debug(f"Searching for preset in {paths_to_search}, file candidates: {file_candidates_str}")
36
+ log.debug(
37
+ f"Searching for preset in {[str(p) for p in paths_to_search]}, file candidates: {file_candidates_str}"
38
+ )
37
39
  for path in paths_to_search:
38
40
  for candidate in file_candidates:
39
41
  for file in path.rglob(candidate):
@@ -241,7 +241,7 @@ class Preset:
241
241
  # "presets" is alias to "include"
242
242
  if presets and include:
243
243
  raise ValueError(
244
- 'Cannot use both "presets" and "include" args at the same time (presets is only an alias to include). Please pick only one :)'
244
+ 'Cannot use both "presets" and "include" args at the same time (presets is an alias to include). Please pick one or the other :)'
245
245
  )
246
246
  if presets and not include:
247
247
  include = presets
@@ -270,6 +270,12 @@ class Preset:
270
270
  raise ValueError("Cannot access target before preset is baked (use ._seeds instead)")
271
271
  return self._target
272
272
 
273
+ @property
274
+ def seeds(self):
275
+ if self._seeds is None:
276
+ raise ValueError("Cannot access target before preset is baked (use ._seeds instead)")
277
+ return self.target.seeds
278
+
273
279
  @property
274
280
  def whitelist(self):
275
281
  if self._target is None:
@@ -755,11 +761,11 @@ class Preset:
755
761
 
756
762
  # scope
757
763
  if include_target:
758
- target = sorted(str(t.data) for t in self.target.seeds)
764
+ target = sorted(self.target.seeds.inputs)
759
765
  whitelist = []
760
766
  if self.target.whitelist is not None:
761
- whitelist = sorted(str(t.data) for t in self.target.whitelist)
762
- blacklist = sorted(str(t.data) for t in self.target.blacklist)
767
+ whitelist = sorted(self.target.whitelist.inputs)
768
+ blacklist = sorted(self.target.blacklist.inputs)
763
769
  if target:
764
770
  preset_dict["target"] = target
765
771
  if whitelist and whitelist != target:
bbot/scanner/scanner.py CHANGED
@@ -269,7 +269,7 @@ class Scanner:
269
269
  f.write(self.preset.to_yaml())
270
270
 
271
271
  # log scan overview
272
- start_msg = f"Scan with {len(self.preset.scan_modules):,} modules seeded with {len(self.target):,} targets"
272
+ start_msg = f"Scan seeded with {len(self.seeds):,} targets"
273
273
  details = []
274
274
  if self.whitelist != self.target:
275
275
  details.append(f"{len(self.whitelist):,} in whitelist")
@@ -362,7 +362,8 @@ class Scanner:
362
362
 
363
363
  # distribute seed events
364
364
  self.init_events_task = asyncio.create_task(
365
- self.ingress_module.init_events(self.target.events), name=f"{self.name}.ingress_module.init_events()"
365
+ self.ingress_module.init_events(self.target.seeds.events),
366
+ name=f"{self.name}.ingress_module.init_events()",
366
367
  )
367
368
 
368
369
  # main scan loop
@@ -896,6 +897,10 @@ class Scanner:
896
897
  def target(self):
897
898
  return self.preset.target
898
899
 
900
+ @property
901
+ def seeds(self):
902
+ return self.preset.seeds
903
+
899
904
  @property
900
905
  def whitelist(self):
901
906
  return self.preset.whitelist