-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgui.py
68 lines (58 loc) · 2.4 KB
/
gui.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
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QLineEdit, QPushButton, QTextEdit, QVBoxLayout, QWidget
from PyQt5.QtGui import QPalette, QColor
from PyQt5.QtCore import Qt
class VulnerabilityScannerGUI(QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setWindowTitle('Vulnerability Scanner')
self.setGeometry(100, 100, 800, 600)
# Set theme colors
self.setTheme()
# Create widgets
self.url_label = QLabel('Enter URL:')
self.url_input = QLineEdit()
self.scan_button = QPushButton('Start Scan')
self.results_area = QTextEdit()
self.results_area.setReadOnly(True)
# Connect button to scan function
self.scan_button.clicked.connect(self.start_scan)
# Layout
layout = QVBoxLayout()
layout.addWidget(self.url_label)
layout.addWidget(self.url_input)
layout.addWidget(self.scan_button)
layout.addWidget(self.results_area)
container = QWidget()
container.setLayout(layout)
self.setCentralWidget(container)
def setTheme(self):
palette = QPalette()
palette.setColor(QPalette.Window, QColor(45, 45, 45))
palette.setColor(QPalette.WindowText, Qt.white)
palette.setColor(QPalette.Base, QColor(30, 30, 30))
palette.setColor(QPalette.AlternateBase, QColor(45, 45, 45))
palette.setColor(QPalette.ToolTipBase, Qt.white)
palette.setColor(QPalette.ToolTipText, Qt.white)
palette.setColor(QPalette.Text, Qt.white)
palette.setColor(QPalette.Button, QColor(45, 45, 45))
palette.setColor(QPalette.ButtonText, Qt.white)
palette.setColor(QPalette.BrightText, Qt.red)
palette.setColor(QPalette.Highlight, QColor(100, 100, 150).lighter())
palette.setColor(QPalette.HighlightedText, Qt.black)
self.setPalette(palette)
def start_scan(self):
url = self.url_input.text()
if url:
self.results_area.append(f'Scanning {url}...')
# Call your existing scanning function here and display the results
# For example:
# results = run_vulnerability_scan(url)
# self.results_area.append(results)
if __name__ == '__main__':
app = QApplication(sys.argv)
gui = VulnerabilityScannerGUI()
gui.show()
sys.exit(app.exec_())