Axino.net

hackthissite.org extbasic 1 :: Over and out?

by Arxleol on Wednesday 23.12.2009, under C, hackthissite.org, tutorial

First mission in the series of extended basic missions on hackthissite.org is more then simple;

Introduction is also fairly easy.

You have to give input to a C program which gives you the length of the string. How would you crash it?
here is the function:

void blah(char *str)
{
char lol[200];
strcpy(lol, str);
}

Now you have to understand some of C to understand this Here we have short function that accepts string as array of chars or to be exact pointer on the first character in the series.

First line of code defines new array with length of 200 characters.

Second line of code copies str array into lol array. However, if str array is longer then lol array program will crash. So you simply have to enter more then 200 characters into the text box and you will crash it.

Here is sample string with 201 characters ;)

123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123459

With regards,

Ax

Similar Posts:

:, , , , , , ,
No comments for this entry yet...

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Archives