bbot 2.3.0.5532rc0__py3-none-any.whl → 2.3.0.5546rc0__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.5532rc"
2
+ __version__ = "v2.3.0.5546rc"
3
3
 
4
4
  from .scanner import Scanner, Preset
bbot/core/event/base.py CHANGED
@@ -1232,11 +1232,25 @@ class URL_UNVERIFIED(BaseEvent):
1232
1232
  return data
1233
1233
 
1234
1234
  def add_tag(self, tag):
1235
- host_same_as_parent = self.parent and self.host == self.parent.host
1236
- if tag == "spider-danger" and host_same_as_parent and "spider-danger" not in self.tags:
1237
- # increment the web spider distance
1238
- if self.type == "URL_UNVERIFIED":
1239
- self.web_spider_distance += 1
1235
+ self_url = getattr(self, "parsed_url", "")
1236
+ self_host = getattr(self, "host", "")
1237
+ # autoincrement web spider distance if the "spider-danger" tag is added
1238
+ if tag == "spider-danger" and "spider-danger" not in self.tags and self_url and self_host:
1239
+ parent_hosts_and_urls = set()
1240
+ for p in self.get_parents():
1241
+ # URL_UNVERIFIED events don't count because they haven't been visited yet
1242
+ if p.type == "URL_UNVERIFIED":
1243
+ continue
1244
+ url = getattr(p, "parsed_url", "")
1245
+ parent_hosts_and_urls.add((p.host, url))
1246
+ # if there's a URL anywhere in our parent chain that's different from ours but shares our host, we're in dAnGeR
1247
+ dangerous_parent = any(
1248
+ p_host == self.host and p_url != self_url for p_host, p_url in parent_hosts_and_urls
1249
+ )
1250
+ if dangerous_parent:
1251
+ # increment the web spider distance
1252
+ if self.type == "URL_UNVERIFIED":
1253
+ self.web_spider_distance += 1
1240
1254
  if self.is_spider_max:
1241
1255
  self.add_tag("spider-max")
1242
1256
  super().add_tag(tag)
@@ -808,6 +808,8 @@ async def test_event_discovery_context():
808
808
  async def test_event_web_spider_distance(bbot_scanner):
809
809
  # make sure web spider distance inheritance works as intended
810
810
  # and we don't have any runaway situations with SOCIAL events + URLs
811
+
812
+ # URL_UNVERIFIED events should not increment web spider distance
811
813
  scan = bbot_scanner(config={"web": {"spider_distance": 1}})
812
814
  url_event_1 = scan.make_event("http://www.evilcorp.com/test1", "URL_UNVERIFIED", parent=scan.root_event)
813
815
  assert url_event_1.web_spider_distance == 0
@@ -816,9 +818,24 @@ async def test_event_web_spider_distance(bbot_scanner):
816
818
  url_event_3 = scan.make_event(
817
819
  "http://www.evilcorp.com/test3", "URL_UNVERIFIED", parent=url_event_2, tags=["spider-danger"]
818
820
  )
821
+ assert url_event_3.web_spider_distance == 0
822
+ assert "spider-danger" in url_event_3.tags
823
+ assert "spider-max" not in url_event_3.tags
824
+
825
+ # URL events should increment web spider distance
826
+ scan = bbot_scanner(config={"web": {"spider_distance": 1}})
827
+ url_event_1 = scan.make_event("http://www.evilcorp.com/test1", "URL", parent=scan.root_event, tags="status-200")
828
+ assert url_event_1.web_spider_distance == 0
829
+ url_event_2 = scan.make_event("http://www.evilcorp.com/test2", "URL", parent=url_event_1, tags="status-200")
830
+ assert url_event_2.web_spider_distance == 0
831
+ url_event_3 = scan.make_event(
832
+ "http://www.evilcorp.com/test3", "URL_UNVERIFIED", parent=url_event_2, tags=["spider-danger"]
833
+ )
819
834
  assert url_event_3.web_spider_distance == 1
820
835
  assert "spider-danger" in url_event_3.tags
