-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.py
More file actions
131 lines (100 loc) · 3.75 KB
/
Copy pathinstall.py
File metadata and controls
131 lines (100 loc) · 3.75 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
#!/usr/bin/env python3
"""
Installation script for AI-Powered Penetration Testing Agent
"""
import os
import sys
import subprocess
import shutil
from pathlib import Path
def create_directories():
"""Create necessary directories"""
directories = [
"data",
"logs",
"reports",
"models",
"config"
]
for directory in directories:
Path(directory).mkdir(exist_ok=True)
print(f"✓ Created directory: {directory}")
def install_dependencies():
"""Install Python dependencies"""
print("Installing Python dependencies...")
try:
print("Installing core dependencies...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements_simple.txt"])
print("✓ Core dependencies installed successfully")
try:
print("Installing additional dependencies...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
print("✓ All dependencies installed successfully")
except subprocess.CalledProcessError:
print("⚠️ Some optional dependencies failed to install, but core functionality is available")
except subprocess.CalledProcessError as e:
print(f"✗ Failed to install core dependencies: {e}")
return False
return True
def setup_configuration():
"""Set up configuration files"""
print("Setting up configuration...")
if not os.path.exists("config/config.yaml"):
print("✓ Configuration file already exists")
else:
print("✓ Configuration file found")
return True
def verify_installation():
"""Verify the installation"""
print("Verifying installation...")
try:
import core.agent
print("✓ Core agent module imported successfully")
except ImportError as e:
print(f"✗ Failed to import core agent: {e}")
return False
try:
import modules.reconnaissance.recon_engine
print("✓ Reconnaissance module imported successfully")
except ImportError as e:
print(f"✗ Failed to import reconnaissance module: {e}")
return False
try:
import ai.rl_agent.rl_agent
print("✓ AI RL agent module imported successfully")
except ImportError as e:
print(f"✗ Failed to import AI RL agent: {e}")
return False
return True
def main():
"""Main installation function"""
print("=" * 60)
print("AI-Powered Penetration Testing Agent - Installation")
print("=" * 60)
print("\n1. Creating directories...")
create_directories()
print("\n2. Installing dependencies...")
if not install_dependencies():
print("Installation failed at dependency installation step")
sys.exit(1)
print("\n3. Setting up configuration...")
if not setup_configuration():
print("Installation failed at configuration setup step")
sys.exit(1)
print("\n4. Verifying installation...")
if not verify_installation():
print("Installation verification failed")
sys.exit(1)
print("\n" + "=" * 60)
print("✓ Installation completed successfully!")
print("=" * 60)
print("\nNext steps:")
print("1. Review and edit config/config.yaml for your settings")
print("2. Run: python example_usage.py to test the system")
print("3. Read README.md for detailed usage instructions")
print("\n⚠️ IMPORTANT REMINDER:")
print("This tool is for authorized security testing only.")
print("Only test systems you own or have explicit permission to test.")
print("Comply with all applicable laws and regulations.")
if __name__ == "__main__":
main()