Reorganize trans2_find_first2 requests
parent
52a0e6dd1c
commit
df903120e3
|
@ -415,21 +415,7 @@ module Msf
|
||||||
smb_cmd_trans_query_path_info_standard(c, buff)
|
smb_cmd_trans_query_path_info_standard(c, buff)
|
||||||
end
|
end
|
||||||
when CONST::TRANS2_FIND_FIRST2
|
when CONST::TRANS2_FIND_FIRST2
|
||||||
dprint("\t[find_first2]")
|
smb_cmd_trans2_find_first2(c, buff)
|
||||||
loi = ar[156..159].unpack('n*').reverse.pack('n*').to_i(16)
|
|
||||||
case loi
|
|
||||||
when CONST::SMB_FIND_FILE_NAMES_INFO
|
|
||||||
dprint("\t\t[SMB_FIND_FILE_NAMES_INFO]")
|
|
||||||
smb_cmd_trans_find_first2_file(c, buff)
|
|
||||||
when CONST::SMB_FIND_FILE_BOTH_DIRECTORY_INFO
|
|
||||||
dprint("\t\t[SMB_FIND_FILE_BOTH_DIRECTORY_INFO]")
|
|
||||||
smb_cmd_trans_find_first2(c, buff)
|
|
||||||
when CONST::SMB_FIND_FILE_FULL_DIRECTORY_INFO
|
|
||||||
dprint("\t\t[SMB_FIND_FILE_FULL_DIRECTORY_INFO]")
|
|
||||||
smb_cmd_trans_find_first2_full(c, buff)
|
|
||||||
else
|
|
||||||
smb_cmd_trans_find_first2(c, buff)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
dprint("\t[UNKNOWN SUBCOMMAND]")
|
dprint("\t[UNKNOWN SUBCOMMAND]")
|
||||||
pkt = CONST::SMB_TRANS_RES_PKT.make_struct
|
pkt = CONST::SMB_TRANS_RES_PKT.make_struct
|
||||||
|
@ -721,11 +707,34 @@ module Msf
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def smb_cmd_trans2_find_first2(c, buff)
|
||||||
|
dprint("[smb_cmd_trans2_find_first2]")
|
||||||
|
|
||||||
|
ar = Rex::Text.to_hex(buff, '').to_s
|
||||||
|
loi = ar[156..159].unpack('n*').reverse.pack('n*').to_i(16)
|
||||||
|
|
||||||
|
case loi
|
||||||
|
when CONST::SMB_FIND_FILE_NAMES_INFO
|
||||||
|
dprint("\t[SMB_FIND_FILE_NAMES_INFO]")
|
||||||
|
smb_cmd_find_file_names_info(c, buff)
|
||||||
|
when CONST::SMB_FIND_FILE_BOTH_DIRECTORY_INFO
|
||||||
|
dprint("\t[SMB_FIND_FILE_BOTH_DIRECTORY_INFO]")
|
||||||
|
smb_cmd_find_file_both_directory_info(c, buff)
|
||||||
|
when CONST::SMB_FIND_FILE_FULL_DIRECTORY_INFO
|
||||||
|
dprint("\t[SMB_FIND_FILE_FULL_DIRECTORY_INFO]")
|
||||||
|
smb_cmd_find_file_full_directory_info(c, buff)
|
||||||
|
else
|
||||||
|
dprint("\t[Unexpected :?]") #TODO
|
||||||
|
#smb_cmd_trans_find_first2(c, buff)
|
||||||
|
fail_with(Failure::Unknown, "Invalid or unknown TRANS2_FIND_FIRST2 REQUEST???") #TODO
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Responds to FIND_FIRST2 requests
|
# Responds to FIND_FIRST2 requests
|
||||||
# Command: Find File Both Directory Info
|
# Command: Find File Both Directory Info
|
||||||
#
|
#
|
||||||
def smb_cmd_trans_find_first2(c, buff)
|
def smb_cmd_find_file_both_directory_info(c, buff)
|
||||||
dprint("[smb_cmd_trans_find_first2]")
|
dprint("[smb_cmd_trans_find_first2]")
|
||||||
pkt = CONST::SMB_TRANS_RES_PKT.make_struct
|
pkt = CONST::SMB_TRANS_RES_PKT.make_struct
|
||||||
smb_set_defaults(c, pkt)
|
smb_set_defaults(c, pkt)
|
||||||
|
@ -804,7 +813,7 @@ module Msf
|
||||||
# Responds to FIND_FIRST2 requests
|
# Responds to FIND_FIRST2 requests
|
||||||
# Command: Find File Names Info
|
# Command: Find File Names Info
|
||||||
#
|
#
|
||||||
def smb_cmd_trans_find_first2_file(c, buff)
|
def smb_cmd_find_file_names_info(c, buff)
|
||||||
dprint("[smb_cmd_trans_find_first2_file]")
|
dprint("[smb_cmd_trans_find_first2_file]")
|
||||||
pkt = CONST::SMB_TRANS_RES_PKT.make_struct
|
pkt = CONST::SMB_TRANS_RES_PKT.make_struct
|
||||||
smb_set_defaults(c, pkt)
|
smb_set_defaults(c, pkt)
|
||||||
|
@ -860,7 +869,7 @@ module Msf
|
||||||
# Responds to FIND_FIRST2 requests
|
# Responds to FIND_FIRST2 requests
|
||||||
# Command: Find File Full Directory Info
|
# Command: Find File Full Directory Info
|
||||||
#
|
#
|
||||||
def smb_cmd_trans_find_first2_full(c, buff)
|
def smb_cmd_find_file_full_directory_info(c, buff)
|
||||||
dprint("[smb_cmd_trans_find_first2_full]")
|
dprint("[smb_cmd_trans_find_first2_full]")
|
||||||
pkt = CONST::SMB_TRANS_RES_PKT.make_struct
|
pkt = CONST::SMB_TRANS_RES_PKT.make_struct
|
||||||
smb_set_defaults(c, pkt)
|
smb_set_defaults(c, pkt)
|
||||||
|
|
Loading…
Reference in New Issue