-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
146 lines (131 loc) · 5.92 KB
/
Copy pathsetup.py
File metadata and controls
146 lines (131 loc) · 5.92 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/usr/bin/env python3
"""
NovaRecon - Enterprise Reconnaissance Framework
Setup & Installation Script
"""
import os
import sys
import subprocess
import platform
VERSION = "3.0.0"
PROJECT_NAME = "NovaRecon"
REQUIRED_DIRS = [
"modules", "utils", "reporting", "database", "api", "workers",
"docker", "kubernetes", "terraform", "scripts", "web", "config",
"data", "logs", "output", "reports", "patches", "hooks", "tests",
"src/core", "src/modules", "src/utils"
]
REQUIRED_FILES = {
"requirements.txt": """aiohttp>=3.9.0
beautifulsoup4>=4.12.0
requests>=2.31.0
python-nmap>=0.7.0
colorama>=0.4.6
rich>=13.0.0
dnspython>=2.4.0
whois>=0.9.0
selenium>=4.15.0
aiofiles>=23.2.0
cryptography>=41.0.0
Pillow>=10.0.0
jinja2>=3.1.0
reportlab>=4.0.0
fastapi>=0.104.0
uvicorn>=0.24.0
sqlalchemy>=2.0.0
psycopg2-binary>=2.9.0
celery>=5.3.0
redis>=5.0.0
scikit-learn>=1.3.0
pandas>=2.1.0
numpy>=1.25.0
python-dateutil>=2.8.0
pydantic>=2.5.0
httpx>=0.25.0
tqdm>=4.66.0
pyyaml>=6.0.0
""",
}
BANNER = """
╔══════════════════════════════════════════════════════════════╗
║ ║
║ ███╗ ██╗ ██████╗ ██╗ ██╗ █████╗ ║
║ ████╗ ██║██╔═══██╗██║ ██║██╔══██╗ ║
║ ██╔██╗ ██║██║ ██║██║ ██║███████║ ║
║ ██║╚██╗██║██║ ██║╚██╗ ██╔╝██╔══██║ ║
║ ██║ ╚████║╚██████╔╝ ╚████╔╝ ██║ ██║ ║
║ ╚═╝ ╚═══╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ║
║ ║
║ ██████╗ ███████╗ ██████╗ ██████╗ ███╗ ██╗ ║
║ ██╔══██╗██╔════╝██╔════╝██╔═══██╗████╗ ██║ ║
║ ██████╔╝█████╗ ██║ ██║ ██║██╔██╗ ██║ ║
║ ██╔══██╗██╔══╝ ██║ ██║ ██║██║╚██╗██║ ║
║ ██║ ██║███████╗╚██████╗╚██████╔╝██║ ╚████║ ║
║ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ║
║ ║
║ Enterprise Reconnaissance Framework v""" + VERSION + """ ║
║ Authorized Security Testing Only ║
║ ║
╚══════════════════════════════════════════════════════════════╝
"""
def print_banner():
print(BANNER)
def create_directories():
print("[+] Creating project directories...")
for d in REQUIRED_DIRS:
os.makedirs(d, exist_ok=True)
init_file = os.path.join(d, "__init__.py")
if not os.path.exists(init_file):
with open(init_file, "w") as f:
f.write(f"# {d.replace('/', '.')} package\n")
print("[✓] All directories created successfully")
def create_requirements():
print("[+] Creating requirements.txt...")
for fname, content in REQUIRED_FILES.items():
with open(fname, "w") as f:
f.write(content)
print("[✓] requirements.txt created")
def install_dependencies():
print("[+] Installing Python dependencies...")
try:
subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "pip"])
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
print("[✓] Dependencies installed successfully")
except subprocess.CalledProcessError as e:
print(f"[!] Warning: Some packages failed to install: {e}")
print("[!] You can manually run: pip install -r requirements.txt")
def create_init_files():
print("[+] Creating __init__.py files...")
packages = ["src", "src.core", "src.modules", "src.utils", "config"]
for pkg in packages:
os.makedirs(pkg.replace(".", "/"), exist_ok=True)
init_path = pkg.replace(".", "/") + "/__init__.py"
if not os.path.exists(init_path):
with open(init_path, "w") as f:
f.write(f"# {pkg} package\n")
print("[✓] Init files created")
def check_system():
print(f"[+] System: {platform.system()} {platform.release()}")
print(f"[+] Python: {sys.version.split()[0]}")
if platform.system() == "Linux":
try:
result = subprocess.check_output(["which", "nmap"], stderr=subprocess.STDOUT)
print("[✓] nmap is installed")
except:
print("[!] nmap not found. Install with: sudo apt install nmap")
def main():
os.chdir(os.path.dirname(os.path.abspath(__file__)) or ".")
print_banner()
print(f"[*] Setting up {PROJECT_NAME} v{VERSION}...\n")
create_directories()
create_init_files()
create_requirements()
check_system()
install_dependencies()
print(f"\n[✓] {PROJECT_NAME} v{VERSION} setup complete!")
print("\nQuick Start:")
print(" python3 main.py --help")
print(" python3 main.py quick https://example.com")
print(" python3 main.py full https://example.com")
if __name__ == "__main__":
main()