Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

segmentation fault, buffer overflow

[es] :: C/C++ programiranje :: segmentation fault, buffer overflow

[ Pregleda: 3907 | Odgovora: 10 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

SnOoP
ARDIS - Optimisation software

Član broj: 522
Poruke: 31
*.a.003.mel.iprimus.net.au

ICQ: 17672962
Sajt: www.pozarnica.net


Profil

icon segmentation fault, buffer overflow11.07.2001. u 19:24 - pre 277 meseci
void lame (void) {
char small[30];
gets (small);
printf("%sn", small);
}
main() {
lame ();
return 0;
}

ocigledno obican program ..... ni malo komplikovan ali vrlo lagano exploitable.

# ./blah
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <- vas input
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# ./blah
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <- vas input
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Segmentation fault (core dumped)

greska segmentacije se desi kada funkcija "ret" koja se nalazi na adresi 0x80484d0 zeli da se vrati nazad na funkciju lame(); koja je na adresi 0x80484cb i u tom vremenu gde se desi greska segmentacije bude overwritten sa 0x787878 (0x78 = 'x').

mozda to sve nije bitno .. ali kako mogu da napravim code koji ce da me pusti da promenim adresu "ret" (return) funkcije i da mi omoguci da povecam "char small[30]" na 44 karaktera da mi se vrati nazad na adresu 0x80484cb dakle, da se nedesi greska segmentacije i ako na inputu stavim vise od 30 karaktera pa i vise od 44 karaktera.. neka bude 100.... al da mi se nedesi greska segmentacije ?

izvinjavam se ako je malo teze razumjeti jer nisam bas dobar sa naskim sprskim tehnickim rijecima lakse mi je na engleskom...


(gdb) disas main
Dump of assembler code for function main:
0x80484c8 <main>: pushl %ebp
0x80484c9 <main+1>: movl %esp,%ebp
0x80484cb <main+3>: call 0x80484a0 <lame>
0x80484d0 <main+8>: leave
0x80484d1 <main+9>: ret

int mailme()
{
char email[21]="\x115\x110\x111\x111\x112\x64\x110\x111\x115\x116\x97\x108\x103\x105\x106\x97\x46\x99\x111";
return 0;
}

The important thing is not to stop questioning. Curiosity has its own reason for existing. (Albert Einstein) ;-)
 
Odgovor na temu

Vojislav Milunovic

Član broj: 25
Poruke: 2117
*.verat.net



+1 Profil

icon Re: segmentation fault, buffer overflow11.07.2001. u 19:56 - pre 277 meseci
Savi scanf("%20s",buf) i tako ce se u taj buffer staviti samo 20 char-a...
Inace gets() se ne preporucuje bas zbog oakog buffer overflow-a ;o)

[Ovu poruku je menjao predator dana 07-11-2001 u 06:57 PM GMT]
 
Odgovor na temu

SnOoP
ARDIS - Optimisation software

Član broj: 522
Poruke: 31
*.a.003.mel.iprimus.net.au

ICQ: 17672962
Sajt: www.pozarnica.net


Profil

icon Re: segmentation fault, buffer overflow11.07.2001. u 20:08 - pre 277 meseci
hvala mnogo :)
inace sam tek 18 :( .. ucim polako
nego samo reci mi sta si zavrsijo/zavrsavas ? :)
int mailme()
{
char email[21]="\x115\x110\x111\x111\x112\x64\x110\x111\x115\x116\x97\x108\x103\x105\x106\x97\x46\x99\x111";
return 0;
}

The important thing is not to stop questioning. Curiosity has its own reason for existing. (Albert Einstein) ;-)
 
Odgovor na temu

Gojko Vujovic
Amsterdam, NL

Administrator
Član broj: 1
Poruke: 13651



+165 Profil

icon Re: segmentation fault, buffer overflow11.07.2001. u 20:13 - pre 277 meseci
A on je 17 i završava gimnaziju u beogradu a poslednju godinu će u USA.
 
Odgovor na temu

Vojislav Milunovic

Član broj: 25
Poruke: 2117
*.verat.net



+1 Profil

icon Re: segmentation fault, buffer overflow11.07.2001. u 23:35 - pre 277 meseci
E gojko nemoj da vredjas !!! pre mesec dana sam napunio 18 godina ;o))
 
Odgovor na temu

SnOoP
ARDIS - Optimisation software

Član broj: 522
Poruke: 31
*.a.004.mel.iprimus.net.au

ICQ: 17672962
Sajt: www.pozarnica.net


Profil

icon Re: segmentation fault, buffer overflow12.07.2001. u 05:38 - pre 277 meseci
heeh i ja sam 18 :P~
nego stvarno moram da pohvalim nase momke..
pametni smo u pm do zla boga :)))))


int mailme()
{
char email[21]="\x115\x110\x111\x111\x112\x64\x110\x111\x115\x116\x97\x108\x103\x105\x106\x97\x46\x99\x111";
return 0;
}

The important thing is not to stop questioning. Curiosity has its own reason for existing. (Albert Einstein) ;-)
 
Odgovor na temu

c00l_daem0n
Beograd

Član broj: 309
Poruke: 294
*.telekom.yu

Jabber: andrew@elitesecurity.org
ICQ: 53650656


Profil

icon Re: segmentation fault, buffer overflow12.07.2001. u 15:21 - pre 277 meseci
de ces u USA
stipendija?

Would you translate me on the other page in face = Da li biste me preveli na drugu stranu ulice
 
Odgovor na temu

Vojislav Milunovic

Član broj: 25
Poruke: 2117
*.verat.net



+1 Profil

icon Re: segmentation fault, buffer overflow12.07.2001. u 20:43 - pre 277 meseci
www.pax.org ;o) dalje ce ti se samo kasti
 
Odgovor na temu

RIZLA

Član broj: 278
Poruke: 31
*.InfoSky.Net



Profil

icon Re: segmentation fault, buffer overflow13.07.2001. u 13:29 - pre 277 meseci
Citat:
predator je napisao:
www.pax.org ;o) dalje ce ti se samo kasti






PAX-Program of Academic Exchange offers both inbound and
outbound high school/homestay programs. The programs are
built on the simple concept that we can best learn about
a different culture and best master a foreign language by
living as a family member in that country.

U.S families share their hearts
and home whit a "son" or "daughter"
from one of 30 different countries.




RIZLU imash a lichnu kartu nemash mozda chesh nochash y stanici da dremash...
 
Odgovor na temu

SnOoP
ARDIS - Optimisation software

Član broj: 522
Poruke: 31
*.a.002.mel.iprimus.net.au

ICQ: 17672962
Sajt: www.pozarnica.net


Profil

icon Re: segmentation fault, buffer overflow14.07.2001. u 03:01 - pre 277 meseci
bice jebeno :)
int mailme()
{
char email[21]="\x115\x110\x111\x111\x112\x64\x110\x111\x115\x116\x97\x108\x103\x105\x106\x97\x46\x99\x111";
return 0;
}

The important thing is not to stop questioning. Curiosity has its own reason for existing. (Albert Einstein) ;-)
 
Odgovor na temu

tuzlaorg
Istanbul, Turkey

Član broj: 286
Poruke: 285



+1 Profil

icon Re: segmentation fault, buffer overflow16.07.2001. u 04:37 - pre 277 meseci
Ja sam bio 2000/2001 na slicnom programu u USA :)
Tu sam jos. Sad idem na fakultet :) Sa 17 :(
 
Odgovor na temu

[es] :: C/C++ programiranje :: segmentation fault, buffer overflow

[ Pregleda: 3907 | Odgovora: 10 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.