bbot 2.1.1__py3-none-any.whl → 2.1.1.5103rc0__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.1.1"
2
+ __version__ = "v2.1.1.5103rc"
3
3
 
4
4
  from .scanner import Scanner, Preset
@@ -1,11 +1,9 @@
1
1
  import sys
2
- import atexit
3
2
  import logging
4
3
  from copy import copy
5
4
  import multiprocessing
6
5
  import logging.handlers
7
6
  from pathlib import Path
8
- from contextlib import suppress
9
7
 
10
8
  from ..helpers.misc import mkdir, error_and_exit
11
9
  from ...logger import colorize, loglevel_mapping
@@ -72,36 +70,9 @@ class BBOTLogger:
72
70
  # Start the QueueListener
73
71
  self.listener = logging.handlers.QueueListener(self.queue, *self.log_handlers.values())
74
72
  self.listener.start()
75
- atexit.register(self.cleanup_logging)
76
73
 
77
74
  self.log_level = logging.INFO
78
75
 
79
- def cleanup_logging(self):
80
- # Close the queue handler
81
- with suppress(Exception):
82
- self.queue_handler.close()
83
-
84
- # Clean root logger
85
- root_logger = logging.getLogger()
86
- for handler in list(root_logger.handlers):
87
- with suppress(Exception):
88
- root_logger.removeHandler(handler)
89
- with suppress(Exception):
90
- handler.close()
91
-
92
- # Clean all other loggers
93
- for logger in logging.Logger.manager.loggerDict.values():
94
- if hasattr(logger, "handlers"): # Logger, not PlaceHolder
95
- for handler in list(logger.handlers):
96
- with suppress(Exception):
97
- logger.removeHandler(handler)
98
- with suppress(Exception):
99
- handler.close()
100
-
101
- # Stop queue listener
102
- with suppress(Exception):
103
- self.listener.stop()
104
-
105
76
  def setup_queue_handler(self, logging_queue=None, log_level=logging.DEBUG):
106
77
  if logging_queue is None:
107
78
  logging_queue = self.queue
bbot/modules/gowitness.py CHANGED
@@ -1,5 +1,5 @@
1
1
  import asyncio
2
- import aiosqlite
2
+ import sqlite3
3
3
  import multiprocessing
4
4
  from pathlib import Path
5
5
  from contextlib import suppress
@@ -34,7 +34,6 @@ class gowitness(BaseModule):
34
34
  "idle_timeout": "Skip the current gowitness batch if it stalls for longer than this many seconds",
35
35
  }
36
36
  deps_common = ["chromium"]
37
- deps_pip = ["aiosqlite"]
38
37
  deps_ansible = [
39
38
  {
40
39
  "name": "Download gowitness",
@@ -137,8 +136,7 @@ class gowitness(BaseModule):
137
136
  return
138
137
 
139
138
  # emit web screenshots
140
- new_screenshots = await self.get_new_screenshots()
141
- for filename, screenshot in new_screenshots.items():
139
+ for filename, screenshot in self.new_screenshots.items():
142
140
  url = screenshot["url"]
143
141
  final_url = screenshot["final_url"]
144
142
  filename = self.screenshot_path / screenshot["filename"]
@@ -152,8 +150,7 @@ class gowitness(BaseModule):
152
150
  )
153
151
 
154
152
  # emit URLs
155
- new_network_logs = await self.get_new_network_logs()
156
- for url, row in new_network_logs.items():
153
+ for url, row in self.new_network_logs.items():
157
154
  ip = row["ip"]
158
155
  status_code = row["status_code"]
159
156
  tags = [f"status-{status_code}", f"ip-{ip}", "spider-danger"]
@@ -171,8 +168,7 @@ class gowitness(BaseModule):
171
168
  )
172
169
 
173
170
  # emit technologies
174
- new_technologies = await self.get_new_technologies()
175
- for _, row in new_technologies.items():
171
+ for _, row in self.new_technologies.items():
176
172
  parent_id = row["url_id"]
177
173
  parent_url = self.screenshots_taken[parent_id]
178
174
  parent_event = event_dict[parent_url]
@@ -211,53 +207,59 @@ class gowitness(BaseModule):
211
207
  command += ["--timeout", str(self.timeout)]
