-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheck_requirements.py
51 lines (45 loc) · 1.65 KB
/
check_requirements.py
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
import importlib
import subprocess
def check_requirements():
python_libraries = {
'beautifulsoup4': 'bs4',
'colorama': 'colorama',
'prettytable': 'prettytable',
'requests': 'requests',
'tqdm': 'tqdm',
'arjun': 'arjun'
}
tools = {
'curl': 'curl',
'nmap': 'nmap',
'nikto': 'nikto',
'openssl': 'openssl',
'searchsploit': 'searchsploit',
'wafw00f': 'wafw00f',
'whatweb': 'whatweb',
'waybackurls': 'waybackurls',
'sqlmap': 'sqlmap',
'dirb': 'dirb',
'ffuf': 'ffuf',
'arjun': 'arjun'
}
print("Checking Python libraries...")
with open("requirement.txt", "r") as req_file:
requirements = req_file.readlines()
for library in requirements:
library = library.strip()
try:
importlib.import_module(python_libraries[library])
print(f"[+] {library} is installed")
except ImportError:
print(f"[-] {library} is not installed. Please install with 'pip install {library}'")
print("\nChecking tools...")
for tool in tools:
result = subprocess.run(['which', tools[tool]], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if result.stdout:
print(f"[+] {tool} is installed")
else:
print(f"[-] {tool} is not installed. Please install with your package manager, e.g., 'sudo apt install {tool}' or 'brew install {tool}'")
print("\nPlease ensure all required Python libraries and tools are installed before running the script.")
if __name__ == "__main__":
check_requirements()