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 +1 -1
- bbot/core/config/logger.py +0 -29
- bbot/modules/gowitness.py +43 -41
- bbot/modules/trufflehog.py +1 -1
- bbot/test/conftest.py +0 -7
- {bbot-2.1.1.dist-info → bbot-2.1.1.5103rc0.dist-info}/METADATA +1 -1
- {bbot-2.1.1.dist-info → bbot-2.1.1.5103rc0.dist-info}/RECORD +10 -10
- {bbot-2.1.1.dist-info → bbot-2.1.1.5103rc0.dist-info}/LICENSE +0 -0
- {bbot-2.1.1.dist-info → bbot-2.1.1.5103rc0.dist-info}/WHEEL +0 -0
- {bbot-2.1.1.dist-info → bbot-2.1.1.5103rc0.dist-info}/entry_points.txt +0 -0
bbot/__init__.py
CHANGED
bbot/core/config/logger.py
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
210
|
+
@property
|
|
211
|
+
def new_screenshots(self):
|
|
215
212
|
screenshots = {}
|
|
216
213
|
if self.db_path.is_file():
|
|
217
|
-
|
|
218
|
-
con.row_factory =
|
|
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
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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
|
-
|
|
227
|
+
@property
|
|
228
|
+
def new_network_logs(self):
|
|
230
229
|
network_logs = dict()
|
|
231
230
|
if self.db_path.is_file():
|
|
232
|
-
|
|
233
|
-
con.row_factory =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
-
|
|
243
|
+
@property
|
|
244
|
+
def new_technologies(self):
|
|
244
245
|
technologies = dict()
|
|
245
246
|
if self.db_path.is_file():
|
|
246
|
-
|
|
247
|
-
con.row_factory =
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
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
|
-
|
|
259
|
+
def cur_execute(self, cur, query):
|
|
258
260
|
try:
|
|
259
|
-
return
|
|
260
|
-
except
|
|
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
|
|
bbot/modules/trufflehog.py
CHANGED
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,9 +1,9 @@
|
|
|
1
|
-
bbot/__init__.py,sha256=
|
|
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=
|
|
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=
|
|
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=
|
|
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=
|
|
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=
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|