-
Notifications
You must be signed in to change notification settings - Fork 1
/
oogway.py
64 lines (50 loc) · 2.37 KB
/
oogway.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
52
53
54
55
56
57
58
59
60
61
62
63
64
# Creator : Yasin Saffari ( Symbolexe )
# Date : 2024-04-19
#SHIFU : https://github.com/Symbolexe/SHIFU
#VulnersX : https://github.com/Symbolexe/VulnersX
from shifucvefinder import search_by_cve_id
from vulnersx import VulnersX
def main():
print("Welcome to oogway - Vulnerability Search Tool!")
# Initialize instances of VulnersX and ShifuCVEFinder
vulnersx = VulnersX()
while True:
print("\nChoose an option:")
print("1. Search for vulnerabilities using VulnersX")
print("2. Search for details of one or more CVEs using ShifuCVEFinder")
print("3. Exit")
choice = input("Enter your choice: ")
if choice == "1":
# Search for vulnerabilities using VulnersX
package_name = input("Enter the package name to search for vulnerabilities: ")
after_date = input("Enter the date (YYYY-MM-DD) to search for vulnerabilities after: ")
vulnerabilities = vulnersx.search_vulnerabilities(package_name, after_date)
if vulnerabilities:
print(f"Found {len(vulnerabilities)} vulnerabilities after {after_date} for {package_name}")
for vulnerability in vulnerabilities:
print(vulnerability)
else:
print(f"No vulnerabilities found after {after_date} for {package_name}")
elif choice == "2":
# Search for details of one or more CVEs using ShifuCVEFinder
print("Do you want to enter CVE IDs manually (M) or from a file (F)?")
method = input("Enter M or F: ")
if method.upper() == "M":
cve_ids = input("Enter one or more CVE IDs separated by commas: ").split(',')
elif method.upper() == "F":
file_path = input("Enter the path to the file containing CVE IDs: ")
with open(file_path, 'r') as file:
cve_ids = file.read().splitlines()
else:
print("Invalid input. Please try again.")
continue
for cve_id in cve_ids:
print(f"\nCVE Information for {cve_id}:")
search_by_cve_id(cve_id)
elif choice == "3":
print("Exiting the oogway - Vulnerability Search Tool. Goodbye!")
break
else:
print("Invalid choice. Please try again.")
if __name__ == "__main__":
main()