mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-10-29 18:07:27 +01:00
Change the variable name
This commit is contained in:
parent
e0a22a6794
commit
5ede40a39d
@ -175,9 +175,9 @@ module Msf
|
||||
# @!attribute share
|
||||
# @return [String] The share portion of the provided UNC.
|
||||
attr_accessor :share
|
||||
# @!attribute path_name
|
||||
# @!attribute folder_name
|
||||
# @return [String] The folder where the provided file lives.
|
||||
attr_accessor :path_name
|
||||
attr_accessor :folder_name
|
||||
# @!attribute file_name
|
||||
# @return [String] The file name of the provided UNC.
|
||||
attr_accessor :file_name
|
||||
@ -207,7 +207,7 @@ module Msf
|
||||
def setup
|
||||
super
|
||||
|
||||
self.path_name = datastore['FOLDER_NAME']
|
||||
self.folder_name = datastore['FOLDER_NAME']
|
||||
self.share = datastore['SHARE'] || Rex::Text.rand_text_alpha(4 + rand(3))
|
||||
self.file_name = datastore['FILE_NAME'] || Rex::Text.rand_text_alpha(4 + rand(3))
|
||||
|
||||
@ -224,8 +224,8 @@ module Msf
|
||||
|
||||
# Builds the UNC Name for the shared file
|
||||
def unc
|
||||
if path_name
|
||||
path = "\\\\#{srvhost}\\#{share}\\#{path_name}\\#{file_name}"
|
||||
if folder_name
|
||||
path = "\\\\#{srvhost}\\#{share}\\#{folder_name}\\#{file_name}"
|
||||
else
|
||||
path = "\\\\#{srvhost}\\#{share}\\#{file_name}"
|
||||
end
|
||||
|
@ -32,7 +32,7 @@ module Msf
|
||||
attribs = CONST::SMB_EXT_FILE_ATTR_NORMAL
|
||||
eof = file_contents.length
|
||||
is_dir = 0
|
||||
elsif path_name && payload.ends_with?(path_name.downcase)
|
||||
elsif folder_name && payload.ends_with?(folder_name.downcase)
|
||||
fid = smb[:dir_id].to_i
|
||||
attribs = CONST::SMB_EXT_FILE_ATTR_DIRECTORY
|
||||
eof = 0
|
||||
|
@ -21,7 +21,7 @@ module Msf
|
||||
alloc = 1048576 # Allocation Size = 1048576 || 1Mb
|
||||
attrib = CONST::SMB_EXT_FILE_ATTR_NORMAL
|
||||
search = 1
|
||||
elsif path && path_name && path.ends_with?(path_name.downcase)
|
||||
elsif path && folder_name && path.ends_with?(folder_name.downcase)
|
||||
data = Rex::Text.to_unicode(path)
|
||||
length = 0
|
||||
ea = 0x21
|
||||
@ -59,7 +59,7 @@ module Msf
|
||||
def smb_cmd_find_file_names_info(c, path)
|
||||
if path && path.include?(file_name.downcase)
|
||||
data = Rex::Text.to_unicode(file_name)
|
||||
elsif path && path_name && path.ends_with?(path_name.downcase)
|
||||
elsif path && folder_name && path.ends_with?(folder_name.downcase)
|
||||
data = Rex::Text.to_unicode(path)
|
||||
elsif path && path == "\\"
|
||||
data = Rex::Text.to_unicode(path)
|
||||
@ -85,7 +85,7 @@ module Msf
|
||||
alloc = 1048576 # Allocation Size = 1048576 || 1Mb
|
||||
attrib = CONST::SMB_EXT_FILE_ATTR_NORMAL # File
|
||||
search = 0x100
|
||||
elsif path && path_name && path.ends_with?(path_name.downcase)
|
||||
elsif path && folder_name && path.ends_with?(folder_name.downcase)
|
||||
data = Rex::Text.to_unicode(path)
|
||||
length = 0
|
||||
ea = 0x21
|
||||
|
@ -51,7 +51,7 @@ module Msf
|
||||
def smb_cmd_trans_query_path_info_basic(c, path)
|
||||
if path && path.ends_with?(file_name.downcase)
|
||||
attrib = CONST::SMB_EXT_FILE_ATTR_NORMAL
|
||||
elsif path && path_name && path.ends_with?(path_name.downcase)
|
||||
elsif path && folder_name && path.ends_with?(folder_name.downcase)
|
||||
attrib = CONST::SMB_EXT_FILE_ATTR_DIRECTORY
|
||||
elsif path.nil? || path.empty? || path == "\x00" || path == "\\" # empty path
|
||||
attrib = CONST::SMB_EXT_FILE_ATTR_DIRECTORY
|
||||
@ -71,7 +71,7 @@ module Msf
|
||||
def smb_cmd_trans_query_path_info_standard(c, path)
|
||||
if path && path.include?(file_name.downcase)
|
||||
attrib = 0 # File attributes => file
|
||||
elsif path && path_name && path.ends_with?(path_name.downcase)
|
||||
elsif path && folder_name && path.ends_with?(folder_name.downcase)
|
||||
attrib = 1 # File attributes => directory
|
||||
elsif path.nil? || path.empty? || path == "\x00" || path == "\\" # empty path
|
||||
attrib = 1 # File attributes => directory
|
||||
@ -98,7 +98,7 @@ module Msf
|
||||
|
||||
if path && path.include?(file_name.downcase)
|
||||
attrib = CONST::SMB_EXT_FILE_ATTR_NORMAL
|
||||
elsif path && path_name && path.ends_with?(path_name.downcase)
|
||||
elsif path && folder_name && path.ends_with?(folder_name.downcase)
|
||||
attrib = CONST::SMB_EXT_FILE_ATTR_DIRECTORY
|
||||
elsif path.nil? || path.empty? || path == "\x00" || path == "\\" # empty path
|
||||
attrib = CONST::SMB_EXT_FILE_ATTR_DIRECTORY
|
||||
|
Loading…
Reference in New Issue
Block a user