This repository has been archived by the owner on Jun 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
sploitsearch.py
55 lines (49 loc) · 1.91 KB
/
sploitsearch.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
import os
import subprocess
from termcolor import colored
from pyfiglet import Figlet
import json
def check_db():
if not os.path.exists("/usr/share/exploitdb"):
print("[!]Unable to find the database.")
return
return
platforms = ["linux","windows","macos"]
message = input("Platform [{}, all]: ".format(''.join(platforms)).lower())
if message == "all":
return ""
elif message in platforms:
return message
else:
print("[!]Unknown Platform, use all command.")
def main():
print("""
=========================== Searchsploit ===============================
Serchsploit is a CMD tool which is used to search exploits from Offensive
Security Exploit Database.
========================================================================
========================== Enabled Options =============================
j: This returns the info about the exploit in json(Javascript Object Notation)
format.
Platforms: macos, windows, linux
========================================================================
============================== Usgae ===================================
<alfred>searchsploit
Enter Platform: linux (You can leave it blank for all platform search)
Search: Buffer Overflow
=========================================================================
""")
search = check_db()
xploit = search+(input("Search: "))
print("[*]Searchng....")
data = subprocess.check_output("searchsploit -j {}".format(xploit),shell=True)
data = json.loads(data)
print(colored("-"*45+"Exploit"+"-"*45,"yellow"))
for exploit in data["RESULTS_EXPLOIT"]:
print(colored("="*60))
message = ("\nTitle: {Title}"
"\nPlatform: {Platform}"
"\nPath: {Path}"
"\nAuthor: {Author}").format(**exploit)
print(message)
print("-"*60)