821
836
  assert "spider-max" not in url_event_3.tags
837
+
838
+ # SOCIAL events should inherit spider distance
822
839
  social_event = scan.make_event(
823
840
  {"platform": "github", "url": "http://www.evilcorp.com/test4"}, "SOCIAL", parent=url_event_3
824
841
  )
@@ -846,17 +863,17 @@ async def test_event_web_spider_distance(bbot_scanner):
846
863
  url_event_2 = scan.make_event(
847
864
  "http://www.evilcorp.com", "URL_UNVERIFIED", parent=scan.root_event, tags="spider-danger"
848
865
  )
849
- # spider distance shouldn't increment because it's not the same host
850
- assert url_event_2.web_spider_distance == 0
851
- assert "spider-danger" in url_event_2.tags
852
- assert "spider-max" not in url_event_2.tags
866
+ url_event_2b = scan.make_event("http://www.evilcorp.com", "URL", parent=url_event_2, tags="status-200")
867
+ assert url_event_2b.web_spider_distance == 0
868
+ assert "spider-danger" in url_event_2b.tags
869
+ assert "spider-max" not in url_event_2b.tags
853
870
  url_event_3 = scan.make_event(
854
- "http://www.evilcorp.com/3", "URL_UNVERIFIED", parent=url_event_2, tags="spider-danger"
871
+ "http://www.evilcorp.com/3", "URL_UNVERIFIED", parent=url_event_2b, tags="spider-danger"
855
872
  )
856
873
  assert url_event_3.web_spider_distance == 1
857
874
  assert "spider-danger" in url_event_3.tags
858
875
  assert "spider-max" not in url_event_3.tags
859
- url_event_4 = scan.make_event("http://evilcorp.com", "URL_UNVERIFIED", parent=url_event_3)
876
+ url_event_4 = scan.make_event("http://evilcorp.com", "URL", parent=url_event_3, tags="status-200")
860
877
  assert url_event_4.web_spider_distance == 0
861
878
  assert "spider-danger" not in url_event_4.tags
862
879
  assert "spider-max" not in url_event_4.tags
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bbot
3
- Version: 2.3.0.5532rc0
3
+ Version: 2.3.0.5546rc0
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=MaCgza8_F_R_eB6xdloaxyR1Icashwh_yUP9PF4gxIg,130
1
+ bbot/__init__.py,sha256=b08asVCW_E943cmWsJyYVhuzPNX-HUP24Y4fFDcuRLw,130
2
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
@@ -7,7 +7,7 @@ bbot/core/config/logger.py,sha256=FzQ7Myl0MVqBi7gpn9LOnbuL-UTXxSKpl11xuEGxS5I,10
7
7
  bbot/core/core.py,sha256=V0G3dKPN5xCbXOoFeBRkh-BZb6A3kSNA060De01LiTU,7065
8
8
  bbot/core/engine.py,sha256=uauGZgd7zAnJwNmVVPDicwHbUVCa8pV_pif49lgYeWk,29364
9
9
  bbot/core/event/__init__.py,sha256=8ut88ZUg0kbtWkOx2j3XzNr_3kTfgoM-3UdiWHFA_ag,56
10
- bbot/core/event/base.py,sha256=4QDGH4ZY1DsgJAxORnAomOa4sAMs-JPWVIjh0fgb9ZQ,63129
10
+ bbot/core/event/base.py,sha256=sQZNx3Rxb_Y4B4DYbtgEX5U440C9ZL8k0Z1gTV4xbKU,63910
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
@@ -78,7 +78,6 @@ bbot/modules/censys.py,sha256=J9ntCZGpS-HPf4EfoS6NpkOv7RqGk7AZmYIpLI8uYIE,3309
78
78
  bbot/modules/certspotter.py,sha256=AtL5BiOuDp4vu1-5fct4aQAGZM2qiODYsbgBsw0phoU,937
79
79
  bbot/modules/chaos.py,sha256=JyuwytwE3IRmNbw-uyJ0gCaTnywhhsHzTiZ3OJ15PAw,1573
