Search Engine
Last updated
Was this helpful?
Last updated
Was this helpful?
the executable is not stripped which makes reverse engeneering easier because it doesnt hide function names and the executable is dynamically linked so the libc library which contains many external functions like fprintf() are not loaded within the executable but they dynamically linked at the execution time
we have two security configuration enabled.
PIE Position Independent Executable
which means that every time you run the file it gets loaded into a different memory address. This means you cannot hardcode values such as function addresses and gadget locations without finding out where they are. But this does not mean it's impossible to exploit
No-Execute
also known as Data Execution Prevention or DEP
marks certain areas of the program as not executable, meaning that stored input or data cannot be executed as code. This is significant because it prevents attackers from being able to jump to custom shellcode that they've stored on the stack or in a global variable.
when we run the binary it asks to search for something and when i inputed google it reflected it in the last line so it maybe vulnerable to format string vulnerability let's check it using ghidra
and it's actually vulnerable to printf format string vulnerability
and now let's create a fuzzer script to leak 100 addresses from the stack
let's run this script and we can see that 10 to 14 contains ascii values but they are in little endianne so we have to decode them and reverse them
we will modify the script to fuzz only the values from 10 to 14 and decode, reverse each one of them, then add them together
let's run this script and we have obtained the flag locally
to do this remotly change
p = process()
to p = remote(host, port)
and also the position of the ascii strings is not the same as the local one try to fuzz 100 addresses you will find that the ascii strings are in the range 12 to 15
so this will be the script for the remote server
run this script and u will get the remote flag
Greetings from Sayonara