|
| 1 | +from tkinter import Tk |
| 2 | +from tkinter.filedialog import askdirectory |
| 3 | +import os |
| 4 | + |
| 5 | +rcr = open(".searchsploit_rc", "r").read().splitlines() |
| 6 | +print(rcr) |
| 7 | + |
| 8 | +if input("Do you want to connect to the exploit database exploits? [Y/n]: ") == "Y": |
| 9 | + print("Please select the location of the exploit database") |
| 10 | + Tk().withdraw() |
| 11 | + edbexploits = askdirectory() |
| 12 | + print(edbexploits) |
| 13 | + if os.path.exists(edbexploits): |
| 14 | + rcr[6] = 'path_array+=("' + edbexploits + '")' |
| 15 | + rcr[14] = 'path_array+=("' + edbexploits + '")' |
| 16 | + |
| 17 | +if input("Do you want to connect to the exploit database papers? [Y/n]: ") == "Y": |
| 18 | + print("Please select the location of the exploit database papers") |
| 19 | + Tk().withdraw() |
| 20 | + temp = askdirectory() |
| 21 | + print(temp) |
| 22 | + if os.path.exists(temp): |
| 23 | + rcr[22] = 'path_array+=("' + temp + '")' |
| 24 | + |
| 25 | +# installing settings files in locations |
| 26 | +rc = "\n".join(rcr) |
| 27 | +if os.sys.platform == "win32": |
| 28 | + open(os.getenv("userprofile").replace( |
| 29 | + "\\", "/") + "/.searchsploit_rc", "w").write(rc) |
| 30 | + batch = open("searchsploit.bat", "r").readlines() |
| 31 | + batch[1] = 'set pythonscript = "' + os.getcwd() + '"' |
| 32 | + batch = "\n".join(batch) |
| 33 | + open("searchsploit.bat", "w").write(batch) |
| 34 | +else: |
| 35 | + try: |
| 36 | + open("/etc/.searchsploit_rc", "w").write(rc) |
| 37 | + except: |
| 38 | + open(os.path.expanduser("~").replace("\\", "/") + |
| 39 | + "/.searchsploit_rc", "w").write(rc) |
| 40 | + |
| 41 | +print("Install complete. you may now use searchsploit freely") |
| 42 | +if os.sys.platform == "win32": |
| 43 | + print("Take your batch script and move it to some place that youll use it.") |
| 44 | +print("This script may need to be ran again if the contents in this folder move or if any databases move from their origional spots.") |
0 commit comments