fix reflective injection 0xc5 errors (c5 reference) and then add sgn and windows shellcode building.

This commit is contained in:
KingKDot
2026-05-17 13:11:21 -05:00
parent f53b1cf2c8
commit c499b76227
12 changed files with 412 additions and 20 deletions
+47 -1
View File
@@ -151,6 +151,8 @@ function collectFormSettings() {
useDonut: document.getElementById("donut-mode")?.checked ?? false,
useLinuxShellcode: document.getElementById("linux-shellcode-mode")?.checked ?? false,
shellcodeConsole: document.getElementById("shellcode-console")?.checked ?? false,
useSgn: document.getElementById("sgn-mode")?.checked ?? false,
sgnIterations: parseInt(document.getElementById("sgn-iterations")?.value, 10) || 1,
};
}
@@ -220,6 +222,11 @@ function applyFormSettings(settings) {
if (settings.useLinuxShellcode) applyLinuxShellcodeMode(true);
}
if (settings.shellcodeConsole !== undefined) setCb("#shellcode-console", settings.shellcodeConsole);
if (settings.useSgn !== undefined) {
setCb("#sgn-mode", settings.useSgn);
if (settings.useSgn) applySgnMode(true);
}
if (settings.sgnIterations !== undefined) setVal("sgn-iterations", settings.sgnIterations);
const restoredObfuscate = document.querySelector('input[name="obfuscate"]');
const garbleContainer = document.getElementById("garble-settings-container");
@@ -494,6 +501,26 @@ function updateShellcodeCheckboxVisibility() {
const linuxScRow = document.getElementById("linux-sc-row");
if (linuxScRow) linuxScRow.classList.toggle("hidden", !hasLinuxAmd64);
// 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;
const linuxScOn = document.getElementById("linux-shellcode-mode")?.checked && hasLinuxAmd64;
const sgnRow = document.getElementById("sgn-row");
if (sgnRow) sgnRow.classList.toggle("hidden", !(donutOn || linuxScOn));
if (!(donutOn || linuxScOn)) {
const sgnCheckbox = document.getElementById("sgn-mode");
if (sgnCheckbox?.checked) {
sgnCheckbox.checked = false;
applySgnMode(false);
}
}
}
function applySgnMode(enabled) {
const badge = document.getElementById("sgn-badge");
if (badge) badge.classList.toggle("hidden", !enabled);
saveFormSettings();
}
function applyDonutMode(enabled) {
@@ -726,10 +753,27 @@ if (donutCheckbox) {
const linuxScCheckbox = document.getElementById("linux-shellcode-mode");
if (linuxScCheckbox) {
linuxScCheckbox.addEventListener("change", () => { applyLinuxShellcodeMode(linuxScCheckbox.checked); });
linuxScCheckbox.addEventListener("change", () => {
applyLinuxShellcodeMode(linuxScCheckbox.checked);
updateShellcodeCheckboxVisibility();
});
if (linuxScCheckbox.checked) applyLinuxShellcodeMode(true);
}
if (donutCheckbox) {
donutCheckbox.addEventListener("change", () => updateShellcodeCheckboxVisibility());
}
const sgnCheckbox = document.getElementById("sgn-mode");
if (sgnCheckbox) {
sgnCheckbox.addEventListener("change", () => applySgnMode(sgnCheckbox.checked));
if (sgnCheckbox.checked) applySgnMode(true);
}
const sgnIterationsInput = document.getElementById("sgn-iterations");
if (sgnIterationsInput) {
sgnIterationsInput.addEventListener("change", () => saveFormSettings());
}
document.querySelectorAll('input[name="platform"]').forEach((el) => {
el.addEventListener("change", () => {
updateShellcodeCheckboxVisibility();
@@ -1482,6 +1526,8 @@ form?.addEventListener("submit", async (e) => {
useDonut: document.getElementById("donut-mode")?.checked || false,
useLinuxShellcode: document.getElementById("linux-shellcode-mode")?.checked || false,
shellcodeConsole: document.getElementById("shellcode-console")?.checked || false,
useSgn: document.getElementById("sgn-mode")?.checked || false,
sgnIterations: parseInt(document.getElementById("sgn-iterations")?.value, 10) || 1,
};
const hasAndroid = platforms.some(p => p.startsWith('android-'));
+24
View File
@@ -414,6 +414,30 @@
</div>
</div>
<div id="sgn-row" class="hidden flex flex-col gap-1">
<label class="flex items-center gap-2 p-3 bg-fuchsia-900/20 border border-fuchsia-500/30 rounded-lg cursor-pointer hover:border-fuchsia-400 transition-colors">
<input type="checkbox" id="sgn-mode" name="sgn-mode" class="w-4 h-4" />
<div class="flex flex-col">
<span class="flex items-center gap-2">
<i class="fa-solid fa-shuffle text-fuchsia-400"></i> SGN Polymorphic Encoding
</span>
<span class="text-xs text-slate-500">Apply Shikata Ga Nai polymorphic XOR encoding to the raw shellcode after Donut / Linux shellcode wrap. Each iteration adds a fresh decoder + re-encodes — higher = better evasion, larger output.</span>
</div>
</label>
<div id="sgn-badge" class="hidden pl-3 border-l-2 border-fuchsia-500/40 flex flex-col gap-1">
<div class="flex items-center gap-2 px-3 py-1.5 rounded bg-fuchsia-900/30 border border-fuchsia-600/40 text-xs text-fuchsia-300">
<i class="fa-solid fa-circle-check"></i>
<span>SGN active — shellcode will be polymorphically encoded</span>
</div>
<label class="flex items-center gap-2 px-3 py-1.5 rounded bg-slate-800/60 border border-slate-600/40 text-xs text-slate-300">
<i class="fa-solid fa-repeat text-slate-400"></i>
<span>Iterations</span>
<input type="number" id="sgn-iterations" name="sgn-iterations" min="1" max="50" value="1" class="w-16 px-2 py-0.5 bg-slate-900 border border-slate-600 rounded text-slate-200 text-xs" />
<span class="text-slate-500">(1–50)</span>
</label>
</div>
</div>
</div>
</div>
</div>