Debugging malware provides a dynamic and interactive approach to code analysis, offering a real-time view of its behavior. By combining code analysis with debugging tools like x64dbg, analysts can gain a deeper understanding of malware operations and effectively expose harmful behavior.

Here's how to run a sample within x64dbg to familiarize with its operations.

image.png

Reproduce all the debugging procedures mentioned in this section and provide the hidden shellcode-related hex values from the final screenshot as your answer. Remove all spaces.

First of all, we open IDA on shell.exe, to extract the address of cmp instruction, to find the address, let's revert to the IDA windows, open the first function we had renamed as assumed_Main, and look for the cmp instruction.

To bypass the "Sandbox Detected" trigger, make the following changes:

image.png

Modify cmp dword ptr ss:[rsp+0x30], 0x1 to cmp dword ptr ss:[rsp+0x30], 0x0. This change adjusts the comparison to look for a different value, potentially avoiding sandbox detection.

image.png

Change je shell.402F09 to jne shell.402F09. Switching from je (jump if equal) to jne (jump if not equal) alters the control flow, bypassing a condition that could lead to sandbox detection.

image.png

Update jne shell.402CD0 to jmp shell.402CD0. This unconditional jump (jmp) removes the conditional check, directly proceeding to the specified address and further reducing detection risk.