From 3273b27c7598306eb0764e8427657eae1271ab7a Mon Sep 17 00:00:00 2001 From: mbechler Date: Sun, 6 Mar 2016 19:32:08 +0100 Subject: [PATCH] JRMPListener Java6 compatiblity. --- src/main/java/ysoserial/exploit/JRMPListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/ysoserial/exploit/JRMPListener.java b/src/main/java/ysoserial/exploit/JRMPListener.java index c93f3d5..b019103 100644 --- a/src/main/java/ysoserial/exploit/JRMPListener.java +++ b/src/main/java/ysoserial/exploit/JRMPListener.java @@ -150,7 +150,11 @@ public class JRMPListener implements Runnable { switch ( protocol ) { case TransportConstants.StreamProtocol: out.writeByte(TransportConstants.ProtocolAck); - out.writeUTF(remote.getHostString()); + if ( remote.getHostName() != null ) { + out.writeUTF(remote.getHostName()); + } else { + out.writeUTF(remote.getAddress().toString()); + } out.writeInt(remote.getPort()); out.flush(); in.readUTF();