I am also stuck on this, I followed all of the stuff that was taught in the tutorial and I have been reading and watching all different kinds of exploits and have learned a lot of stuff but none of them seem to pertain to this challenge. I note what blueprismo said but I am not sure what I am missing
I don’t want to give you a direct answer at it’s against the rules. But check these points:
1- did you get a reverse shell = (rs)? How?
2- With this rs, what user are you logged in?
3- you know how sticky bits work, right?
4- find the file with the sticky bit set.
5- remember when you are inside gdb and run " $(python -c blablabla)" it’s the same as executing the script with the parameter, as follows: ‘./script $(python -c blablabla)’
I can’t help you more, check these points and I’m sure you will pass
keep me updated.
Hi, could you elaborate on that plz? i got the shell but cant figure out what to do next. Thx
You can only debug a setuid or setgid program if the debugger is running as root. The kernel won't let you call ptrace on a program running with extra privileges. If it did, you would be able to make the program execute anything, which would effectively mean you could e.g. run a root shell by calling a debugger on /bin/su.
So you might need to think of another way to get the shellcode triggered outside GDB
I am also stuck on this, I followed all of the stuff that was taught in the tutorial and I have been reading and watching all different kinds of exploits and have learned a lot of stuff but none of them seem to pertain to this challenge. I note what blueprismo said but I am not sure what I am missing
I don’t want to give you a direct answer at it’s against the rules. But check these points:
1- did you get a reverse shell = (rs)? How?
2- With this rs, what user are you logged in?
3- you know how sticky bits work, right?
4- find the file with the sticky bit set.
5- remember when you are inside gdb and run " $(python -c blablabla)" it’s the same as executing the script with the parameter, as follows: ‘./script $(python -c blablabla)’
I can’t help you more, check these points and I’m sure you will pass
keep me updated.
Hi, could you elaborate on that plz? i got the shell but cant figure out what to do next. Thx
welp, did u get a shell with which user? unprivileged? then… just think how can u get a privileged shell, watch for the files inside the home folder, you got this
Buffer = “\x55” * (1040 - 124 - 95 - 4) = 817 NOPs = “\x90” * 124 Shellcode = “char” EIP = “\x66” * 4 Can Some1 explain me why 124 NOPs are taken? why not more/less than that??? Is this is randomly taken or any calculation is behind that??
I tried multiple ways including this… ./leave_msg $(python -c ‘import os; os.system(“sudo cat /root/flag.txt”)’) Still not roooooooted Can some1 please help me out ???
this hint is the key to the kingdom. Once you determine the vulnerability and can can make the exploit work in gdb (i.e. you get an unprivileged shell), get out of gdb and just run your exploit as an argument to the vulnerable binary–don’t forget to start your listener.
HOW?!?! I’ve got the reverse shell - is it a priv escalation or is that not what they’re looking for? Is there a way to make the msfvenom payload “cat /root/flag.txt” instead of the reverse shell?
Did you end up getting it? Took me a while to see why it wasn’t working through the debugger. I get it now. This info really helped break looks the cobwebs in my head:
I was beating my head against the wall with this challenge and trying desperately not to over think it. This single line right here helped me so much because I wasn’t seeing what I expected through gdb. Thank you!
5- remember when you are inside gdb and run " $(python -c blablabla)" it’s the same as executing the script with the parameter, as follows: ‘./script $(python -c blablabla)’
I will also note, this chapter shows you one way of using msfvenom with its build up to the challenge. There are many tools in msfvenom’s tool suite!