We have an intercepted message containing hidden x86 shellcode. The
challenge is to extract the secret by emulating the code.
The message file contains x86 machine code that, when executed,
pushes characters onto the stack one by one to form the flag. Use the
Unicorn Engine to emulate x86 code and monitor stack
writes:
The hint says brute-force is unnecessary, so this is likely a
file-format trick.
1 2
$ file So_Simple.zip So_Simple.zip: Zip archive data, ...
This challenge uses ZIP pseudo-encryption (the
encrypted flag bit is set even though the entry is not truly encrypted).
That can break normal extraction in some tools.
Method 1: Use a
pseudo-encryption aware tool
unar can extract So_Simple.zip
directly:
1 2 3 4 5
$ unar So_Simple.zip So_Simple.zip: Zip Am_I_key.zip (205 B)... OK. Am_I_key2.txt (4335 B)... OK. Am_I_key3.txt (1445 B)... OK.
Then extract the nested ZIP:
1 2 3 4 5 6 7 8 9 10
$ unar Am_I_key.zip Am_I_key.zip: Zip There_is_key.txt (61 B)... OK.
$ cat There_is_key.txt Isn't it so easy? Take it. dGE1dHlfSDR6M2xudXRfY29mZmVl
You can also fix the ZIP flags in a hex editor (or
radare2) by clearing the encryption bit in the local file
header / central directory entries (0x0908 -> 0x0008 for
relevant records). After patching, standard unzip tools work.
$ fsstat -f fat32 USB_Image\(SuNiNaTaS\) Invalid magic value (Error: sector size (4352) is not a multiple of device size (512) Do you have a disk image instead of a partition image?)
Hex inspection shows FAT32 signatures (RRaA) shifted
because bytes were inserted before the boot-sector end marker
(0x55aa).
2) Repair the FAT32 boot area
I fixed the image in a hex editor (imhex) by aligning
the boot sector so 0x55aa is at offset
0x1fe-0x1ff.
After repair:
1 2 3 4 5 6 7 8
$ fsstat -f fat32 USB_Image\(SuNiNaTaS\) FILE SYSTEM INFORMATION -------------------------------------------- File System Type: FAT32 OEM Name: MSDOS5.0 Volume ID: 0xde96e00a Volume Label (Boot Sector): NO NAME ...
voidentry(void) { .... UVar4 = FUN_00401000(pHVar3); Main function FUN_004012f4(UVar4); Exit function FUN_004013c9(local_18->ExceptionRecord->Except ionCode,local_18); return; }
Create
/etc/systemd/system/docker.service.d/http-proxy.conf with
your proxy settings:
1 2 3 4
[Service] Environment="HTTP_PROXY=http://proxy.example.com:3128" Environment="HTTPS_PROXY=https://proxy.example.com:3129"# if you have https proxy Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"