80
80
  bbot/modules/code_repository.py,sha256=x70Z45VnNNMF8BPkHfGWZXsZXw_fStGB3y0-8jbP1Ns,2078
81
- bbot/modules/columbus.py,sha256=BhorMAB9IG22hXXhKsrNnNlPEIeCDyZvuwoBi-1iIiE,815
82
81
  bbot/modules/credshed.py,sha256=HAF5wgRGKIIpdMAe4mIAtkZRLmFYjMFyXtjjst6RJ20,4203
83
82
  bbot/modules/crt.py,sha256=6Zm90VKXwYYN6Sab0gwwhTARrtnQIqALJTVtFWMMTGk,1369
84
83
  bbot/modules/deadly/dastardly.py,sha256=O3QKU9XxreKaYCeJ0KthafBhC8uWR6_dxFh8VSuRLCk,5315
@@ -249,7 +248,7 @@ bbot/test/test_step_1/test_depsinstaller.py,sha256=zr9f-wJDotD1ZvKXGEuDRWzFYMAYB
249
248
  bbot/test/test_step_1/test_dns.py,sha256=SjefP-8GGyx9q-PWotCWu4esF0dRhWJRrS-J5MGNi6w,32153
250
249
  bbot/test/test_step_1/test_docs.py,sha256=YWVGNRfzcrvDmFekX0Cq9gutQplsqvhKTpZ0XK4tWvo,82
251
250
  bbot/test/test_step_1/test_engine.py,sha256=3HkCPtYhUxiZzfA-BRHpLsyaRj9wIXKbb49BCk9dILM,4267
252
- bbot/test/test_step_1/test_events.py,sha256=fFlppfiCesP1DX1tgG0U8NlOpTQe0hWeaE43A_MNXyo,52858
251
+ bbot/test/test_step_1/test_events.py,sha256=T500iG9s5lZxn16r06Dqhp6xHF8xDTFDGC8wKQMHdt8,53758
253
252
  bbot/test/test_step_1/test_files.py,sha256=5Q_3jPpMXULxDHsanSDUaj8zF8bXzKdiJZHOmoYpLhQ,699
254
253
  bbot/test/test_step_1/test_helpers.py,sha256=hZfnzjtegezYOqTuo5uAaXGI2GGsfuHhglbfaPPYV-U,39482
255
254
  bbot/test/test_step_1/test_manager_deduplication.py,sha256=hZQpDXzg6zvzxFolVOcJuY-ME8NXjZUsqS70BRNXp8A,15594
@@ -295,7 +294,6 @@ bbot/test/test_step_2/module_tests/test_module_certspotter.py,sha256=60jCOeK1yaU
295
294
  bbot/test/test_step_2/module_tests/test_module_chaos.py,sha256=9JRgtDEnnJgmEMCTB2bqRJRkBavLys-6ypHPxrM_hXk,956
296
295
  bbot/test/test_step_2/module_tests/test_module_cloudcheck.py,sha256=9DVhJfXaM42JXz577T0LdrrmArvhFXNdhICZP8aLLFU,4081
297
296
  bbot/test/test_step_2/module_tests/test_module_code_repository.py,sha256=i02Tgvr_F9_E4d6aEaXrfdk71NkoDvjzP4C98l2rNGg,2414
298
- bbot/test/test_step_2/module_tests/test_module_columbus.py,sha256=6CpIJCsykUfsn0CqxQWciIiNdM3Z73-HTnpBnVtS-L8,563
299
297
  bbot/test/test_step_2/module_tests/test_module_credshed.py,sha256=ipkCFL7YmZBLWWoGyGr98saL_yh3E99EnLtagHqdY1g,3360
300
298
  bbot/test/test_step_2/module_tests/test_module_crt.py,sha256=V15tE1jcXdXJEzEEdAJvSMRWhKBFtxBBUJ_eewvV3U4,717
301
299
  bbot/test/test_step_2/module_tests/test_module_csv.py,sha256=UJqMqdiPjx-UjJw10OoVMAj378wu5mWIq0v04TCljTM,579
