bbot 2.7.0.6932rc0__py3-none-any.whl → 2.7.0.6962rc0__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,5 +1,5 @@
1
1
  # version placeholder (replaced by poetry-dynamic-versioning)
2
- __version__ = "v2.7.0.6932rc"
2
+ __version__ = "v2.7.0.6962rc"
3
3
 
4
4
  from .scanner import Scanner, Preset
5
5
 
bbot/modules/git_clone.py CHANGED
@@ -24,43 +24,61 @@ class git_clone(github):
24
24
 
25
25
  async def setup(self):
26
26
  output_folder = self.config.get("output_folder")
27
- if output_folder:
28
- self.output_dir = Path(output_folder) / "git_repos"
29
- else:
30
- self.output_dir = self.scan.temp_dir / "git_repos"
27
+ self.output_dir = Path(output_folder) / "git_repos" if output_folder else self.scan.temp_dir / "git_repos"
31
28
  self.helpers.mkdir(self.output_dir)
32
29
  return await super().setup()
33
30
 
34
31
  async def filter_event(self, event):
35
- if event.type == "CODE_REPOSITORY":
36
- if "git" not in event.tags:
37
- return False, "event is not a git repository"
32
+ if event.type == "CODE_REPOSITORY" and "git" not in event.tags:
33
+ return False, "event is not a git repository"
38
34
  return True
39
35
 
40
36
  async def handle_event(self, event):
41
- repo_url = event.data.get("url")
42
- repo_path = await self.clone_git_repository(repo_url)
43
- if repo_path:
44
- self.verbose(f"Cloned {repo_url} to {repo_path}")
45
- codebase_event = self.make_event({"path": str(repo_path)}, "FILESYSTEM", tags=["git"], parent=event)
37
+ repository_url = event.data.get("url")
38
+ repository_path = await self.clone_git_repository(repository_url)
39
+ if repository_path:
40
+ self.verbose(f"Cloned {repository_url} to {repository_path}")
41
+ codebase_event = self.make_event({"path": str(repository_path)}, "FILESYSTEM", tags=["git"], parent=event)
46
42
  await self.emit_event(
47
43
  codebase_event,
48
- context=f"{{module}} downloaded git repo at {repo_url} to {{event.type}}: {repo_path}",
44
+ context=f"{{module}} cloned git repository at {repository_url} to {{event.type}}: {repository_path}",
49
45
  )
50
46
 
51
47
  async def clone_git_repository(self, repository_url):
52
48
  owner = repository_url.split("/")[-2]
53
49
  folder = self.output_dir / owner
54
50
  self.helpers.mkdir(folder)
55
- if self.api_key:
56
- url = repository_url.replace("https://github.com", f"https://user:{self.api_key}@github.com")
57
- else:
58
- url = repository_url
59
- command = ["git", "-C", folder, "clone", url]
51
+
52
+ command = ["git", "-C", folder, "clone", repository_url]
53
+ env = {"GIT_TERMINAL_PROMPT": "0"}
54
+
60
55
  try:
61
- output = await self.run_process(command, env={"GIT_TERMINAL_PROMPT": "0"}, check=True)
56
+ hostname = self.helpers.urlparse(repository_url).hostname
57
+ if hostname and self.api_key:
58
+ _, domain = self.helpers.split_domain(hostname)
59
+ # only use the api key if the domain is github.com
60
+ if domain == "github.com":
61
+ env["GIT_HELPER"] = (
62
+ f'!f() {{ case "$1" in get) '
63
+ f"echo username=x-access-token; "
64
+ f"echo password={self.api_key};; "
65
+ f'esac; }}; f "$@"'
66
+ )
67
+ command = (
68
+ command[:1]
69
+ + [
70
+ "-c",
71
+ "credential.helper=",
72
+ "-c",
73
+ "credential.useHttpPath=true",
74
+ "--config-env=credential.helper=GIT_HELPER",
75
+ ]
76
+ + command[1:]
77
+ )
78
+
79
+ output = await self.run_process(command, env=env, check=True)
62
80
  except CalledProcessError as e:
63
- self.debug(f"Error cloning {url}. STDERR: {repr(e.stderr)}")
81
+ self.debug(f"Error cloning {repository_url}. STDERR: {repr(e.stderr)}")
64
82
  return
65
83
 
66
84
  folder_name = output.stderr.split("Cloning into '")[1].split("'")[0]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bbot
3
- Version: 2.7.0.6932rc0
3
+ Version: 2.7.0.6962rc0
4
4
  Summary: OSINT automation for hackers.
5
5
  License: GPL-3.0
6
6
  Keywords: python,cli,automation,osint,threat-intel,intelligence,neo4j,scanner,python-library,hacking,recursion,pentesting,recon,command-line-tool,bugbounty,subdomains,security-tools,subdomain-scanner,osint-framework,attack-surface,subdomain-enumeration,osint-tool
@@ -34,7 +34,7 @@ Requires-Dist: puremagic (>=1.28,<2.0)
34
34
  Requires-Dist: pycryptodome (>=3.17,<4.0)
35
35
  Requires-Dist: pydantic (>=2.9.2,<3.0.0)
