So let's talk about anatomy of memory so we talk about anatomy a memory.
We have the colonel at the top and we've got text at the bottom.
So if you think of your Colonel think of your command line you can also think about this is a bunch
of ones and your text you can think about as you read only code and you could think about that as a
bunch of zeros.
So this is only for informational purposes but we can also call this the Colonel the top the text the
bottom where we're really going to be focused on though is gonna be the stack.
So if we dive into this memory here and we dive even deeper and we go into the stack.
It's kind of similar.
So we have these registers here and I'll provide links down below on how to brush up on some of these
registers if you're not familiar.
But the important things what we need to know for this lesson is that you have the ISP you have your
buffer space your EVP and your e IP.
So we can think about this again as the ISP sitting at the top and the EVP sitting as the bottom.
So what happens is you have this buffer space in this buffer space fills up with characters.
So the buffer space is going to go downward.
What should happen is if you're properly sanitizing your buffer space then if you send a bunch of characters
at it say a bunch of A's for example like this you should reach the EVP but stop the buffer space should
be able to contain the characters that you're sending.
Now however if you have a buffer overflow attack then you actually overflow the buffer space you're
using and reach over the EVP and into something called the E IP.
Now the IP is where things get interesting.
This is a pointer address or a return address.
So what we can do is we can use this address to point to directions that we instruct.
Now these directions are actually going to be malicious code that gives a server shell.
So we're going to learn that later on in future videos as we go step by step.
So this doesn't have to seem very logical right now.
You just have to very very base level understand that what's happening in the stack is that you're overflowing
buffer space.
So if you can write over the buffer space and write down all the way to the VIP you can control the
stack and you can control the pointer and eventually you can have a reverse shell which will lead to
root.
So it's going to make a lot more sense when we dive in a hands on this just as more of a theoretical
thing so let's talk about really quick the steps to conduct a buffer overflow so the first step are
going to cover is called spiking.
So spiking is going to be a method that we use to find a vulnerable part of a program.
Once we find the vulnerable part of the program we're going to fuzzing which is kind of similar to spiking.
So fuzzy we're going to send a bunch of characters at a program and see if we can break it if we do
break it.
We want to find out at what point we can.
We did break it.
Right.
So we want to find something called the offset and we use that offset to overwrite the IP that pointer
address that we're talking about once we have the IP controlled.
We need to do a few house cleanup things one is called Finding bad characters.
The other is called Finding the right module.
This doesn't need to make sense right now but once we do that and we have this information from 75 to
six we can generate shell code this malicious show code that will allow us to get this reversed shell.
So we're gonna use that.
We're going to point that e IP to our malicious shell code and hopefully we're gonna gain root.
So again this will all make sense as we dive into the future videos and we get hands on.
So if you look at these videos these are the videos that are going to come.
So our next video is going to be on spiking.
Second one is going to be on fuzzing and so on.
So if you have trouble with one area in particular you can watch that area specifically and not have
to look through a long video and hopefully break this down into little nuggets.