vulpfest 1.0.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,142 @@
1
+ """Pengaman SSRF untuk Cyber Web Scanner.
2
+
3
+ Pemindai mengambil URL dari pengguna, jadi ia tidak boleh dipakai untuk menghubungi jaringan
4
+ internal: alamat privat, loopback, link-local (termasuk metadata cloud 169.254.169.254), CGNAT,
5
+ dan sejenisnya. Pemeriksaan dilakukan di tiga lapis:
6
+ 1. sebelum setiap permintaan HTTP, termasuk setiap lompatan redirect;
7
+ 2. setelah koneksi terbuka, terhadap IP yang benar-benar dihubungi (menutup celah DNS rebinding);
8
+ 3. untuk koneksi TLS langsung (pemeriksaan sertifikat dan TLS lama).
9
+ """
10
+ import ipaddress
11
+ import socket
12
+ from urllib.parse import urlparse
13
+
14
+ import requests
15
+ import urllib3.util.connection as _u3conn
16
+ from requests.adapters import HTTPAdapter
17
+
18
+ ALLOWED_SCHEMES = ("http", "https")
19
+ ALLOWED_PORTS = (None, 80, 443, 8080, 8443)
20
+ MAX_REDIRECTS = 5
21
+ MAX_BYTES = 5 * 1024 * 1024
22
+ BLOCKED_SUFFIXES = (".localhost", ".local", ".internal", ".lan", ".home.arpa")
23
+
24
+
25
+ class BlockedTarget(requests.exceptions.RequestException):
26
+ """Tujuan ditolak demi keamanan (jaringan internal, skema, atau port tidak diizinkan)."""
27
+
28
+
29
+ class ResponseTooLarge(requests.exceptions.RequestException):
30
+ """Respons melebihi batas ukuran."""
31
+
32
+
33
+ def is_public_ip(ip):
34
+ """True hanya untuk alamat yang dapat dirutekan di internet publik."""
35
+ try:
36
+ addr = ipaddress.ip_address(str(ip).split("%")[0])
37
+ except ValueError:
38
+ return False
39
+ if addr.version == 6 and addr.ipv4_mapped:
40
+ addr = addr.ipv4_mapped
41
+ return addr.is_global and not addr.is_multicast
42
+
43
+
44
+ def resolve_public(host):
45
+ """Resolusi DNS; tolak bila SATU saja alamatnya bukan alamat publik."""
46
+ host = (host or "").strip().strip("[]").rstrip(".").lower()
47
+ if not host:
48
+ raise BlockedTarget("Alamat tujuan kosong.")
49
+ if host == "localhost" or host.endswith(BLOCKED_SUFFIXES):
50
+ raise BlockedTarget(f"Alamat {host} adalah jaringan lokal; pemindaian ditolak.")
51
+ try:
52
+ infos = socket.getaddrinfo(host, None, proto=socket.IPPROTO_TCP)
53
+ except socket.gaierror as e:
54
+ raise requests.exceptions.ConnectionError(f"Nama domain {host} tidak dapat ditemukan ({e}).")
55
+ ips = sorted({info[4][0] for info in infos})
56
+ for ip in ips:
57
+ if not is_public_ip(ip):
58
+ raise BlockedTarget(f"Alamat {host} mengarah ke jaringan privat atau internal ({ip}); pemindaian ditolak.")
59
+ return ips
60
+
61
+
62
+ def check_url(url):
63
+ """Validasi satu URL sebelum dihubungi."""
64
+ p = urlparse(url)
65
+ if p.scheme.lower() not in ALLOWED_SCHEMES:
66
+ raise BlockedTarget("Hanya alamat http:// dan https:// yang dapat dipindai.")
67
+ try:
68
+ port = p.port
69
+ except ValueError:
70
+ raise BlockedTarget("Port pada alamat tidak valid.")
71
+ if port not in ALLOWED_PORTS:
72
+ raise BlockedTarget(f"Port {port} tidak diizinkan; hanya port web standar (80, 443, 8080, 8443).")
73
+ if p.username or p.password:
74
+ raise BlockedTarget("Alamat yang berisi nama pengguna atau kata sandi tidak dapat dipindai.")
75
+ return resolve_public(p.hostname)
76
+
77
+
78
+ # --- Lapis 2: periksa IP yang benar-benar dihubungi ---
79
+ _original_create_connection = _u3conn.create_connection
80
+ _installed = False
81
+
82
+
83
+ def _guarded_create_connection(address, *args, **kwargs):
84
+ sock = _original_create_connection(address, *args, **kwargs)
85
+ try:
86
+ peer = sock.getpeername()[0]
87
+ except OSError:
88
+ peer = None
89
+ if peer is None or not is_public_ip(peer):
90
+ sock.close()
91
+ raise BlockedTarget(f"Koneksi ke alamat internal ({peer}) diblokir.")
92
+ return sock
93
+
94
+
95
+ def install_connection_guard():
96
+ global _installed
97
+ if not _installed:
98
+ _u3conn.create_connection = _guarded_create_connection
99
+ _installed = True
100
+
101
+
102
+ # --- Lapis 3: koneksi soket langsung (TLS) ---
103
+ def connect_public(address, timeout=None):
104
+ host, port = address
105
+ resolve_public(host)
106
+ sock = socket.create_connection(address, timeout=timeout)
107
+ peer = sock.getpeername()[0]
108
+ if not is_public_ip(peer):
109
+ sock.close()
110
+ raise BlockedTarget(f"Koneksi ke alamat internal ({peer}) diblokir.")
111
+ return sock
112
+
113
+
114
+ # --- Lapis 1: setiap permintaan, termasuk setiap redirect, plus batas ukuran ---
115
+ class GuardedAdapter(HTTPAdapter):
116
+ def send(self, request, stream=False, **kwargs):
117
+ check_url(request.url)
118
+ resp = super().send(request, stream=True, **kwargs)
119
+ if stream:
120
+ return resp
121
+ data = resp.raw.read(MAX_BYTES + 1, decode_content=True)
122
+ if len(data) > MAX_BYTES:
123
+ resp.close()
124
+ raise ResponseTooLarge(f"Respons lebih dari {MAX_BYTES // (1024 * 1024)} MB; pengambilan dihentikan.")
125
+ resp._content = data
126
+ resp._content_consumed = True
127
+ try:
128
+ resp.raw.release_conn()
129
+ except Exception:
130
+ pass
131
+ return resp
132
+
133
+
134
+ def guard_session(session, max_redirects=MAX_REDIRECTS):
135
+ """Pasang semua pengaman pada sebuah requests.Session."""
136
+ install_connection_guard()
137
+ adapter = GuardedAdapter(max_retries=0)
138
+ session.mount("http://", adapter)
139
+ session.mount("https://", adapter)
140
+ session.max_redirects = max_redirects
141
+ session.trust_env = False # abaikan proxy dari environment agar pemeriksaan IP akurat
142
+ return session
vulpfest/ui.py ADDED
@@ -0,0 +1,38 @@
1
+ """Warna terminal lintas-OS. Warna mati otomatis bila terminal tidak mendukung (mis. piped/CI)."""
2
+ import os
3
+ import sys
4
+
5
+ _ENABLED = (
6
+ sys.stdout.isatty()
7
+ and os.environ.get("NO_COLOR") is None
8
+ and os.environ.get("TERM") != "dumb"
9
+ )
10
+
11
+ # Di Windows modern, aktifkan dukungan ANSI bila perlu.
12
+ if _ENABLED and os.name == "nt":
13
+ try:
14
+ import ctypes
15
+ kernel32 = ctypes.windll.kernel32
16
+ kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)
17
+ except Exception:
18
+ pass
19
+
20
+ _CODES = {
21
+ "reset": "0", "bold": "1", "dim": "2",
22
+ "red": "31", "green": "32", "yellow": "33", "blue": "34",
23
+ "magenta": "35", "cyan": "36", "white": "37", "gray": "90",
24
+ "orange": "38;5;208", "fox": "38;5;202",
25
+ }
26
+
27
+
28
+ def c(text, *styles):
29
+ if not _ENABLED or not styles:
30
+ return text
31
+ codes = ";".join(_CODES.get(s, "0") for s in styles)
32
+ return f"\033[{codes}m{text}\033[0m"
33
+
34
+
35
+ def rgb(text, r, g, b):
36
+ if not _ENABLED:
37
+ return text
38
+ return f"\033[38;2;{r};{g};{b}m{text}\033[0m"
@@ -0,0 +1,103 @@
1
+ Metadata-Version: 2.5
2
+ Name: vulpfest
3
+ Version: 1.0.0
4
+ Summary: Vulpfest Lab tools in one place: a web security scanner and a scam-link checker, from your terminal.
5
+ Project-URL: Homepage, https://lab.vulpfest.com
6
+ Project-URL: Source, https://github.com/vulpfest/vulpfest-cli
7
+ Author: Febri Osht (Vulpfest)
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Keywords: anti-scam,osint,phishing,scanner,security,vulpfest
11
+ Requires-Python: >=3.9
12
+ Requires-Dist: beautifulsoup4>=4.12
13
+ Requires-Dist: requests>=2.32
14
+ Provides-Extra: all
15
+ Requires-Dist: ddgs>=6.0; extra == 'all'
16
+ Requires-Dist: openpyxl>=3.0; extra == 'all'
17
+ Requires-Dist: pandas>=2.0; extra == 'all'
18
+ Requires-Dist: selenium>=4.0; extra == 'all'
19
+ Requires-Dist: webdriver-manager>=4.0; extra == 'all'
20
+ Requires-Dist: xlsxwriter>=3.0; extra == 'all'
21
+ Provides-Extra: gmaps
22
+ Requires-Dist: openpyxl>=3.0; extra == 'gmaps'
23
+ Requires-Dist: pandas>=2.0; extra == 'gmaps'
24
+ Requires-Dist: selenium>=4.0; extra == 'gmaps'
25
+ Requires-Dist: webdriver-manager>=4.0; extra == 'gmaps'
26
+ Requires-Dist: xlsxwriter>=3.0; extra == 'gmaps'
27
+ Provides-Extra: leads
28
+ Requires-Dist: ddgs>=6.0; extra == 'leads'
29
+ Requires-Dist: pandas>=2.0; extra == 'leads'
30
+ Description-Content-Type: text/markdown
31
+
32
+ <p align="center">
33
+ <picture>
34
+ <source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/npm/@vulpfest/icons@0.3/svg/vulpfest-logo-night.svg">
35
+ <img src="https://cdn.jsdelivr.net/npm/@vulpfest/icons@0.3/svg/vulpfest-logo-day.svg" alt="Vulpfest" width="150">
36
+ </picture>
37
+ </p>
38
+
39
+ # vulpfest
40
+
41
+ All four free tools from [Vulpfest Lab](https://lab.vulpfest.com) in one terminal command. Type `vulpfest`,
42
+ pick a tool from the menu, and run it — on Windows, macOS or Linux.
43
+
44
+ | # | Tool | Command | What it does |
45
+ |---|---|---|---|
46
+ | 1 | Cyber Web Scanner | `vulpfest scan` | Checks your own website: headers, SSL/TLS, exposed files, JavaScript secrets, DNS and email, and (with `--repo`) your project folder |
47
+ | 2 | Scam Check | `vulpfest check` | Checks a suspicious link before you click it: fake app downloads, look-alike sites, hidden redirects, phishing forms |
48
+ | 3 | LeadScout | `vulpfest leads` | Researches B2B prospects from public search results |
49
+ | 4 | GMaps Scout | `vulpfest gmaps` | Turns publicly listed business details into a spreadsheet |
50
+
51
+ ## Install
52
+
53
+ Requires Python 3.9 or newer.
54
+
55
+ ```bash
56
+ pip install vulpfest # Cyber Web Scanner + Scam Check (light)
57
+ pip install "vulpfest[all]" # adds LeadScout and GMaps Scout
58
+ ```
59
+
60
+ Until the package is on PyPI, install it straight from GitHub:
61
+
62
+ ```bash
63
+ pip install "vulpfest[all] @ git+https://github.com/vulpfest/vulpfest-cli"
64
+ ```
65
+
66
+ GMaps Scout drives a real browser, so it also needs **Google Chrome** installed.
67
+
68
+ ## Use
69
+
70
+ ```bash
71
+ vulpfest # menu: pick a tool by number
72
+ vulpfest scan example.com # scan your own website
73
+ vulpfest scan example.com --repo . # site + project folder in one report
74
+ vulpfest check bca-co-id.xyz # check a suspicious link
75
+ vulpfest leads --roles "software house" --industries "technology" --out leads.csv
76
+ vulpfest gmaps "coffee shop in Bali" --limit 20 --out places.xlsx
77
+ vulpfest <tool> --help # all options of a tool
78
+ ```
79
+
80
+ Each tool behaves exactly like its standalone version; the source of each one lives in its own repository:
81
+ [Cyber-Web-Scanner](https://github.com/FebriOsht/Cyber-Web-Scanner) ·
82
+ [linkcheck](https://github.com/FebriOsht/linkcheck) ·
83
+ [leadscout](https://github.com/FebriOsht/leadscout) ·
84
+ [gmap-scout](https://github.com/FebriOsht/gmap-scout).
85
+
86
+ ## Responsible use
87
+
88
+ Scan only websites you own or are authorized to test. Collect only public data, respect each site''s terms,
89
+ and follow the data-protection law that applies to you.
90
+
91
+ ## Security
92
+
93
+ Found a security issue? Please report it privately — see [SECURITY.md](SECURITY.md).
94
+
95
+ ## Support this project
96
+
97
+ If these free tools help you, you can support their development at
98
+ [github.com/FebriOsht#support](https://github.com/FebriOsht#support) (Saweria, PayPal, or crypto).
99
+ Only send on the network stated there.
100
+
101
+ ## License
102
+
103
+ MIT © 2026 Febri Osht (Vulpfest). See [LICENSE](LICENSE).
@@ -0,0 +1,25 @@
1
+ vulpfest/__init__.py,sha256=J-j-u0itpEFT6irdmWmixQqYMadNl1X91TxUmoiLHMI,22
2
+ vulpfest/__main__.py,sha256=-4m4O628Q7W9HQY6xpjU-paxKoSz4cvACHhxTAwUJns,3627
3
+ vulpfest/banner.py,sha256=rShW5Uo9_f43nTJjAE_p1jlGrRCgs4d7DxUTV4TmlCw,2760
4
+ vulpfest/logo.py,sha256=bidbbNWEDLgZjHe4bO19xJp2R42fEqg8xh3X5msSF1I,1161
5
+ vulpfest/ui.py,sha256=_hhzwBTUhEQ2hhM0ZJJvVpkrSRc1EraQOlUhbIrfUkU,1027
6
+ vulpfest/tools/gmapscout/cli.py,sha256=0-1wlze-3gDuUSPmG9NjL8z_LfCymf45IiZqmkE-P5c,2042
7
+ vulpfest/tools/gmapscout/gmapscout_core.py,sha256=i5BhBy2Fq5sqeuzSwJPHagcZOtkS09st3h09B5jawmQ,6928
8
+ vulpfest/tools/leadscout/cli.py,sha256=RUqx4nIcPBSaSALSZolZzAVMcEgy8L27616WeCuw1T4,2259
9
+ vulpfest/tools/leadscout/leadscout_core.py,sha256=fqbjwkl-Xd6UX7fQ5TFn_c7ov2DNHkntnxtRbaQ5m8M,2942
10
+ vulpfest/tools/scamcheck/checker.py,sha256=GSf47QqA_Om6uN_HXzzCTY6KhscY62umYkIDo7BD-38,11330
11
+ vulpfest/tools/scamcheck/cli.py,sha256=UeugKt0a1tAN6EgiqQSpr8WupvbFdSQasrl0WivHpRk,3582
12
+ vulpfest/tools/scamcheck/ssrf_guard.py,sha256=l-tIylaq_dy53FG2x2Ig6e4qN0ryTglCUHHS8HIqJ0U,5347
13
+ vulpfest/tools/scanner/auth_scan.py,sha256=HsRU2VLLaNgnUuGzUcF0tQ5gwLIJBR5pLxmeKc3iK2A,6801
14
+ vulpfest/tools/scanner/cli.py,sha256=JTpeQorbURt9BhuBpg3GvH9c_vafv6bAGmnjqupNsmA,8855
15
+ vulpfest/tools/scanner/deep_web.py,sha256=0XF39XuUV9GFOS95_crrOmUVsXqs98bsu7o4zMFeQ2c,15283
16
+ vulpfest/tools/scanner/dns_email.py,sha256=s7s_s3_RdZI_X92nqqqEA82cP3Lx-qOg7wJ1CBaYo7g,8947
17
+ vulpfest/tools/scanner/manual_review.py,sha256=dezKQyLHn3kJr-HXdzBilplclkQna5QA0CDRtwR7ufM,5026
18
+ vulpfest/tools/scanner/repo_scan.py,sha256=R5GNjlsV3qC9a5dn4x6Q1dTJRfjGXuThAu5dYlvwrOg,23839
19
+ vulpfest/tools/scanner/scanner.py,sha256=iqgx9NkfwXn6p7aS7JwiIx5U-MxuyIrg0itROduwlu0,46601
20
+ vulpfest/tools/scanner/ssrf_guard.py,sha256=l-tIylaq_dy53FG2x2Ig6e4qN0ryTglCUHHS8HIqJ0U,5347
21
+ vulpfest-1.0.0.dist-info/METADATA,sha256=eu5gbVRZKEaTGCTnGnkXoR8CWpl0_IMynFc2_Oe25r4,4168
22
+ vulpfest-1.0.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
23
+ vulpfest-1.0.0.dist-info/entry_points.txt,sha256=Jrj8TLnq5U0W6oAVVPEYRjDL6Lk7KBcvLmXpnZsjYfw,52
24
+ vulpfest-1.0.0.dist-info/licenses/LICENSE,sha256=8bU9D6LYiW7DKuAIYjodPkgIAFR1aY4yhFgTKZ5qxzM,1077
25
+ vulpfest-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ vulpfest = vulpfest.__main__:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Febri Osht (Vulpfest)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.