File size: 7,152 Bytes
53ee5fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
import tkinter as tk
import json
from dotenv import load_dotenv
import customtkinter
import os
from components.dns_recon import DNSRecon
from components.geo import geo_ip_recon
from components.port_scanner import NetworkScanner
from components.jwt import JWTAnalyzer
from components.packet_analysis import PacketAnalysis
from components.subdomain import SubEnum

list_loc = "lists//default.txt"
load_dotenv()
gkey = os.getenv('GEOIP_API_KEY')
akey = os.getenv('OPENAI_API_KEY')
bkey = os.getenv('BARD_API_KEY')
lkey = os.getenv('RUNPOD_API_KEY')
lendpoint = os.getenv('RUNPOD_ENDPOINT_ID')

dns_enum = DNSRecon()
geo_ip = geo_ip_recon()
packet_analysis = PacketAnalysis()
port_scanner = NetworkScanner()
jwt_analyzer = JWTAnalyzer()
sub_recon = SubEnum()

customtkinter.set_appearance_mode("dark")
customtkinter.set_default_color_theme("dark-blue")

root = customtkinter.CTk()
root.title("GVA - GUI")
root.geometry("800x400")

paned_window = tk.PanedWindow(root, orient="horizontal")
paned_window.pack(fill="both", expand=True)
input_frame = customtkinter.CTkFrame(paned_window, width=400)
output_frame = customtkinter.CTkFrame(paned_window, width=400)
paned_window.add(input_frame)
paned_window.add(output_frame)
navigation_frame = customtkinter.CTkFrame(input_frame, width=100)
navigation_frame.pack(side="left", fill="y")


def application(attack, entry2, entry3, entry_ai, entry5):
    try:
        target = entry2.get()
        profile = entry3.get() if entry3 else None
        save_loc = entry5.get() if entry5 else None
        ai_choices = entry_ai.get() if entry_ai else None

        if attack == 'geo':
            geo_output: str = geo_ip_recon.geoip(gkey, target)
            output_save(str(geo_output))
        elif attack == 'nmap':
            p1_out = port_scanner.scanner(
                ip=target,
                profile=int(profile) if profile else None,
                akey=akey,
                bkey=bkey,
                lkey=lkey,
                lendpoint=lendpoint,
                AI=ai_choices
            )
            output_save(p1_out)
        elif attack == 'dns':
            dns_output: str = dns_enum.dns_resolver(
                target=target,
                akey=akey,
                bkey=bkey,
                lkey=lkey,
                lendpoint=lendpoint,
                AI=ai_choices
            )
            output_save(dns_output)
        elif attack == 'sub':
            sub_output: str = sub_recon.sub_enumerator(target, list_loc)
            output_save(sub_output)
        elif attack == 'jwt':
            output: str = jwt_analyzer.analyze(
                token=target,
                openai_api_token=akey,
                bard_api_token=bkey,
                llama_api_token=lkey,
                llama_endpoint=lendpoint,
                AI=ai_choices
            )
            output_save(output)
        elif attack == 'pcap':
            packet_analysis.perform_full_analysis(
                pcap_path=target,
                json_path=save_loc,
            )
            output_save("Done")
    except KeyboardInterrupt:
        print("Keyboard Interrupt detected ...")


def output_save(output: str) -> None:
    if output == "Done":
        output_data = "Status: Successful"
        output_textbox.insert("1.0", output_data)
    else:
        output_textbox.delete("1.0", "end")
        json_data = json.loads(output)
        formatted_json = json.dumps(json_data, indent=2)
        output_textbox.insert("1.0", formatted_json)


def select_frame_by_name(name):
    global frame
    frame.destroy()
    frame = customtkinter.CTkFrame(master=input_frame)
    frame.pack(pady=20, padx=20, fill="both", expand=True)

    label_text = f"GVA System - {name.capitalize()}"
    label = customtkinter.CTkLabel(master=frame, text=label_text)
    label.pack(pady=12, padx=10)

    entry2 = customtkinter.CTkEntry(master=frame, placeholder_text="Target/capfile/token")
    entry2.pack(pady=12, padx=10)

    if name in ["nmap", "dns", "jwt"]:
        ai_choices_val = ["openai", "bard", "llama-api"]
        entry_ai = customtkinter.CTkComboBox(master=frame, values=ai_choices_val, state="readonly")
        entry_ai.set("Select AI Input")
        entry_ai.pack(pady=12, padx=10)
    else:
        entry_ai = None

    entry3 = None
    entry5 = None
    if name == "nmap":
        entry3 = customtkinter.CTkEntry(master=frame, placeholder_text="Profile")
        entry3.pack(pady=12, padx=10)
    elif name == "sub":
        entry3 = customtkinter.CTkEntry(master=frame, placeholder_text="File Location")
        entry3.pack(pady=12, padx=10)
    elif name == "pcap":
        entry5 = customtkinter.CTkEntry(master=frame, placeholder_text="Save Location")
        entry5.pack(pady=12, padx=10)

    button = customtkinter.CTkButton(master=frame, text="Run", command=lambda: application(
        attack=name,
        entry2=entry2,
        entry3=entry3,
        entry_ai=entry_ai,
        entry5=entry5
    ))
    button.pack(pady=12, padx=10)


nmap_button = customtkinter.CTkButton(navigation_frame, text="Nmap", command=lambda: select_frame_by_name("nmap"))
nmap_button.pack(side="top", pady=5, anchor="center")
dns_button = customtkinter.CTkButton(navigation_frame, text="DNS", command=lambda: select_frame_by_name("dns"))
dns_button.pack(side="top", pady=5, anchor="center")
sub_button = customtkinter.CTkButton(navigation_frame, text="Subdomain", command=lambda: select_frame_by_name("sub"))
sub_button.pack(side="top", pady=5, anchor="center")
jwt_button = customtkinter.CTkButton(navigation_frame, text="JWT Analysis", command=lambda: select_frame_by_name("jwt"))
jwt_button.pack(side="top", pady=5, anchor="center")
pcap_button = customtkinter.CTkButton(navigation_frame, text="Pcap Analysis", command=lambda: select_frame_by_name("pcap"))
pcap_button.pack(side="top", pady=5, anchor="center")
geo_button = customtkinter.CTkButton(navigation_frame, text="GeoIP Recon", command=lambda: select_frame_by_name("geo"))
geo_button.pack(side="top", pady=5, anchor="center")

frame = customtkinter.CTkFrame(master=input_frame)
frame.pack(pady=20, padx=20, fill="both", expand=True)
label = customtkinter.CTkLabel(master=frame, text="GVA System")
label.pack(pady=12, padx=10)
entry2 = customtkinter.CTkEntry(master=frame, placeholder_text="Target")
entry2.pack(pady=12, padx=10)
ai_choices = ["openai", "bard", "llama-api"]
entry_ai = customtkinter.CTkComboBox(master=frame, values=ai_choices, state="readonly")
entry_ai.set("Select AI Input")
entry_ai.pack(pady=12, padx=10)
entry3 = customtkinter.CTkEntry(master=frame, placeholder_text="Profile (Only Nmap)")
entry3.pack(pady=12, padx=10)
button = customtkinter.CTkButton(master=frame, text="Run", command=lambda: application("default", entry2, entry3, entry_ai))
button.pack(pady=12, padx=10)
output_textbox = customtkinter.CTkTextbox(master=output_frame, height=800, width=900, corner_radius=0)
output_textbox.pack(pady=12, padx=10)

root.mainloop()