ACS 2023: Shellcoding Test
Attempting to cheat the syscall table?
TL;DR
Restricted shellcode challenge with bypassable SECCOMP filter via a Time-based Side Channel Attack.
Challenge Overview
Shellcoding Test is the continuation of Coding Test from the preliminary round. Once again, we can write any shellcode to an allocated buffer.

However, the SECCOMP rules enforced are much more restricted this time. As we are not allowed to execute any syscalls, we are left with a Time-based Side Channel Attack to brute force each flag character.

To mount this attack, we'll need to know exactly where the flag is loaded. Inspecting this in GDB, we realized that the flag is 8 bytes away from rsp.

Solution 1: Character Brute Forcing
In our solve script, we'll specify 2 loops - An outer loop that iterates N times (where N = flag length) to control the flag index that we are trying to brute force; and an inner loop that iterates all printable ASCII characters. Since we do not know the flag length, we'll just give N a large value for now.
The shellcode required for this character brute forcing approach is fairly straightforward to code in assembly language, but comes with a huge penalty in terms of time complexity. It takes approximately 5 minutes to get the entire flag right.

Flag: ACS{5h311c0d!ng_73s7_@ppr0v3d}
Final Script
Solution 2: Bit Brute Forcing
A more optimized and faster way to do this is by granularize it down to the bit level. This way, we will only have to brute force 8 bits for each character (8 comparisons per character) instead of iterating through all ASCII printable characters like Solution 1.

Flag: ACS{5h311c0d!ng_73s7_@ppr0v3d}
Final Script
Last updated