Sinisterly
Buffer overflow on a vulnerable C program. - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Hacking (https://sinister.ly/Forum-Hacking)
+--- Forum: Tutorials (https://sinister.ly/Forum-Tutorials)
+--- Thread: Buffer overflow on a vulnerable C program. (/Thread-Buffer-overflow-on-a-vulnerable-C-program)

Pages: 1 2 3 4


RE: Buffer overflow on a vulnerable C program. - lady_godiva - 07-24-2013

That could be a little bit confusing to tell the truth Smile The explanaition should be about the C gets() vulnerable function


RE: Buffer overflow on a vulnerable C program. - noize - 07-24-2013

(07-24-2013, 04:41 PM)lady_godiva Wrote: That could be a little bit confusing to tell the truth Smile The explanaition should be about the C gets() vulnerable function

Confusing? I can't see what you mean. I think it might be confusing the other way. The exploit code in the end is Perl (or some less-known language very similar to Perl, more probably Perl), but 'cause of the syntactical similarity between Perl and PHP and fed by the PHP tags and the fact that PHP is better widely known by people not knowing PHP nor Perl, that code might look like a PHP script to some.


RE: Buffer overflow on a vulnerable C program. - noize - 07-24-2013

(07-24-2013, 04:41 PM)lady_godiva Wrote: That could be a little bit confusing to tell the truth Smile The explanaition should be about the C gets() vulnerable function

Confusing? I can't see what you mean. I think it might be confusing the other way. The exploit code in the end is Perl (or some less-known language very similar to Perl, more probably Perl), but 'cause of the syntactical similarity between Perl and PHP and fed by the PHP tags and the fact that PHP is better widely known by people not knowing PHP nor Perl, that code might look like a PHP script to some.


RE: Buffer overflow on a vulnerable C program. - noize - 07-24-2013

(07-24-2013, 04:41 PM)lady_godiva Wrote: That could be a little bit confusing to tell the truth Smile The explanaition should be about the C gets() vulnerable function

Confusing? I can't see what you mean. I think it might be confusing the other way. The exploit code in the end is Perl (or some less-known language very similar to Perl, more probably Perl), but 'cause of the syntactical similarity between Perl and PHP and fed by the PHP tags and the fact that PHP is better widely known by people not knowing PHP nor Perl, that code might look like a PHP script to some.


RE: Buffer overflow on a vulnerable C program. - lady_godiva - 07-24-2013

Yes but i was talking about the title which states the vulnerability in a C program. The code is vulnerable because of the gets() function which is a typical C function which doesn't check that the buffer length is within the liimit of the allocated buffer. Minor issue however, nothing so important Smile


RE: Buffer overflow on a vulnerable C program. - lady_godiva - 07-24-2013

Yes but i was talking about the title which states the vulnerability in a C program. The code is vulnerable because of the gets() function which is a typical C function which doesn't check that the buffer length is within the liimit of the allocated buffer. Minor issue however, nothing so important Smile


RE: Buffer overflow on a vulnerable C program. - chapp - 08-10-2013

(07-24-2013, 04:57 PM)lady_godiva Wrote: Yes but i was talking about the title which states the vulnerability in a C program. The code is vulnerable because of the gets() function which is a typical C function which doesn't check that the buffer length is within the liimit of the allocated buffer. Minor issue however, nothing so important Smile

I know this is just to show the basics of a buffer overflow, but you hardly see these kinds of overflows any longer due to the gets() function.

Overflows typically occurs due to length of expected input is user controlled or when a loop condition is easily avoided having a loop run past bounderies.

You tutorial lacks detail and you skip important parts as of why these things happens, how you determine values or where to put the return address in your input data. Besides that, it's nice to see that someone actually attempts getting a grasp on the binary part.


RE: Buffer overflow on a vulnerable C program. - chapp - 08-10-2013

(07-24-2013, 04:57 PM)lady_godiva Wrote: Yes but i was talking about the title which states the vulnerability in a C program. The code is vulnerable because of the gets() function which is a typical C function which doesn't check that the buffer length is within the liimit of the allocated buffer. Minor issue however, nothing so important Smile

I know this is just to show the basics of a buffer overflow, but you hardly see these kinds of overflows any longer due to the gets() function.

Overflows typically occurs due to length of expected input is user controlled or when a loop condition is easily avoided having a loop run past bounderies.

You tutorial lacks detail and you skip important parts as of why these things happens, how you determine values or where to put the return address in your input data. Besides that, it's nice to see that someone actually attempts getting a grasp on the binary part.


RE: Buffer overflow on a vulnerable C program. - lady_godiva - 08-10-2013

It's not so hard to find programs that use functions like the gets() one. I agree with you that this tutorial is incomplete, it just gives a very basic idea. However on the other side there is so much to say about BOF that it's not so easy to lay out a thread, especially because XP handles memory differently from Vista or higher for example. To be exaustive, we'd also need to talk about heap overflow.

When i'll have time i'll make a complete tutorial about this


RE: Buffer overflow on a vulnerable C program. - lady_godiva - 08-10-2013

It's not so hard to find programs that use functions like the gets() one. I agree with you that this tutorial is incomplete, it just gives a very basic idea. However on the other side there is so much to say about BOF that it's not so easy to lay out a thread, especially because XP handles memory differently from Vista or higher for example. To be exaustive, we'd also need to talk about heap overflow.

When i'll have time i'll make a complete tutorial about this