-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.py
74 lines (58 loc) · 2.32 KB
/
ui.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
import tkinter as tk
from tkinter import ttk
from WebScanner import rce_func, xss_func, error_based_sqli_func, UserAgent
import sys
# Function to capture standard output
class OutputRedirector:
def __init__(self, text_widget):
self.text_widget = text_widget
def write(self, message):
self.text_widget.insert(tk.END, message)
def scan_rce():
url = url_entry.get()
rce_output.delete(1.0, tk.END)
rce_output.insert(tk.END, "Scanning for Remote Code/Command Execution...\n")
# Redirect standard output to the Text widget
sys.stdout = OutputRedirector(rce_output)
rce_func(url, UserAgent)
def scan_xss():
url = url_entry.get()
xss_output.delete(1.0, tk.END)
xss_output.insert(tk.END, "Scanning for XSS...\n")
# Redirect standard output to the Text widget
sys.stdout = OutputRedirector(xss_output)
xss_func(url, UserAgent)
def scan_sqli():
url = url_entry.get()
sqli_output.delete(1.0, tk.END)
sqli_output.insert(tk.END, "Scanning for SQL Injection...\n")
# Redirect standard output to the Text widget
sys.stdout = OutputRedirector(sqli_output)
error_based_sqli_func(url, UserAgent)
# Create the main window
root = tk.Tk()
root.title("Web Vulnerability Scanner")
# Set custom background and foreground colors
root.configure(bg='#2E3B55')
root.option_add('*TButton*background', '#1E90FF') # Set button background color
root.option_add('*TButton*foreground', 'white') # Set button text color
# Create and configure the URL input field
url_label = ttk.Label(root, text="Enter URL:", background='#2E3B55', foreground='white')
url_label.pack()
url_entry = ttk.Entry(root)
url_entry.pack()
# Create scan buttons with custom colors
rce_button = ttk.Button(root, text="Scan RCE", command=scan_rce)
xss_button = ttk.Button(root, text="Scan XSS", command=scan_xss)
sqli_button = ttk.Button(root, text="Scan SQL Injection", command=scan_sqli)
rce_button.pack()
xss_button.pack()
sqli_button.pack()
# Create text output areas with custom colors
rce_output = tk.Text(root, height=10, width=80, background='black', foreground='lime')
xss_output = tk.Text(root, height=10, width=80, background='black', foreground='lime')
sqli_output = tk.Text(root, height=10, width=80, background='black', foreground='lime')
rce_output.pack()
xss_output.pack()
sqli_output.pack()
root.mainloop()