HackTheBox October Ovrflw
- by Vince
-
in Blog
-
Hits: 1240
I started playing with the HackTheBox October machine and during my enumeration process, I discovered something and I ended up in a Python rabbit hole. Before I continue, let me say that I'm jumping straight to a spoiler -- so if you're looking for some subtle hints on entry, I'm past that point with respect to the direction of this post. Assuming you've ended up here for some other reason, I'm going straight to to the ovrflw file which is vulnerable to a buffer overflow. If you execute the binary, we see the following:
root@c2:~/hackthebox/October# ./ovrflw
Syntax: ./ovrflw <input string>
If we input a few characters, we get no response. We assume that we can exceed a certain number of characters to get it to crash. With buffer overflows, we want to get the exact byte count of the crash so that we can insert our shell code just after that point. There are any number of ways to get the byte count for this buffer overflow, we could do something like:
root@c2:~/hackthebox/October# ./ovrflw `python -c 'print "A"*112'`
Segmentation fault