36
36
  Requires-Dist: pyjwt (>=2.7.0,<3.0.0)
37
- Requires-Dist: pyzmq (>=26.0.3,<27.0.0)
37
+ Requires-Dist: pyzmq (>=26.0.3,<28.0.0)
38
38
  Requires-Dist: radixtarget (>=3.0.13,<4.0.0)
39
39
  Requires-Dist: regex (>=2024.4.16,<2025.0.0)
40
40
  Requires-Dist: setproctitle (>=1.3.3,<2.0.0)
@@ -1,4 +1,4 @@
1
- bbot/__init__.py,sha256=2ao6sbpuoyglM1LGcRyI29GV7Akr_86N8ocqxSIIB6w,163
1
+ bbot/__init__.py,sha256=sl7Uz8uS9blFFoPuBAG5Q5s4a3n87_KdTeY83faWg3E,163
2
2
  bbot/cli.py,sha256=1QJbANVw9Q3GFM92H2QRV2ds5756ulm08CDZwzwPpeI,11888
3
3
  bbot/core/__init__.py,sha256=l255GJE_DvUnWvrRb0J5lG-iMztJ8zVvoweDOfegGtI,46
4
4
  bbot/core/config/__init__.py,sha256=zYNw2Me6tsEr8hOOkLb4BQ97GB7Kis2k--G81S8vofU,342
@@ -104,7 +104,7 @@ bbot/modules/fingerprintx.py,sha256=rdlR9d64AntAhbS_eJzh8bZCeLPTJPSKdkdKdhH_qAo,
104
104
  bbot/modules/fullhunt.py,sha256=2ntu1yBh51N4e_l-kpXc1UBoVVcxEE2JPkyaMYCuUb4,1336
105
105
  bbot/modules/generic_ssrf.py,sha256=KFdcHpUV9-Z7oN7emzbirimsNc2xZ_1IFqnsfIkEbcM,9196
106
106
  bbot/modules/git.py,sha256=zmHeI0bn181T1P8C55HSebkdVGLTpzGxPc-LRqiHrbc,1723
107
- bbot/modules/git_clone.py,sha256=AaiETlAtgY8gbAyvv4FrOBYa06L3WNvyc89ith5um2k,2599
107
+ bbot/modules/git_clone.py,sha256=XIPPY2qubN-UxzFXNjEpA2tDObJKrNy24PvqAb22cD8,3449
108
108
  bbot/modules/gitdumper.py,sha256=giwXMPlmgC1gxyZKTGlF-0xplt4MBbDiXi07-ghH02o,12039
109
109
  bbot/modules/github_codesearch.py,sha256=a-r2vE9N9WyBpFUiKCsg0TK4Qn7DaEGyVRTUKzkDLWA,3641
110
110
  bbot/modules/github_org.py,sha256=WM18vJCHuOHJJ5rPzQzQ3Pmp7XPPuaMeVgNfW-FlO0k,8938
@@ -453,8 +453,8 @@ bbot/wordlists/raft-small-extensions-lowercase_CLEANED.txt,sha256=ZSIVebs7ptMvHx
453
453
  bbot/wordlists/top_open_ports_nmap.txt,sha256=LmdFYkfapSxn1pVuQC2LkOIY2hMLgG-Xts7DVtYzweM,42727
454
454
  bbot/wordlists/valid_url_schemes.txt,sha256=0B_VAr9Dv7aYhwi6JSBDU-3M76vNtzN0qEC_RNLo7HE,3310
455
455
  bbot/wordlists/wordninja_dns.txt.gz,sha256=DYHvvfW0TvzrVwyprqODAk4tGOxv5ezNmCPSdPuDUnQ,570241
456
- bbot-2.7.0.6932rc0.dist-info/LICENSE,sha256=GzeCzK17hhQQDNow0_r0L8OfLpeTKQjFQwBQU7ZUymg,32473
457
- bbot-2.7.0.6932rc0.dist-info/METADATA,sha256=Riwmw8RwWO7QAs1d-1dCHYdmVpcAcX8FHRkcT8IHlq4,18308
458
- bbot-2.7.0.6932rc0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
459
- bbot-2.7.0.6932rc0.dist-info/entry_points.txt,sha256=cWjvcU_lLrzzJgjcjF7yeGuRA_eDS8pQ-kmPUAyOBfo,38
460
- bbot-2.7.0.6932rc0.dist-info/RECORD,,
456
+ bbot-2.7.0.6962rc0.dist-info/LICENSE,sha256=GzeCzK17hhQQDNow0_r0L8OfLpeTKQjFQwBQU7ZUymg,32473
457
+ bbot-2.7.0.6962rc0.dist-info/METADATA,sha256=DTH-2tKHw4l3E3TgGl0LOvsdZGhRqrEb44Ct2HxSnag,18308
458
+ bbot-2.7.0.6962rc0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
459
+ bbot-2.7.0.6962rc0.dist-info/entry_points.txt,sha256=cWjvcU_lLrzzJgjcjF7yeGuRA_eDS8pQ-kmPUAyOBfo,38
460
+ bbot-2.7.0.6962rc0.dist-info/RECORD,,