require cryptable to be checked if using shellcode.

This commit is contained in:
KingKDot
2026-05-17 22:14:11 -05:00
parent bab5054b47
commit a91cb0c51f
2 changed files with 41 additions and 2 deletions
+31
View File
@@ -501,9 +501,38 @@ function applyCryptableMode(enabled) {
if (upxC) upxC.classList.add("hidden");
}
updateShellcodeCheckboxVisibility();
saveFormSettings();
}
function applyCryptableShellcodeGate() {
const cryptableOn = !!document.getElementById("cryptable-mode")?.checked;
const setGate = (checkboxId, hintId) => {
const cb = document.getElementById(checkboxId);
const hint = document.getElementById(hintId);
if (!cb) return;
const label = cb.closest("label");
if (cryptableOn) {
cb.disabled = false;
label?.classList.remove("opacity-40", "pointer-events-none");
if (hint) hint.classList.add("hidden");
} else {
if (cb.checked) {
cb.checked = false;
cb.dispatchEvent(new Event("change", { bubbles: true }));
}
cb.disabled = true;
label?.classList.add("opacity-40", "pointer-events-none");
if (hint) hint.classList.remove("hidden");
}
};
setGate("donut-mode", "donut-cryptable-hint");
setGate("linux-shellcode-mode", "linux-sc-cryptable-hint");
}
function updateShellcodeCheckboxVisibility() {
const selected = Array.from(document.querySelectorAll('input[name="platform"]:checked')).map((el) => el.value);
const hasWindows = selected.some((p) => p.startsWith("windows-"));
@@ -515,6 +544,8 @@ function updateShellcodeCheckboxVisibility() {
const linuxScRow = document.getElementById("linux-sc-row");
if (linuxScRow) linuxScRow.classList.toggle("hidden", !hasLinuxAmd64);
applyCryptableShellcodeGate();
// SGN is only meaningful when there's shellcode to encode — i.e. Donut or
// Linux shellcode is enabled on a compatible platform.
const donutOn = document.getElementById("donut-mode")?.checked && hasWindows;
+10 -2
View File
@@ -375,7 +375,7 @@
</div>
<div id="donut-row" class="hidden flex flex-col gap-1">
<label class="flex items-center gap-2 p-3 bg-green-900/20 border border-green-500/30 rounded-lg cursor-pointer hover:border-green-400 transition-colors">
<label class="flex items-center gap-2 p-3 bg-green-900/20 border border-green-500/30 rounded-lg cursor-pointer hover:border-green-400 transition-colors" data-shellcode-label>
<input type="checkbox" id="donut-mode" name="donut-mode" class="w-4 h-4" />
<div class="flex flex-col">
<span class="flex items-center gap-2">
@@ -384,6 +384,10 @@
<span class="text-xs text-slate-500">Convert Windows PE to position-independent shellcode (.bin) via Donut. PE metadata, icon, bound files, UPX, hide-console, UAC, and critical-process are disabled. Persistence uses a two-pass build.</span>
</div>
</label>
<div id="donut-cryptable-hint" class="hidden flex items-center gap-2 px-3 py-1.5 rounded bg-purple-900/30 border border-purple-600/40 text-xs text-purple-300">
<i class="fa-solid fa-lock"></i>
<span>Enable <strong>Cryptable Mode</strong> above to use Donut shellcode.</span>
</div>
<div id="donut-badge" class="hidden pl-3 border-l-2 border-green-500/40 flex flex-col gap-1">
<div class="flex items-center gap-2 px-3 py-1.5 rounded bg-green-900/30 border border-green-600/40 text-xs text-green-300">
<i class="fa-solid fa-circle-check"></i>
@@ -402,7 +406,7 @@
</div>
<div id="linux-sc-row" class="hidden flex flex-col gap-1">
<label class="flex items-center gap-2 p-3 bg-cyan-900/20 border border-cyan-500/30 rounded-lg cursor-pointer hover:border-cyan-400 transition-colors">
<label class="flex items-center gap-2 p-3 bg-cyan-900/20 border border-cyan-500/30 rounded-lg cursor-pointer hover:border-cyan-400 transition-colors" data-shellcode-label>
<input type="checkbox" id="linux-shellcode-mode" name="linux-shellcode-mode" class="w-4 h-4" />
<div class="flex flex-col">
<span class="flex items-center gap-2">
@@ -411,6 +415,10 @@
<span class="text-xs text-slate-500">Wrap Linux amd64 ELF in a position-independent shellcode stub (.bin) using memfd_create + execveat. Bound files and UPX are disabled. Persistence uses a two-pass build.</span>
</div>
</label>
<div id="linux-sc-cryptable-hint" class="hidden flex items-center gap-2 px-3 py-1.5 rounded bg-purple-900/30 border border-purple-600/40 text-xs text-purple-300">
<i class="fa-solid fa-lock"></i>
<span>Enable <strong>Cryptable Mode</strong> above to use Linux shellcode.</span>
</div>
<div id="linux-sc-badge" class="hidden pl-3 border-l-2 border-cyan-500/40 flex flex-col gap-1">
<div class="flex items-center gap-2 px-3 py-1.5 rounded bg-cyan-900/30 border border-cyan-600/40 text-xs text-cyan-300">
<i class="fa-solid fa-circle-check"></i>