Repository navigation
Expand file tree
/
Copy pathcli.py
More file actions
117 lines (92 loc) · 3.58 KB
/
Copy pathcli.py
File metadata and controls
117 lines (92 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/env python3
"""
reconkit — an interactive wizard for recon tasks.
No flags to memorize: run `python3 cli.py`, answer a few questions,
and get a clean list of results with 404/403 and wildcard noise
already filtered out.
Requirements:
sudo apt install ffuf seclists curl
Usage:
python3 cli.py
"""
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from core.wordlists import resolve_wordlist, find_seclists_root
from core.filters import get_baseline_size, filter_noise
from core.engines import ffuf_engine
def ask(prompt: str, options: list[str], default_index: int = 0) -> str:
"""Simple numbered menu. Returns the chosen string."""
print(f"\n{prompt}")
for i, opt in enumerate(options, 1):
marker = " (default)" if (i - 1) == default_index else ""
print(f" {i}) {opt}{marker}")
raw = input(f"Choice [1-{len(options)}] (Enter = default): ").strip()
if raw == "":
return options[default_index]
try:
idx = int(raw) - 1
if 0 <= idx < len(options):
return options[idx]
except ValueError:
pass
print("Invalid input, using default.")
return options[default_index]
def main():
print("=" * 55)
print(" reconkit — recon without flag headaches")
print("=" * 55)
if find_seclists_root() is None:
print("\n⚠ SecLists not found. Install it: sudo apt install seclists")
print(" (you can continue, but wordlist selection will fail)\n")
domain = input("\nEnter target domain (e.g. example.com): ").strip()
if not domain:
print("No domain provided, exiting.")
return
task = ask(
"What do you want to do?",
["Find subdomains", "Find hidden pages/directories"],
default_index=0,
)
mode = "subdomains" if task == "Find subdomains" else "dirs"
size = ask(
"Which wordlist size?",
["small", "medium", "large"],
default_index=1, # medium by default
)
try:
wordlist_path = resolve_wordlist(mode, size)
except FileNotFoundError as e:
print(f"\n❌ {e}")
return
print(f"\n▶ Wordlist: {wordlist_path}")
print("▶ Calibrating baseline (requesting a nonexistent path to learn what 'noise' looks like)...")
if mode == "subdomains":
baseline = get_baseline_size(f"https://FUZZ.{domain}", mode)
else:
base = domain if domain.startswith("http") else f"https://{domain}"
baseline = get_baseline_size(f"{base.rstrip('/')}/FUZZ", mode)
if baseline is not None:
print(f"▶ Baseline response size: {baseline} bytes (anything similar will be filtered out)")
else:
print("▶ Could not calibrate baseline — size-based filtering will be skipped.")
print("▶ Running ffuf, this may take a couple of minutes...\n")
if mode == "subdomains":
raw_results = ffuf_engine.run_subdomain_scan(domain, wordlist_path)
else:
raw_results = ffuf_engine.run_dir_scan(domain, wordlist_path)
clean_results = filter_noise(raw_results, baseline)
print("=" * 55)
print(f" Real results found: {len(clean_results)} "
f"(noise filtered out: {len(raw_results) - len(clean_results)})")
print("=" * 55)
if not clean_results:
print("Nothing alive found (or everything was filtered as noise).")
return
for r in sorted(clean_results, key=lambda x: x["url"]):
print(f" [{r['status']}] {r['url']} ({r['length']} bytes)")
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\n\nInterrupted by user.")