bbot 2.1.1.5103rc0__py3-none-any.whl → 2.1.1.5119rc0__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 +29 -0
- bbot/test/conftest.py +7 -0
- {bbot-2.1.1.5103rc0.dist-info → bbot-2.1.1.5119rc0.dist-info}/METADATA +1 -1
- {bbot-2.1.1.5103rc0.dist-info → bbot-2.1.1.5119rc0.dist-info}/RECORD +8 -8
- {bbot-2.1.1.5103rc0.dist-info → bbot-2.1.1.5119rc0.dist-info}/LICENSE +0 -0
- {bbot-2.1.1.5103rc0.dist-info → bbot-2.1.1.5119rc0.dist-info}/WHEEL +0 -0
- {bbot-2.1.1.5103rc0.dist-info → bbot-2.1.1.5119rc0.dist-info}/entry_points.txt +0 -0
bbot/__init__.py
CHANGED
bbot/core/config/logger.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import sys
|
|
2
|
+
import atexit
|
|
2
3
|
import logging
|
|
3
4
|
from copy import copy
|
|
4
5
|
import multiprocessing
|
|
5
6
|
import logging.handlers
|
|
6
7
|
from pathlib import Path
|
|
8
|
+
from contextlib import suppress
|
|
7
9
|
|
|
8
10
|
from ..helpers.misc import mkdir, error_and_exit
|
|
9
11
|
from ...logger import colorize, loglevel_mapping
|
|
@@ -70,9 +72,36 @@ class BBOTLogger:
|
|
|
70
72
|
# Start the QueueListener
|
|
71
73
|
self.listener = logging.handlers.QueueListener(self.queue, *self.log_handlers.values())
|
|
72
74
|
self.listener.start()
|
|
75
|
+
atexit.register(self.cleanup_logging)
|
|
73
76
|
|
|
74
77
|
self.log_level = logging.INFO
|
|
75
78
|
|
|
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
|
+
|
|
76
105
|
def setup_queue_handler(self, logging_queue=None, log_level=logging.DEBUG):
|
|
77
106
|
if logging_queue is None:
|
|
78
107
|
logging_queue = self.queue
|
bbot/test/conftest.py
CHANGED
|
@@ -47,6 +47,13 @@ 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
|
+
|
|
50
57
|
@pytest.fixture
|
|
51
58
|
def bbot_httpserver():
|
|
52
59
|
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=Xk4nxrOFcbPFWVYWBV0Bezk8OuFzUGliZIeeRzHwKac,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=zkD08_KNiIa8LTZkI4wiAeA4g0zVCiA7d7P5MmocXsk,10467
|
|
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
|
|
@@ -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=js4NAX3iiIc2CCTpWKEclkcSH4egmjMNnqBiHzK_7BA,11242
|
|
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.
|
|
399
|
-
bbot-2.1.1.
|
|
400
|
-
bbot-2.1.1.
|
|
401
|
-
bbot-2.1.1.
|
|
402
|
-
bbot-2.1.1.
|
|
398
|
+
bbot-2.1.1.5119rc0.dist-info/LICENSE,sha256=GzeCzK17hhQQDNow0_r0L8OfLpeTKQjFQwBQU7ZUymg,32473
|
|
399
|
+
bbot-2.1.1.5119rc0.dist-info/METADATA,sha256=iAOijJFbm_YSDkHtRHakBGdgG5RzIp8o3T4UxJxEOSk,16930
|
|
400
|
+
bbot-2.1.1.5119rc0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
401
|
+
bbot-2.1.1.5119rc0.dist-info/entry_points.txt,sha256=cWjvcU_lLrzzJgjcjF7yeGuRA_eDS8pQ-kmPUAyOBfo,38
|
|
402
|
+
bbot-2.1.1.5119rc0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|