-
Notifications
You must be signed in to change notification settings - Fork 2
/
fwvulgui.py
84 lines (77 loc) · 3.54 KB
/
fwvulgui.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.uic import loadUiType
import sys, time, fwvulcode_multi, fwvulcode_single
ui,_=loadUiType('fwvul.ui')
class MainApp(QMainWindow,ui):
def __init__(self):
QMainWindow.__init__(self)
self.title = "Pignus Framework Vulnerability Detector v0.03 by t0xic0der"
self.setupUi(self)
self.handle_elements()
def handle_elements(self):
self.setWindowTitle(self.title)
self.det_boxer.setReadOnly(True)
self.btn_scan_one.clicked.connect(self.fetch_one)
self.btn_scan_mul.clicked.connect(self.fetch_mul)
def fetch_one(self):
url=self.edit_one.text()
try:
self.det_boxer.clear()
start_time=time.time()
result=fwvulcode_single.analyze(url)
end_time=time.time()
total_time = str((end_time - start_time)/60)
time_array=total_time.split(".")
total_time=time_array[0]+"."+time_array[1][0:2]
self.lab_state.setText("Framework data for 1 URL(s) have been scanned successfully!")
content = "Result fetched for "+url+" in "+str(total_time)+" seconds\n\n"
for x in result.items():
content+="Category: "+str(x[0])+"\nFrameworks: "+", ".join(x[1])
content+="\n\n"
self.det_boxer.setPlainText(content)
except:
self.det_boxer.clear()
self.lab_state.setText("Framework data for 1 URL(s) could not be scanned!")
errormsg="The framework data cannot be scanned.\n"+\
"Please check your internet connection and the URL for typos and try again."
self.det_boxer.setPlainText(errormsg)
def fetch_mul(self):
adr=self.edit_mul.text()
try:
self.det_boxer.clear()
start_time=time.time()
result=fwvulcode_multi.main(adr)
end_time=time.time()
total_time = str((end_time - start_time)/60)
time_array=total_time.split(".")
total_time=time_array[0]+"."+time_array[1][0:2]
succ_count,fail_count,data_intel=str(result[0]),str(result[1]),result[2]
self.lab_state.setText("Framework data scan for "+succ_count+" URL(s) were successful and failed for "+fail_count+" URL(s)!")
content="Result fetched for the following URL(s) in "+str(total_time)+" seconds\n\n"
for result in data_intel:
content = content + str(result) + "\n"
for values in data_intel[result]:
content = content + values + ": " + str(data_intel[result][values]) + "\n"
content += "\n"
self.det_boxer.setPlainText(content)
except:
self.det_boxer.clear()
self.lab_state.setText("Framework data for the given URL list could not be scanned!")
errormsg="The framework data cannot be scanned.\n"+\
"Please check your internet connection and the file address for typos and try again."
self.det_boxer.setPlainText(errormsg)
def main():
app=QApplication(sys.argv)
QFontDatabase.addApplicationFont("com-bold.ttf")
QFontDatabase.addApplicationFont("com-lite.ttf")
QFontDatabase.addApplicationFont("com-rlar.ttf")
QFontDatabase.addApplicationFont("rob-bold.ttf")
QFontDatabase.addApplicationFont("rob-lite.ttf")
QFontDatabase.addApplicationFont("rob-rlar.ttf")
window=MainApp()
window.show()
app.exec_()
if __name__ == '__main__':
main()