@@ -414,8 +412,8 @@ bbot/wordlists/raft-small-extensions-lowercase_CLEANED.txt,sha256=ZSIVebs7ptMvHx
414
412
  bbot/wordlists/top_open_ports_nmap.txt,sha256=LmdFYkfapSxn1pVuQC2LkOIY2hMLgG-Xts7DVtYzweM,42727
415
413
  bbot/wordlists/valid_url_schemes.txt,sha256=0B_VAr9Dv7aYhwi6JSBDU-3M76vNtzN0qEC_RNLo7HE,3310
416
414
  bbot/wordlists/wordninja_dns.txt.gz,sha256=DYHvvfW0TvzrVwyprqODAk4tGOxv5ezNmCPSdPuDUnQ,570241
417
- bbot-2.3.0.5532rc0.dist-info/LICENSE,sha256=GzeCzK17hhQQDNow0_r0L8OfLpeTKQjFQwBQU7ZUymg,32473
418
- bbot-2.3.0.5532rc0.dist-info/METADATA,sha256=kmnYb6OiZWZbIas--ps5g4u1G6TmekxioY86bxnXkQo,18213
419
- bbot-2.3.0.5532rc0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
420
- bbot-2.3.0.5532rc0.dist-info/entry_points.txt,sha256=cWjvcU_lLrzzJgjcjF7yeGuRA_eDS8pQ-kmPUAyOBfo,38
421
- bbot-2.3.0.5532rc0.dist-info/RECORD,,
415
+ bbot-2.3.0.5546rc0.dist-info/LICENSE,sha256=GzeCzK17hhQQDNow0_r0L8OfLpeTKQjFQwBQU7ZUymg,32473
416
+ bbot-2.3.0.5546rc0.dist-info/METADATA,sha256=cnsUy8H__x4px_DYgtiImR_fhtjMwwx4kpOaFlCXoD8,18213
417
+ bbot-2.3.0.5546rc0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
418
+ bbot-2.3.0.5546rc0.dist-info/entry_points.txt,sha256=cWjvcU_lLrzzJgjcjF7yeGuRA_eDS8pQ-kmPUAyOBfo,38
419
+ bbot-2.3.0.5546rc0.dist-info/RECORD,,
bbot/modules/columbus.py DELETED
@@ -1,25 +0,0 @@
1
- from bbot.modules.templates.subdomain_enum import subdomain_enum
2
-
3
-
4
- class columbus(subdomain_enum):
5
- flags = ["subdomain-enum", "passive", "safe"]
6
- watched_events = ["DNS_NAME"]
7
- produced_events = ["DNS_NAME"]
8
- meta = {
9
- "description": "Query the Columbus Project API for subdomains",
10
- "created_date": "2023-06-01",
11
- "author": "@TheTechromancer",
12
- }
13
-
14
- base_url = "https://columbus.elmasy.com/api/lookup"
15
-
16
- async def request_url(self, query):
17
- url = f"{self.base_url}/{self.helpers.quote(query)}?days=365"
18
- return await self.api_request(url)
19
-
20
- async def parse_results(self, r, query):
21
- results = set()
22
- json = r.json()
23
- if json and isinstance(json, list):
24
- return {f"{s.lower()}.{query}" for s in json}
25
- return results
@@ -1,13 +0,0 @@
1
- from .base import ModuleTestBase
2
-
3
-
4
- class TestColumbus(ModuleTestBase):
5
- async def setup_after_prep(self, module_test):
6
- module_test.httpx_mock.add_response(
7
- url="https://columbus.elmasy.com/api/lookup/blacklanternsecurity.com?days=365",
8
- json=["asdf", "zzzz"],
9
- )
10
-
11
- def check(self, module_test, events):
12
- assert any(e.data == "asdf.blacklanternsecurity.com" for e in events), "Failed to detect subdomain"
13
- assert any(e.data == "zzzz.blacklanternsecurity.com" for e in events), "Failed to detect subdomain"