Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Hunting for buffer overflows

Name: Assmaster Deluxe 2012-06-03 18:33

Is there a way to use a debugger (immunity preferably but I'll take gdb or any other debugger you know how to do this with) so that any time a piece of memory holds a particular value (say AAAAAAAA) the debugger will make a note of what line it happened and then continue on until it fully crashes.

Not just a simple watch but anytime any register or memory in use by the program contains an A to make a notation of this.  It seems like a really good idea that would take some of the hard work out of exploit development but I have yet to see any straightforward talk of this.

Name: Anonymous 2012-06-03 18:36

valgrind might

Name: Assmaster Deluxe 2012-06-03 18:39

>>2
Lol dude I think they all might it seems like a really useful feature for all sorts of super-lazy debugging but I don't see any mention of it.   My developer vocabulary might just not be rich enough to form the proper google searches.

Name: Anonymous 2012-06-03 19:06

>>1
SYNTAX ERROR: LINE 1: UNTERMINATED PARENTHESIS

Name: Anonymous 2012-06-03 19:09

You'll have to modify something like Bochs or other CPU emulator to catch all memory and register writes. It will be *very* slow.

Name: Anonymous 2012-06-03 20:02

>>5
Ahh ok I think that the bochs debugger is supposed to be scriptable.  Since you were able to answer this with so much certainty and because this feature doesn't seem to already exist I have to assume this is because of the way debuggers work.

Well I guess now it's just a toss up between writing some sort of script that goes through the entire memory space and sets watches or scripting the bochs debugger (which I suspect will have a steeper learning curve), slowness isn't a factor since this will allow automated fuzzing with a great deal of the work already done for me I can just queue a bunch of software up on a box somewhere and check the results whenever I'm motivated and have the time to try and crack something.

Name: Anonymous 2012-06-03 22:57

>>5
it would be slow, but probably not much slower than valgrind, which is able to detect writes to memory not reserved with a call to malloc, for example.

>>6
I think I would try to use asserts to catch what you are looking for. Or add an equality check to this memory address, and log operations on it. If the value is being changed due to a memory error, it might not be entirely meaningful to know what is setting that value to AAA. The actual error that was responsible might have already happened, and you'd have to continue to back track. Reverse code execution sounds like it could be helpful here, but even then the error might be really far back.

Name: Anonymous 2012-06-04 9:19

>>7
I'm trying fuzz out security problems so asserts won't do it.

Name: Anonymous 2012-06-04 9:35

Store everything in memory mapped file and step through in debugger , grepping file at every step

Name: Anonymous 2012-06-04 9:53

but bochs is so fucking slooooow

Name: Anonymous 2012-06-04 10:21

>>10
How do you think cpu emulators work?

Name: Anonymous 2012-06-04 14:16

>>11
bochs is much more than an emulator, that's why it is so slow, if you are running the same architecture and don't need to step around then why oh why bochs!

Name: Anonymous 2012-06-04 17:27

>>9
Good idea
>>7
The idea being that I feed crap information like 5000 A's and see where in memory those A's end up and then who tries to read or execute those A's

Then I consider the implications of being able to write into that memory

Then I use a unique pattern of the same size to identify which As were getting spewed around in memory.

Name: Anonymous 2012-06-06 11:28

Name: Anonymous 2012-06-06 23:44

>>13
oh, you's just trying to hax an ani aint you.

Don't change these.
Name: Email:
Entire Thread Thread List