Log in

View Full Version : how I find Overflow?


bjn
November 24th, 2005, 19:36
how I find Buffer Overflow Or Stack Overflow with ollydbg?

Mad_guy
November 25th, 2005, 04:36
Look for vulnerable functions and loop constructs. Functions like gets, scanf, strcpy, sprintf, strcat, etc. etc.

bjn
November 26th, 2005, 14:06
I do this but i don't know how to put data in the vulnerable functions with the software.

example:
i found the function strcpy but i don't know how to get to the function with put data in the software.

Mad_guy
November 26th, 2005, 22:53
This won't always be exploitable so you should know that.

What I'd do is find the parameters to the function and set breakpoints on them, this way when they're accessed in any way, you'll know via the debugger. I'd also set a break on that strcpy call and analyze the memory dump to see if it has any direct correlation to any previous input you might have given the program (for example, if it breaks when the program accesses some data you give it then you have a high probability of finding this vuln, say you give the program AABBCC, then when the strcpy call is made and it breaks, look in the memory dump where the strings are stored and if you see a 414142424343 as a parameter to the strcpy call there is an even higher chance of it being exploitable.) Some strcpy calls will not use user input and therefore in a lot of situations they will not be exploitable, so you will have to find a better way to do things.

I suggest you not stop analyzing your program there, however. Be sure to look for format strings and heap overflows as well.