duckesploit 0.1.0__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.
@@ -0,0 +1,50 @@
1
+ import os
2
+ import urllib.request
3
+ import sqlite3
4
+
5
+ # URL do repositório que a gente ACABOU de dar o verde!
6
+ DB_URL = "https://raw.githubusercontent.com/lazyman563/DucKEsploitDB/main/data/duck_base.db"
7
+ DB_PATH = os.path.expanduser("~/.duckesploit/duck_base.db")
8
+
9
+ def sync_database():
10
+ """Synchronizes the sacred database com o GitHub."""
11
+ os.makedirs(os.path.dirname(DB_PATH), exist_ok=True)
12
+ print("[*] Checking for arsenal updates...")
13
+ try:
14
+ req = urllib.request.Request(DB_URL, method='HEAD', headers={'User-Agent': 'Mozilla/5.0'})
15
+ with urllib.request.urlopen(req) as response:
16
+ remote_size = int(response.headers.get('Content-Length', 0))
17
+
18
+ if os.path.exists(DB_PATH) and os.path.getsize(DB_PATH) == remote_size:
19
+ print("[V] Arsenal is already up to date.")
20
+ return True
21
+
22
+ print("[!] Synchronizing the sacred database...")
23
+ req = urllib.request.Request(DB_URL, headers={'User-Agent': 'Mozilla/5.0'})
24
+ with urllib.request.urlopen(req) as response, open(DB_PATH, 'wb') as out_file:
25
+ out_file.write(response.read())
26
+ print("[V] Sync complete. 6MB of pure destruction ready.")
27
+ return True
28
+ except Exception as e:
29
+ if os.path.exists(DB_PATH):
30
+ print(f"[!] Update check failed ({e}). Using cached version.")
31
+ return True
32
+ print(f"[X] Critical error: Cannot fetch database. {e}")
33
+ return False
34
+
35
+ class DuckDatabase:
36
+ def __init__(self):
37
+ self.conn = sqlite3.connect(DB_PATH)
38
+ self.cursor = self.conn.cursor()
39
+
40
+ def search(self, term, platform=None):
41
+ query = "SELECT id, file, description, platform, type FROM exploits WHERE description LIKE ?"
42
+ params = [f'%{term}%']
43
+ if platform:
44
+ query += " AND platform = ?"
45
+ params.append(platform.lower())
46
+ self.cursor.execute(query, params)
47
+ return self.cursor.fetchall()
48
+
49
+ def close(self):
50
+ self.conn.close()
core/downloader.py ADDED
@@ -0,0 +1,26 @@
1
+ import requests
2
+ import os
3
+
4
+ BASE_URL = "https://gitlab.com/exploit-database/exploitdb/-/raw/main/"
5
+
6
+ def download_exploit(file_path, platform):
7
+ save_dir = f"exploits/{platform}"
8
+ os.makedirs(save_dir, exist_ok=True)
9
+
10
+ filename = os.path.basename(file_path)
11
+ full_path = os.path.join(save_dir, filename)
12
+ url = f"{BASE_URL}{file_path}"
13
+
14
+ print(f"[*] Downloading from: {url}")
15
+ try:
16
+ r = requests.get(url, timeout=10)
17
+ if r.status_code == 200:
18
+ with open(full_path, 'wb') as f:
19
+ f.write(r.content)
20
+ print(f"[V] Saved at: {full_path}")
21
+ return full_path
22
+ else:
23
+ print(f"[X] Erro {r.status_code}: Could not get the file.")
24
+ except Exception as e:
25
+ print(f"[X] Connection failure: {e}")
26
+ return None
core/search.py ADDED
@@ -0,0 +1,28 @@
1
+ from core.database_manager import DuckDatabase
2
+
3
+ def run_search(term, platform=None):
4
+ """Executa a busca no arsenal sagrado."""
5
+ try:
6
+ db = DuckDatabase()
7
+ results = db.search(term, platform)
8
+
9
+ if not results:
10
+ print(f"\n[!] Deserto total. Nenhum exploit para: {term}")
11
+ return []
12
+
13
+ print(f"\n[+] ARSENAL: {len(results)} exploits encontrados")
14
+ print("=" * 60)
15
+
16
+ for res in results:
17
+ eid, file_path, desc, plat, etype = res
18
+ # Cores e formatação bruta para o Termux
19
+ print(f"\033[1;32mID: {eid}\033[0m | \033[1;34m{plat.upper()}\033[0m | {etype}")
20
+ print(f"DESC: {desc}")
21
+ print(f"PATH: {file_path}")
22
+ print("-" * 40)
23
+
24
+ db.close()
25
+ return results
26
+ except Exception as e:
27
+ print(f"[X] Erro na busca sagrada: {e}")
28
+ return []
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: duckesploit
3
+ Version: 0.1.0
4
+ Summary: DucKEsploit - Advanced Exploit Database CLI
5
+ Author-email: MurilooPrDev <lazyman563@hotmail.com>
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: requests
@@ -0,0 +1,8 @@
1
+ core/database_manager.py,sha256=z4RNKODZt9JCQuOdASaPUWvl8ny5jEmgHwrgoR6RGqc,1999
2
+ core/downloader.py,sha256=Ci4_-aset0t49suXYWkdygc34-m_mt6n2-9OgCQzfSI,816
3
+ core/search.py,sha256=DjwDOJSek8hc099yH_qEJfiTw3BkISEapjEaN-Fuk-A,921
4
+ duckesploit-0.1.0.dist-info/METADATA,sha256=qeu8SDUn0fqgQTh4fEfu-hj9VU5VGPDcd-eTSOcxvhw,393
5
+ duckesploit-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
6
+ duckesploit-0.1.0.dist-info/entry_points.txt,sha256=Su8G1eayuaMGi5z-vRa2aDPeOk_iGStwP4F9OccHQ4A,42
7
+ duckesploit-0.1.0.dist-info/top_level.txt,sha256=0ebp8k35dOTHVwbY3UcokRsjC7cWLN_iaJ70tIcmODU,5
8
+ duckesploit-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ duckesploit = main:main
@@ -0,0 +1 @@
1
+ core