@@ -886,7 +886,6 @@ def smb_cmd_trans_find_first2(c, buff)
886
886
887
887
payload = pkt [ 'Payload' ] . v [ 'SetupData' ] . gsub ( /\x00 / , '' ) . gsub ( /.*\\ / , '\\' ) . chomp . strip
888
888
file = file_name
889
- file_name = Rex ::Text . to_unicode ( file_name )
890
889
path = Rex ::Text . to_unicode ( path_name )
891
890
892
891
dprint ( "[smb_cmd_trans_find_first2] Payload is: #{ payload } " )
@@ -927,7 +926,7 @@ def smb_cmd_trans_find_first2(c, buff)
927
926
928
927
if ( payext and payext . downcase . eql? ( fileext . downcase ) ) or payload . length . to_s . eql? ( '4' )
929
928
dprint ( "[smb_cmd_trans_find_first2] Sending file response #{ file } " )
930
- data = file_name
929
+ data = Rex :: Text . to_unicode ( file_name )
931
930
length = [ exe_contents . length ] . pack ( "V" )
932
931
ea = "\x00 \x00 "
933
932
alloc = "\x00 \x00 \x10 \x00 \x00 \x00 \x00 \x00 " # Allocation Size = 1048576 || 1Mb
@@ -995,7 +994,6 @@ def smb_cmd_trans_find_first2_file(c, buff)
995
994
996
995
payload = pkt [ 'Payload' ] . v [ 'SetupData' ] . gsub ( /\x00 / , '' ) . gsub ( /.*\\ / , '\\' ) . chomp . strip . split ( '\\' ) . last
997
996
file = file_name
998
- file_name = Rex ::Text . to_unicode ( file_name )
999
997
path = Rex ::Text . to_unicode ( path_name )
1000
998
dprint ( "[smb_cmd_trans_find_first2_file] Payload is: #{ payload } " )
1001
999
dprint ( "[smb_cmd_trans_find_first2_file] Payload length: #{ payload . length . to_s } " )
@@ -1035,7 +1033,7 @@ def smb_cmd_trans_find_first2_file(c, buff)
1035
1033
1036
1034
if ( payext and payext . downcase . eql? ( fileext . downcase ) ) or payload . length . to_s . eql? ( '4' )
1037
1035
dprint ( "[smb_cmd_trans_find_first2_file] Sending file response #{ file } " )
1038
- data = file_name
1036
+ data = Rex :: Text . to_unicode ( file_name )
1039
1037
else
1040
1038
dprint ( "[smb_cmd_trans_find_first2_file] Sending directory response #{ path } " )
1041
1039
data = path
@@ -1083,7 +1081,6 @@ def smb_cmd_trans_find_first2_full(c, buff)
1083
1081
1084
1082
payload = pkt [ 'Payload' ] . v [ 'SetupData' ] . gsub ( /\x00 / , '' ) . gsub ( /.*\\ / , '\\' ) . chomp . strip
1085
1083
file = file_name
1086
- file_name = Rex ::Text . to_unicode ( file_name )
1087
1084
path = Rex ::Text . to_unicode ( path_name )
1088
1085
1089
1086
dprint ( "[smb_cmd_trans_find_first2_full] Payload is: #{ payload } " )
@@ -1124,7 +1121,7 @@ def smb_cmd_trans_find_first2_full(c, buff)
1124
1121
1125
1122
if ( payext and payext . downcase . eql? ( fileext . downcase ) ) or payload . length . to_s . eql? ( '4' )
1126
1123
dprint ( "[smb_cmd_trans_find_first2_full] Sending file response #{ file } " )
1127
- data = file_name
1124
+ data = Rex :: Text . to_unicode ( file_name )
1128
1125
length = [ exe_contents . length ] . pack ( "V" )
1129
1126
ea = "\x00 \x00 "
1130
1127
alloc = "\x00 \x00 \x10 \x00 \x00 \x00 \x00 \x00 " # Allocation Size = 1048576 || 1Mb
0 commit comments