212
208
  return command
213
209
 
214
- async def get_new_screenshots(self):
210
+ @property
211
+ def new_screenshots(self):
215
212
  screenshots = {}
216
213
  if self.db_path.is_file():
217
- async with aiosqlite.connect(str(self.db_path)) as con:
218
- con.row_factory = aiosqlite.Row
214
+ with sqlite3.connect(str(self.db_path)) as con:
215
+ con.row_factory = sqlite3.Row
219
216
  con.text_factory = self.helpers.smart_decode
220
- async with con.execute("SELECT * FROM urls") as cur:
221
- async for row in cur:
222
- row = dict(row)
223
- _id = row["id"]
224
- if _id not in self.screenshots_taken:
225
- self.screenshots_taken[_id] = row["url"]
226
- screenshots[_id] = row
217
+ cur = con.cursor()
218
+ res = self.cur_execute(cur, "SELECT * FROM urls")
219
+ for row in res:
220
+ row = dict(row)
221
+ _id = row["id"]
222
+ if _id not in self.screenshots_taken:
223
+ self.screenshots_taken[_id] = row["url"]
224
+ screenshots[_id] = row
227
225
  return screenshots
228
226
 
229
- async def get_new_network_logs(self):
227
+ @property
228
+ def new_network_logs(self):
230
229
  network_logs = dict()
231
230
  if self.db_path.is_file():
232
- async with aiosqlite.connect(str(self.db_path)) as con:
233
- con.row_factory = aiosqlite.Row
234
- async with con.execute("SELECT * FROM network_logs") as cur:
235
- async for row in cur:
236
- row = dict(row)
237
- url = row["final_url"]
238
- if url not in self.connections_logged:
239
- self.connections_logged.add(url)
240
- network_logs[url] = row
231
+ with sqlite3.connect(str(self.db_path)) as con:
232
+ con.row_factory = sqlite3.Row
233
+ cur = con.cursor()
234
+ res = self.cur_execute(cur, "SELECT * FROM network_logs")
235
+ for row in res:
236
+ row = dict(row)
237
+ url = row["final_url"]
238
+ if url not in self.connections_logged:
239
+ self.connections_logged.add(url)
240
+ network_logs[url] = row
241
241
  return network_logs
242
242
 
243
- async def get_new_technologies(self):
243
+ @property
244
+ def new_technologies(self):
244
245
  technologies = dict()
245
246
  if self.db_path.is_file():
246
- async with aiosqlite.connect(str(self.db_path)) as con:
247
- con.row_factory = aiosqlite.Row
248
- async with con.execute("SELECT * FROM technologies") as cur:
249
- async for row in cur:
250
- _id = row["id"]
251
- if _id not in self.technologies_found:
252
- self.technologies_found.add(_id)
253
- row = dict(row)
254
- technologies[_id] = row
247
+ with sqlite3.connect(str(self.db_path)) as con:
248
+ con.row_factory = sqlite3.Row
249
+ cur = con.cursor()
250
+ res = self.cur_execute(cur, "SELECT * FROM technologies")
251
+ for row in res:
252
+ _id = row["id"]
253
+ if _id not in self.technologies_found:
254
+ self.technologies_found.add(_id)
255
+ row = dict(row)
256
+ technologies[_id] = row
255
257
  return technologies
256
258
 
257
- async def cur_execute(self, cur, query):
259
+ def cur_execute(self, cur, query):
258
260
  try:
259
- return await cur.execute(query)
260
- except aiosqlite.OperationalError as e:
261
+ return cur.execute(query)
262
+ except sqlite3.OperationalError as e:
261
263
  self.warning(f"Error executing query: {query}: {e}")
262
264
  return []
263
265
 
@@ -13,7 +13,7 @@ class trufflehog(BaseModule):
13
13
  }
14
14
 
