Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2003, 15:29
Rhodium
 
Posts: n/a
Creating a buffer overflow ?

As I understand it most buffer overflow exploits must be found by the cracker, and it must be able to influence the target variable once the overflow has occured.

Instead of just finding these overflow exploits, wouldn't it be possible to in fact force the buffer to overflow? i.e, If you somehow were able to manipulate the values of the bounds?

i.e

Quote:
Buffer Overflow: the Basics
A buffer is a contiguous allocated chunk of memory, such as an array or a pointer in C. In C and C++, there are no automatic bounds checking on the buffer, which means a user can write past a buffer. For example:


int main () {
int buffer[10];
buffer[20] = 10;
}

The above C program is a valid program, and every compiler can compile it without any errors. However, the program attempts to write beyond the allocated memory for the buffer, which might result in unexpected behavior. Over the years, some bright people have used only this concept to create havoc in the computer industry. Before we understand how they did it, let's first see what a process looks like in memory.
hxxp://www.linuxjournal.com/article.php?sid=6701

What I'm saying is that when you disassemble the program you should search for where that [10] is assigned in asm, and then change it to a [0]. That way the overflow would always occur.

Of course you probably wouldn't change the asm code, but you could do a live memory hack, like a simple game trainer does to change the [10] to a [0].

Last edited by Rhodium; 08-17-2003 at 15:33.
Reply With Quote
  #2  
Old 08-17-2003, 16:22
Squidge's Avatar
Squidge Squidge is offline
Drunken Squirrel
 
Join Date: Oct 2002
Posts: 412
Rept. Given: 4
Rept. Rcvd 9 Times in 4 Posts
Thanks Given: 0
Thanks Rcvd at 6 Times in 6 Posts
Squidge Reputation: 9
What would be the point of this? Considering the fact that most buffer exploits are doing over the intenet, where you don't have access to the machine to change any of the assembler - you only have the interface of the program that is running.

Secondly, once the program has compiled, trying to change a static buffer size to less than it was orignally set to would be very difficult, as if it was a global variable, it would most likely be a space in the exe, and local variables would simply be space on the stack.
Reply With Quote
  #3  
Old 08-17-2003, 17:07
Rhodium
 
Posts: n/a
Quote:
Originally posted by Squidge
What would be the point of this? Considering the fact that most buffer exploits are doing over the intenet, where you don't have access to the machine to change any of the assembler - you only have the interface of the program that is running.

Secondly, once the program has compiled, trying to change a static buffer size to less than it was orignally set to would be very difficult, as if it was a global variable, it would most likely be a space in the exe, and local variables would simply be space on the stack.
Edit: I mean for patching an RSA key or stuff like that.

Last edited by Rhodium; 08-17-2003 at 17:11.
Reply With Quote
  #4  
Old 08-17-2003, 23:32
Squidge's Avatar
Squidge Squidge is offline
Drunken Squirrel
 
Join Date: Oct 2002
Posts: 412
Rept. Given: 4
Rept. Rcvd 9 Times in 4 Posts
Thanks Given: 0
Thanks Rcvd at 6 Times in 6 Posts
Squidge Reputation: 9
If you want to do that, just write the process memory. No need for buffer overflow exploits.
Reply With Quote
  #5  
Old 08-18-2003, 05:48
Ari Benta
 
Posts: n/a
Hehe, I once thought about this too.
The interesting point would be to find a possible weak point in the serial checking routines of e.g. some RSA 1024 based protection schemes. Then you maybe could break that scheme with a special buffer overflow serial.
Reply With Quote
  #6  
Old 08-19-2003, 01:44
ArC ArC is offline
VIP
 
Join Date: Jan 2003
Location: NTOSKRNL.EXE
Posts: 172
Rept. Given: 0
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 5
Thanks Rcvd at 17 Times in 12 Posts
ArC Reputation: 1
And how do you think is it working?
Reply With Quote
  #7  
Old 08-19-2003, 04:39
Ari Benta
 
Posts: n/a
Yeah, that'll be the difficult part

I actually never tried to find a possible victim, as it's probably impossible, because e.g. GetDlgItemText, etc. all have a parameter that limits the length of text you can enter.
Furthermore, if there was an (easy) way to do, someone would probably have done it already.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ImpRec module User32.dll overwritting buffer overflow KaGra General Discussion 7 04-25-2005 10:33
Buffer Overflow in SentinelLM Service prt General Discussion 0 03-19-2005 05:20
DataRescue Interactive Disassembler Pro Buffer Overflow Vulnerability bukkake General Discussion 0 01-25-2005 11:23


All times are GMT +8. The time now is 09:26.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )