Everybody and welcome to the second to last video on memory.
Now in this video we're going to be talking about some of the miscellaneous stuff around the memory.
The first thing is I want to go over is right about memory.
So when an OS starts and when an application starts there are sections or regions of memory that you
are freely able to write to.
Now this is most commonly like I said the stack the heap in some parts of the data.
The DOT data segment or the dot text segment.
This is normally identified per application.
There's also the kernel will have its own rateable space that is accessible to it as well when creating
exploits under it.
It's good to understand what's marked as readable and what's what's not right.
Because if you start if you do a buffer overflowing you overflow into a region of memory that is not
readable you are not going to be able to do much with it.
And that's more important around the executable which will go over and a little bit now not readable.
Again this is just memory addresses that you don't have access to right to.
These are read only memory locations.
Normally this is identified when the application is compiled.
So sections of memory that it wants to keep safe.
So for example most of the text segment is not or the code actually sits as normally not rateable.
You don't want to send somebody else to rewrite overtop of memory addresses for the application.
This is done and helps protect against exploits and again if you if you try to write to a non readable
memory you'll get you'll get the error in your debugger which will go over in its own video you'll get
the error attempted to write to read only memory understand the two here.
It's important to be able to understand the difference between the two.
So when you run into this particular error you will know what it means and then you've there's a lot
of different ways to get around explaining a target or an application that allows that is that puts
you right into a non readable memory location a lot of times you just have to find a different spot
to write the memory to whether that's sending a new request like for a web service like sending a new
web request with the user agent different and then doing something called a hunter to look for that
memory that you injected in so there's we'll go over that in the in its own course on exploitation which
should be released it could be released now depending on when you're watching this video.
But for anybody who's new when this is fresh it's it's it's not currently built yet it's in the process
of it now then we have executable memory.
Now this is important because when EA IP jumps through memory addresses and it executes what's in there
those memory addresses have to be executable.
Now this is most common in the text encode segment of the binary because the code segment has to actually
be executable you have to execute the code.
This makes things like exploitation building a stable exploit a little bit easier when you're actually
able to exploit what you need to.
Again if you run into non executable spaces you need to be able to know how to research that and get
around it.
Which brings us to our last one which is are not ex casual memory.
This is normally done something called PSP or executable space protection but is also known on the Windows
side as DEP DEP or data execution prevention.
Now this is an important aspect because most windows machines are going to have this enabled.
This marks specifically original memory.
That is not executable.
So if we were to have an overflow into this due to a vulnerability we found we couldn't execute the
code which leaves us to there's there's ways to bypass step.
I'm not going to go through that in this tutorial in our exploitation course we will go over how to
bypass.