15
15
  options = {
16
- "version": "3.83.1",
16
+ "version": "3.82.11",
17
17
  "config": "",
18
18
  "only_verified": True,
19
19
  "concurrency": 8,
bbot/test/conftest.py CHANGED
@@ -47,13 +47,6 @@ def assert_all_responses_were_requested() -> bool:
47
47
  return False
48
48
 
49
49
 
50
- @pytest.fixture(autouse=True)
51
- def silence_live_logging():
52
- for handler in logging.getLogger().handlers:
53
- if type(handler).__name__ == "_LiveLoggingStreamHandler":
54
- handler.setLevel(logging.CRITICAL)
55
-
56
-
57
50
  @pytest.fixture
58
51
  def bbot_httpserver():
59
52
  server = HTTPServer(host="127.0.0.1", port=8888, threaded=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bbot
3
- Version: 2.1.1
3
+ Version: 2.1.1.5103rc0
4
4
  Summary: OSINT automation for hackers.
5
5
  Home-page: https://github.com/blacklanternsecurity/bbot
6
6
  License: GPL-3.0
@@ -1,9 +1,9 @@
1
- bbot/__init__.py,sha256=JBzSHYgx82_Tcg4e3kFjN1igI0ZnazzrEIl85QZ_J-c,123
1
+ bbot/__init__.py,sha256=doq0jTZtPEY8jcNxyhisTyvCn8x9bxFjT2kkgtCA1ck,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
5
5
  bbot/core/config/files.py,sha256=pNrcw61UKKZeMt0rp9Ac5mUK7LdIRmcpojMxI-LwjeA,1413
6
- bbot/core/config/logger.py,sha256=zkD08_KNiIa8LTZkI4wiAeA4g0zVCiA7d7P5MmocXsk,10467
6
+ bbot/core/config/logger.py,sha256=PEiEzZ6CbxtAzWe5MRWKAg2O3YtgM3Y5z7Oum8YPvlA,9441
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
@@ -105,7 +105,7 @@ bbot/modules/github_org.py,sha256=O1VBn65sYJaPWBDjssyQSnlEh6XQgLEF7gKDzWj64qc,91
105
105
  bbot/modules/github_workflows.py,sha256=GvEVEa2vp5FnpKIthyMIkMmV84Sgh9whxpCcdFY1PB0,9555
106
106
  bbot/modules/gitlab.py,sha256=9oWWpBijeHCjuFBfWW4HvNqt7bvJvrBgBjaaz_UPPnE,5964
107
107
  bbot/modules/google_playstore.py,sha256=N4QjzQag_bgDXfX17rytBiiWA-SQtYI2N0J_ZNEOdv0,3701
108
- bbot/modules/gowitness.py,sha256=DG23F2O4zVhY4lMSEk6uRRbQ-Jczpa6Yz_vXBICY9tA,11294
108
+ bbot/modules/gowitness.py,sha256=VYifohEuiIWTejzxM6kxpB8vcWTaiYgwdEeoiLWjZ9g,11071
109
109
  bbot/modules/hackertarget.py,sha256=brp0khcRaSyzwjs6z89WbgULZEE8RmjLM_SxBrj3fDo,969
110
110
  bbot/modules/host_header.py,sha256=JQGqdsuvaCwFaA5_9790T1P2DKJoDUQSPjyHgh6u2tU,7694
111
111
  bbot/modules/httpx.py,sha256=wmgyRyCNg9vw_qO0pVo7I7QzGybDgt9pEdfU3QPgBMA,7588
@@ -179,7 +179,7 @@ bbot/modules/templates/shodan.py,sha256=BfI0mNPbqkykGmjMtARhmCGKmk1uq7yTlZoPgzzJ
179
179
  bbot/modules/templates/subdomain_enum.py,sha256=lT5MZF66OuzsyFFrj20wKlsZflzL9MOkPjDIbN3o65o,8375
180
180
  bbot/modules/templates/webhook.py,sha256=MYhKWrNYrsfM0a4PR6yVotudLyyCwgmy2eI-l9LvpBs,3706
181
181
  bbot/modules/trickest.py,sha256=HfAzjnawxXd9ypi3gumDHqImE5-C7uwNugo8d_b9HT0,1544
182
- bbot/modules/trufflehog.py,sha256=aVA1g3WvS1QifXqGMmdtjEeRA83z9C-y7s5PGnAS9Vs,8554
182
+ bbot/modules/trufflehog.py,sha256=KMFYbjKEyoNaJDoID0SoDvbCRPaDwalMD6H2lQaI1QE,8555
183
183
  bbot/modules/unstructured.py,sha256=si3_Y__A36QOBdkIUocVXCHrmUqM0E-JSnoOeRpELYE,5311
184
184
  bbot/modules/url_manipulation.py,sha256=BI-OhlzNzP5xvwzHphL4qdehc4NiEYnL2BNK-JoEm90,4322
185
185
  bbot/modules/urlscan.py,sha256=ajhiX2sj-zZDlKU1q5rE8JTzxioj1mDLqZ9PRSQCpAw,3741
@@ -220,7 +220,7 @@ bbot/scanner/target.py,sha256=X25gpgRv5HmqQjGADiSe6b8744yOkRhAGAvKKYbXnSI,19886
220
220
  bbot/scripts/docs.py,sha256=kg2CzovmUVGJx9hBZjAjUdE1hXeIwC7Ry3CyrnE8GL8,10782
221
221
  bbot/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
222
222
  bbot/test/bbot_fixtures.py,sha256=J1_MfpCMXftfGHZc-dgn42ODpTmSJidoBibOltfthac,9862
223
- bbot/test/conftest.py,sha256=js4NAX3iiIc2CCTpWKEclkcSH4egmjMNnqBiHzK_7BA,11242
223
+ bbot/test/conftest.py,sha256=bCLJNVqCJzdZUf1hJ8oPTi5Pu6uwWBo9KCyGlf04h8M,11020
224
224
  bbot/test/coverage.cfg,sha256=ko9RacAYsJxWJCL8aEuNtkAOtP9lexYiDbeFWe8Tp8Y,31
225
225
  bbot/test/owasp_mastg.apk,sha256=Hai_V9JmEJ-aB8Ab9xEaGXXOAfGQudkUvNOuPb75byE,66651
226
226
  bbot/test/run_tests.sh,sha256=0oprBl970NAqXS4YQa8nRUtKljPeS_WNSvd-QmO5FNY,945
@@ -395,8 +395,8 @@ bbot/wordlists/raft-small-extensions-lowercase_CLEANED.txt,sha256=ruUQwVfia1_m2u
395
395
  bbot/wordlists/top_open_ports_nmap.txt,sha256=LmdFYkfapSxn1pVuQC2LkOIY2hMLgG-Xts7DVtYzweM,42727
396
396
  bbot/wordlists/valid_url_schemes.txt,sha256=VciB-ww0y-O8Ii1wpTR6rJzGDiC2r-dhVsIJApS1ZYU,3309
397
397
  bbot/wordlists/wordninja_dns.txt.gz,sha256=DYHvvfW0TvzrVwyprqODAk4tGOxv5ezNmCPSdPuDUnQ,570241
398
- bbot-2.1.1.dist-info/LICENSE,sha256=GzeCzK17hhQQDNow0_r0L8OfLpeTKQjFQwBQU7ZUymg,32473
399
- bbot-2.1.1.dist-info/METADATA,sha256=GDNMYGz1sXOdrYJu5GcLgZR8-oPWHy6UYIK-24lcSrc,16922
400
- bbot-2.1.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
401
- bbot-2.1.1.dist-info/entry_points.txt,sha256=cWjvcU_lLrzzJgjcjF7yeGuRA_eDS8pQ-kmPUAyOBfo,38
402
- bbot-2.1.1.dist-info/RECORD,,
398
+ bbot-2.1.1.5103rc0.dist-info/LICENSE,sha256=GzeCzK17hhQQDNow0_r0L8OfLpeTKQjFQwBQU7ZUymg,32473
399
+ bbot-2.1.1.5103rc0.dist-info/METADATA,sha256=PZhrVW9xHNifnEPEAkdnyhGfKpBjeHsPe2ueZkEbacQ,16930
400
+ bbot-2.1.1.5103rc0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
401
+ bbot-2.1.1.5103rc0.dist-info/entry_points.txt,sha256=cWjvcU_lLrzzJgjcjF7yeGuRA_eDS8pQ-kmPUAyOBfo,38
402
+ bbot-2.1.1.5103rc0.dist-info/RECORD,,