From 6586bd0df8587e93ee2d9abe268dbfb461d5f98f Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 10 May 2015 15:05:45 +0100 Subject: [PATCH] add TLV_TYPE_FILE_HASH --- .../src/main/java/com/metasploit/meterpreter/TLVType.java | 1 + .../java/com/metasploit/meterpreter/stdapi/HashCommand.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/java/meterpreter/meterpreter/src/main/java/com/metasploit/meterpreter/TLVType.java b/java/meterpreter/meterpreter/src/main/java/com/metasploit/meterpreter/TLVType.java index bb825336..38802ee3 100644 --- a/java/meterpreter/meterpreter/src/main/java/com/metasploit/meterpreter/TLVType.java +++ b/java/meterpreter/meterpreter/src/main/java/com/metasploit/meterpreter/TLVType.java @@ -57,6 +57,7 @@ public interface TLVType { public static final int TLV_TYPE_FILE_NAME = TLVPacket.TLV_META_TYPE_STRING | 1201; public static final int TLV_TYPE_FILE_PATH = TLVPacket.TLV_META_TYPE_STRING | 1202; public static final int TLV_TYPE_FILE_MODE = TLVPacket.TLV_META_TYPE_STRING | 1203; + public static final int TLV_TYPE_FILE_HASH = TLVPacket.TLV_META_TYPE_RAW | 1206; public static final int TLV_TYPE_STAT_BUF = TLVPacket.TLV_META_TYPE_COMPLEX | 1220; // Net diff --git a/java/meterpreter/stdapi/src/main/java/com/metasploit/meterpreter/stdapi/HashCommand.java b/java/meterpreter/stdapi/src/main/java/com/metasploit/meterpreter/stdapi/HashCommand.java index 2ea2f61a..a111b20d 100644 --- a/java/meterpreter/stdapi/src/main/java/com/metasploit/meterpreter/stdapi/HashCommand.java +++ b/java/meterpreter/stdapi/src/main/java/com/metasploit/meterpreter/stdapi/HashCommand.java @@ -20,7 +20,7 @@ public abstract class HashCommand implements Command { while ((len = in.read(buf)) != -1) { md.update(buf, 0, len); } - response.add(TLVType.TLV_TYPE_FILE_NAME, new String(md.digest(), "ISO-8859-1")); + response.add(TLVType.TLV_TYPE_FILE_HASH, md.digest()); return ERROR_SUCCESS; } }