Skip to content

Commit d22231b

Browse files
author
Brent Cook
committed
remove unicode_filter_encode calls
Let the underlying utf8 messages through to the console.
1 parent dd824d9 commit d22231b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def Dir.entries(name = getwd)
6161
response = client.send_request(request)
6262

6363
response.each(TLV_TYPE_FILE_NAME) { |file_name|
64-
files << client.unicode_filter_encode( file_name.value )
64+
files << file_name.value
6565
}
6666

6767
return files
@@ -96,8 +96,8 @@ def Dir.entries_with_info(name = getwd)
9696

9797
files <<
9898
{
99-
'FileName' => client.unicode_filter_encode( file_name.value ),
100-
'FilePath' => client.unicode_filter_encode( fpath[idx].value ),
99+
'FileName' => file_name.value,
100+
'FilePath' => fpath[idx].value,
101101
'StatBuf' => st,
102102
}
103103
}
@@ -145,7 +145,7 @@ def Dir.pwd
145145

146146
response = client.send_request(request)
147147

148-
return client.unicode_filter_encode( response.get_tlv(TLV_TYPE_DIRECTORY_PATH).value )
148+
return response.get_tlv(TLV_TYPE_DIRECTORY_PATH).value
149149
end
150150

151151
#
@@ -195,8 +195,8 @@ def Dir.unlink(path)
195195
def Dir.download(dst, src, recursive = false, force = true, &stat)
196196

197197
self.entries(src).each { |src_sub|
198-
dst_item = dst + ::File::SEPARATOR + client.unicode_filter_encode( src_sub )
199-
src_item = src + client.fs.file.separator + client.unicode_filter_encode( src_sub )
198+
dst_item = dst + ::File::SEPARATOR + src_sub
199+
src_item = src + client.fs.file.separator + src_sub
200200

201201
if (src_sub == '.' or src_sub == '..')
202202
next
@@ -240,8 +240,8 @@ def Dir.download(dst, src, recursive = false, force = true, &stat)
240240
#
241241
def Dir.upload(dst, src, recursive = false, &stat)
242242
::Dir.entries(src).each { |src_sub|
243-
dst_item = dst + client.fs.file.separator + client.unicode_filter_encode( src_sub )
244-
src_item = src + ::File::SEPARATOR + client.unicode_filter_encode( src_sub )
243+
dst_item = dst + client.fs.file.separator + src_sub
244+
src_item = src + ::File::SEPARATOR + src_sub
245245

246246
if (src_sub == '.' or src_sub == '..')
247247
next

lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ def File.search( root=nil, glob="*.*", recurse=true, timeout=-1 )
9191
if( response.result == 0 )
9292
response.each( TLV_TYPE_SEARCH_RESULTS ) do | results |
9393
files << {
94-
'path' => client.unicode_filter_encode( results.get_tlv_value( TLV_TYPE_FILE_PATH ).chomp( '\\' ) ),
95-
'name' => client.unicode_filter_encode( results.get_tlv_value( TLV_TYPE_FILE_NAME ) ),
94+
'path' => results.get_tlv_value( TLV_TYPE_FILE_PATH ).chomp( '\\' ),
95+
'name' => results.get_tlv_value( TLV_TYPE_FILE_NAME ),
9696
'size' => results.get_tlv_value( TLV_TYPE_FILE_SIZE )
9797
}
9898
end
@@ -138,7 +138,7 @@ def File.expand_path(path)
138138

139139
response = client.send_request(request)
140140

141-
return client.unicode_filter_encode( response.get_tlv_value(TLV_TYPE_FILE_PATH) )
141+
return response.get_tlv_value(TLV_TYPE_FILE_PATH)
142142
end
143143

144144

0 commit comments

Comments
 (0)