Member-only story
A Beginner’s Guide to Buffer Overflow Vulnerability
The art of memory exploitation...
Buffer
A Buffer
is temporary storage usually present in the physical memory used to hold data.
Consider the most useless program ever made shown on the left image where a character buffer of length 5 is defined. In a big cluster of memory, a small memory of 5 bytes would be assigned to the buffer which looks like the image on the right.
Buffer Overflow
A Buffer Overflow
occurs when more data is written to a specific length of memory such that adjacent memory addresses are overwritten.
DEMO (Controlling Local Variables):
Let’s take an example of a basic authentication app which asks for a password and returns Authenticated!
if the password is correct.
Without really knowing how the app works, let’s enter a random password.
It says Authentical Declined
since the password wasn’t correct. To test, we need to enter large random data.
You must be wondering why it got authenticated and why there is a Segmentation Fault
…