Skip to content

Commit 5cb7f10

Browse files
author
github-actions
committed
fix conflict
2 parents 34f015e + 15464b6 commit 5cb7f10

File tree

143 files changed

+1085
-1175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+1085
-1175
lines changed

.flake8

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![bbot_banner](https://github.com/user-attachments/assets/f02804ce-9478-4f1e-ac4d-9cf5620a3214)](https://github.com/blacklanternsecurity/bbot)
22

3-
[![Python Version](https://img.shields.io/badge/python-3.9+-FF8400)](https://www.python.org) [![License](https://img.shields.io/badge/license-GPLv3-FF8400.svg)](https://github.com/blacklanternsecurity/bbot/blob/dev/LICENSE) [![DEF CON Recon Village 2024](https://img.shields.io/badge/DEF%20CON%20Demo%20Labs-2023-FF8400.svg)](https://www.reconvillage.org/talks) [![PyPi Downloads](https://static.pepy.tech/personalized-badge/bbot?right_color=orange&left_color=grey)](https://pepy.tech/project/bbot) [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Tests](https://github.com/blacklanternsecurity/bbot/actions/workflows/tests.yml/badge.svg?branch=stable)](https://github.com/blacklanternsecurity/bbot/actions?query=workflow%3A"tests") [![Codecov](https://codecov.io/gh/blacklanternsecurity/bbot/branch/dev/graph/badge.svg?token=IR5AZBDM5K)](https://codecov.io/gh/blacklanternsecurity/bbot) [![Discord](https://img.shields.io/discord/859164869970362439)](https://discord.com/invite/PZqkgxu5SA)
3+
[![Python Version](https://img.shields.io/badge/python-3.9+-FF8400)](https://www.python.org) [![License](https://img.shields.io/badge/license-GPLv3-FF8400.svg)](https://github.com/blacklanternsecurity/bbot/blob/dev/LICENSE) [![DEF CON Recon Village 2024](https://img.shields.io/badge/DEF%20CON%20Demo%20Labs-2023-FF8400.svg)](https://www.reconvillage.org/talks) [![PyPi Downloads](https://static.pepy.tech/personalized-badge/bbot?right_color=orange&left_color=grey)](https://pepy.tech/project/bbot) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Tests](https://github.com/blacklanternsecurity/bbot/actions/workflows/tests.yml/badge.svg?branch=stable)](https://github.com/blacklanternsecurity/bbot/actions?query=workflow%3A"tests") [![Codecov](https://codecov.io/gh/blacklanternsecurity/bbot/branch/dev/graph/badge.svg?token=IR5AZBDM5K)](https://codecov.io/gh/blacklanternsecurity/bbot) [![Discord](https://img.shields.io/discord/859164869970362439)](https://discord.com/invite/PZqkgxu5SA)
44

55
### **BEE·bot** is a multipurpose scanner inspired by [Spiderfoot](https://github.com/smicallef/spiderfoot), built to automate your **Recon**, **Bug Bounties**, and **ASM**!
66

bbot/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ async def _main():
130130
]
131131
if deadly_modules and not options.allow_deadly:
132132
log.hugewarning(f"You enabled the following deadly modules: {','.join(deadly_modules)}")
133-
log.hugewarning(f"Deadly modules are highly intrusive")
134-
log.hugewarning(f"Please specify --allow-deadly to continue")
133+
log.hugewarning("Deadly modules are highly intrusive")
134+
log.hugewarning("Please specify --allow-deadly to continue")
135135
return False
136136

137137
# --current-preset

bbot/core/config/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(self, core):
6868
self.listener = None
6969

7070
# if we haven't set up logging yet, do it now
71-
if not "_BBOT_LOGGING_SETUP" in os.environ:
71+
if "_BBOT_LOGGING_SETUP" not in os.environ:
7272
os.environ["_BBOT_LOGGING_SETUP"] = "1"
7373
self.queue = multiprocessing.Queue()
7474
self.setup_queue_handler()

bbot/core/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def default_config(self):
106106
if DEFAULT_CONFIG is None:
107107
self.default_config = self.files_config.get_default_config()
108108
# ensure bbot home dir
109-
if not "home" in self.default_config:
109+
if "home" not in self.default_config:
110110
self.default_config["home"] = "~/.bbot"
111111
return DEFAULT_CONFIG
112112

bbot/core/event/base.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ def __init__(
177177
self._scope_distance = None
178178
self._module_priority = None
179179
self._resolved_hosts = set()
180-
self.dns_children = dict()
181-
self.raw_dns_records = dict()
180+
self.dns_children = {}
181+
self.raw_dns_records = {}
182182
self._discovery_context = ""
183183
self._discovery_context_regex = re.compile(r"\{(?:event|module)[^}]*\}")
184184
self.web_spider_distance = 0
@@ -205,7 +205,7 @@ def __init__(
205205
# self.scan holds the instantiated scan object (for helpers, etc.)
206206
self.scan = scan
207207
if (not self.scan) and (not self._dummy):
208-
raise ValidationError(f"Must specify scan")
208+
raise ValidationError("Must specify scan")
209209
# self.scans holds a list of scan IDs from scans that encountered this event
210210
self.scans = []
211211
if scans is not None:
@@ -224,7 +224,7 @@ def __init__(
224224

225225
self.parent = parent
226226
if (not self.parent) and (not self._dummy):
227-
raise ValidationError(f"Must specify event parent")
227+
raise ValidationError("Must specify event parent")
228228

229229
if tags is not None:
230230
for tag in tags:
@@ -303,9 +303,9 @@ def internal(self, value):
303303
The purpose of internal events is to enable speculative/explorative discovery without cluttering
304304
the console with irrelevant or uninteresting events.
305305
"""
306-
if not value in (True, False):
306+
if value not in (True, False):
307307
raise ValueError(f'"internal" must be boolean, not {type(value)}')
308-
if value == True:
308+
if value is True:
309309
self.add_tag("internal")
310310
else:
311311
self.remove_tag("internal")
@@ -770,7 +770,7 @@ def json(self, mode="json"):
770770
Returns:
771771
dict: JSON-serializable dictionary representation of the event object.
772772
"""
773-
j = dict()
773+
j = {}
774774
# type, ID, scope description
775775
for i in ("type", "id", "uuid", "scope_description", "netloc"):
776776
v = getattr(self, i, "")
@@ -1015,12 +1015,12 @@ def __init__(self, *args, **kwargs):
10151015
if not self.host:
10161016
for parent in self.get_parents(include_self=True):
10171017
# inherit closest URL
1018-
if not "url" in self.data:
1018+
if "url" not in self.data:
10191019
parent_url = getattr(parent, "parsed_url", None)
10201020
if parent_url is not None:
10211021
self.data["url"] = parent_url.geturl()
10221022
# inherit closest path
1023-
if not "path" in self.data and isinstance(parent.data, dict) and not parent.type == "HTTP_RESPONSE":
1023+
if "path" not in self.data and isinstance(parent.data, dict) and not parent.type == "HTTP_RESPONSE":
10241024
parent_path = parent.data.get("path", None)
10251025
if parent_path is not None:
10261026
self.data["path"] = parent_path
@@ -1229,7 +1229,7 @@ def sanitize_data(self, data):
12291229

12301230
def add_tag(self, tag):
12311231
host_same_as_parent = self.parent and self.host == self.parent.host
1232-
if tag == "spider-danger" and host_same_as_parent and not "spider-danger" in self.tags:
1232+
if tag == "spider-danger" and host_same_as_parent and "spider-danger" not in self.tags:
12331233
# increment the web spider distance
12341234
if self.type == "URL_UNVERIFIED":
12351235
self.web_spider_distance += 1
@@ -1251,7 +1251,7 @@ def with_port(self):
12511251

12521252
def _words(self):
12531253
first_elem = self.parsed_url.path.lstrip("/").split("/")[0]
1254-
if not "." in first_elem:
1254+
if "." not in first_elem:
12551255
return extract_words(first_elem)
12561256
return set()
12571257

@@ -1279,7 +1279,7 @@ def __init__(self, *args, **kwargs):
12791279
@property
12801280
def resolved_hosts(self):
12811281
# TODO: remove this when we rip out httpx
1282-
return set(".".join(i.split("-")[1:]) for i in self.tags if i.startswith("ip-"))
1282+
return {".".join(i.split("-")[1:]) for i in self.tags if i.startswith("ip-")}
12831283

12841284
@property
12851285
def pretty_string(self):
@@ -1667,7 +1667,7 @@ def make_event(
16671667
event.parent = parent
16681668
if context is not None:
16691669
event.discovery_context = context
1670-
if internal == True:
1670+
if internal is True:
16711671
event.internal = True
16721672
if tags:
16731673
event.tags = tags.union(event.tags)

bbot/core/helpers/command.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ def _prepare_command_kwargs(self, command, kwargs):
269269
(['sudo', '-E', '-A', 'LD_LIBRARY_PATH=...', 'PATH=...', 'ls', '-l'], {'limit': 104857600, 'stdout': -1, 'stderr': -1, 'env': environ(...)})
270270
"""
271271
# limit = 100MB (this is needed for cases like httpx that are sending large JSON blobs over stdout)
272-
if not "limit" in kwargs:
272+
if "limit" not in kwargs:
273273
kwargs["limit"] = 1024 * 1024 * 100
274-
if not "stdout" in kwargs:
274+
if "stdout" not in kwargs:
275275
kwargs["stdout"] = asyncio.subprocess.PIPE
276-
if not "stderr" in kwargs:
276+
if "stderr" not in kwargs:
277277
kwargs["stderr"] = asyncio.subprocess.PIPE
278278
sudo = kwargs.pop("sudo", False)
279279

@@ -286,7 +286,7 @@ def _prepare_command_kwargs(self, command, kwargs):
286286

287287
# use full path of binary, if not already specified
288288
binary = command[0]
289-
if not "/" in binary:
289+
if "/" not in binary:
290290
binary_full_path = which(binary)
291291
if binary_full_path is None:
292292
raise SubprocessError(f'Command "{binary}" was not found')

bbot/core/helpers/depsinstaller/installer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ async def install(self, *modules):
9797
or self.deps_behavior == "force_install"
9898
):
9999
if not notified:
100-
log.hugeinfo(f"Installing module dependencies. Please be patient, this may take a while.")
100+
log.hugeinfo("Installing module dependencies. Please be patient, this may take a while.")
101101
notified = True
102102
log.verbose(f'Installing dependencies for module "{m}"')
103103
# get sudo access if we need it
104-
if preloaded.get("sudo", False) == True:
104+
if preloaded.get("sudo", False) is True:
105105
self.ensure_root(f'Module "{m}" needs root privileges to install its dependencies.')
106106
success = await self.install_module(m)
107107
self.setup_status[module_hash] = success
@@ -159,7 +159,7 @@ async def install_module(self, module):
159159
deps_common = preloaded["deps"]["common"]
160160
if deps_common:
161161
for dep_common in deps_common:
162-
if self.setup_status.get(dep_common, False) == True:
162+
if self.setup_status.get(dep_common, False) is True:
163163
log.debug(
164164
f'Skipping installation of dependency "{dep_common}" for module "{module}" since it is already installed'
165165
)
@@ -244,7 +244,7 @@ def shell(self, module, commands):
244244
if success:
245245
log.info(f"Successfully ran {len(commands):,} shell commands")
246246
else:
247-
log.warning(f"Failed to run shell dependencies")
247+
log.warning("Failed to run shell dependencies")
248248
return success
249249

250250
def tasks(self, module, tasks):
@@ -310,7 +310,7 @@ def ansible_run(self, tasks=None, module=None, args=None, ansible_args=None):
310310
return success, err
311311

312312
def read_setup_status(self):
313-
setup_status = dict()
313+
setup_status = {}
314314
if self.setup_status_cache.is_file():
315315
with open(self.setup_status_cache) as f:
316316
with suppress(Exception):

bbot/core/helpers/diff.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async def _baseline(self):
101101
ddiff = DeepDiff(baseline_1_json, baseline_2_json, ignore_order=True, view="tree")
102102
self.ddiff_filters = []
103103

104-
for k, v in ddiff.items():
104+
for k in ddiff.keys():
105105
for x in list(ddiff[k]):
106106
log.debug(f"Added {k} filter for path: {x.path()}")
107107
self.ddiff_filters.append(x.path())
@@ -140,7 +140,7 @@ def compare_headers(self, headers_1, headers_2):
140140

141141
ddiff = DeepDiff(headers_1, headers_2, ignore_order=True, view="tree")
142142

143-
for k, v in ddiff.items():
143+
for k in ddiff.keys():
144144
for x in list(ddiff[k]):
145145
try:
146146
header_value = str(x).split("'")[1]
@@ -183,7 +183,7 @@ async def compare(
183183

184184
await self._baseline()
185185

186-
if timeout == None:
186+
if timeout is None:
187187
timeout = self.timeout
188188

189189
reflection = False
@@ -238,11 +238,11 @@ async def compare(
238238

239239
different_headers = self.compare_headers(self.baseline.headers, subject_response.headers)
240240
if different_headers:
241-
log.debug(f"headers were different, no match")
241+
log.debug("headers were different, no match")
242242
diff_reasons.append("header")
243243

244-
if self.compare_body(self.baseline_json, subject_json) == False:
245-
log.debug(f"difference in HTML body, no match")
244+
if self.compare_body(self.baseline_json, subject_json) is False:
245+
log.debug("difference in HTML body, no match")
246246

247247
diff_reasons.append("body")
248248

@@ -275,6 +275,6 @@ async def canary_check(self, url, mode, rounds=3):
275275
)
276276

277277
# if a nonsense header "caused" a difference, we need to abort. We also need to abort if our canary was reflected
278-
if match == False or reflection == True:
278+
if match is False or reflection is True:
279279
return False
280280
return True

bbot/core/helpers/dns/brute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def gen_random_subdomains(self, n=50):
164164
for i in range(0, max(0, n - 5)):
165165
d = delimiters[i % len(delimiters)]
166166
l = lengths[i % len(lengths)]
167-
segments = list(random.choice(self.devops_mutations) for _ in range(l))
167+
segments = [random.choice(self.devops_mutations) for _ in range(l)]
168168
segments.append(self.parent_helper.rand_string(length=8, digits=False))
169169
subdomain = d.join(segments)
170170
yield subdomain

0 commit comments

Comments
 (0)