OK so now we're going to talk about finding bad characters when we talk about finding bad characters
we're talking about this in relation to generating show code when we generate show code.
We need to know what characters are good for the show code and what characters are bad for the show
code.
We can do that by running all the hex characters through our program and seeing if any of them act up
by default.
The no bite act 0 0 acts up.
So we're gonna take a look at what these look like and if any of these bad characters act up in our
program.
So let's go ahead and actually go out to Internet Explorer or Firefox in Cali and what we're gonna do
is I just google bad chars.
So what we're going to look for is this first bulb Security dot com link and it's already got it put
out for us here
so we're looking for is just to copy and paste this variable here.
The bad chars variable a copy this guy and then what we're gonna do is we're gonna go ahead and just
get it.
The last python script to worked on for me that was to stop pi could be whatever you named your script
and if you recall we had just overwritten the IP with four B.
So we're just going to add onto that.
So I'm just going to hit enter twice here and then hit paste and remember we talked about the node by
this x 0 0 being bad I'm going to go ahead and just delete that anyways so we don't even have to run
it through our program.
So when we're talking about bad characters what we do here is we run every single character in hex through
it right.
So we got 1 2 3 4 5 6 7 9 0 0 B's or C etc. all the way to x f f down here.
So some programs have characters just let's make something up for example say X 70.
It may be some command that runs in the program that tells you to do something right.
So we don't want to use x 70 in our generating of Shoko because then the show code is going to break
if it uses this X 70.
So what we do is we pass all of these through the program and we see what looks funny.
Basically it's an eye test.
So what we're gonna do is we're gonna go ahead and save this.
Actually we need to add one more thing.
I apologize.
We're gonna add the bad chars here after the E IP and then we're gonna save this and then again if you're
creating a new file make sure you change your mode of course make sure that you have your immunity running
and you have own server attached.
So what we're gonna do now is we're gonna fire this off.
It should break the program no big deal.
Okay.
Comes through.
We see again we've got a bunch of 40 twos here.
But what we're really interested in is the hex up so we can look at that dump this way we could say
at the ISP right click and say Follow and dump OK.
If you look here let me try to make this bigger.
If you want to make it bigger you can actually go into the text or the appearance I apologize and you
could say the font to OEM I believe is the biggest OK.
And I'll try to pull this up a little bit so it looks bigger here.
So what we're gonna do then is we're going to look at this hex dump here and if this is small I apologize.
So what we're doing is we're saying OK I sent x 0 1 so we're expecting a one two three four five six
seven eight nine then we expect 0 8 0 0 C0 D or easier or F ten eleven twelve thirteen fourteen etc.
We go through this whole list.
Right.
Remember the last thing we sent was f f so we're looking for f f down here we go to every single thing
and we see if there's anything out of place now heads up there's nothing out of place here.
Volts ever was made to be very easy very straightforward.
So there are no bad characters but if there were a bad character it would be out of place would not
make sense.
Like for example if you're reading through and you see ten eleven and then 12 was missing and then it
goes to 13 okay it's likely that twelve is a bad character.
Now to make more sense of this I do have bad characters pulled up.
Let's take a look at this so I've got this dump here instead so if we look we've got 0 1 0 2 0 3 0 0
0 6 0 7 0 8.
OK.
So right away we're missing 4 and 5.
Right.
So we can identify those as bad characters.
And what about the rest.
So if we keep going through here and we keep looking for these B zeros which is how it's identifying
that we know that those are bad characters.
Now I will say that it's not going to always be B zero that shows up is just going to be something that's
out of place.
And this is definitely an eye test that you're going to have to run through when you do buffer overflows
and you're gonna have to make sure you find everything I have in the past missed one bad character generated
my show code and pulled my hair out for 30 minutes to an hour looking at why it was not working.
So if you want to look at this and practice go ahead you go positive video see if you can identify the
rest of the bad characters here but if not I'll identify them for you.
It's these guys.
Right.
So what you would do is you would write all of these down.
You would say OK I'm missing zero for I'm missing zero five I'm missing twenty eight over here I'm missing
twenty nine missing forty four forty five etc..
Right.
So you want to make sure you know take all of these down because when we generate show code in a couple
of videos you're gonna have to remember all of these.
But again lucky for us the only thing we're gonna have to take out and we generate show code is that
no bite which we took out here or else we'd see it start with zero zero.
So we're gonna go onto the next video now and that's going to be called Finding the right module.
And then after that will generate our show code and gain root.