Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
FunnyWolf committed Aug 24, 2023
1 parent 5bc3e3e commit 3c73fe0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/msf/base/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def self.init(log_sink_name = nil)
Msf::LogSource,
'base',
].each { |src|
register_log_source(src, log_sink, 0)
register_log_source(src, log_sink, 3)
}
end
end
Expand Down
11 changes: 2 additions & 9 deletions modules/post/multi/manage/file_system_operation_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ def run
args = datastore['ARGS']
file_data = datastore['FILE_DATA']
if operation == 'upload'
# if session.platform == "windows"
# sessionuploadfile = sessiondir + '\\' + msffile.delete('/\\')
# else
# sessionuploadfile = File.join(sessiondir, msffile.delete('/\\'))
# end
msffilepath = File.join(Msf::Config.loot_directory, msffile.delete('/\\'))
sessionuploadfile = File.join(sessiondir, msffile.delete('/\\'))
upload(msffilepath, sessionuploadfile)
Expand Down Expand Up @@ -271,7 +266,7 @@ def create_dir(remotepath)
def upload(localpath, remotepath)
result = { :status => true, :message => nil, :data => nil, :endflag => nil }
client.fs.file.upload_file(remotepath, localpath) do |step, src, dst|
print_status_redis("#{step.ljust(11)}: #{src} -> #{dst}")
print_status_redis("#{step.ljust(11)}: #{src.force_encoding("utf-8")} -> #{dst.force_encoding("utf-8")}")
end
result[:status] = true
result[:message] = "upload finish"
Expand All @@ -294,7 +289,7 @@ def download(localpath, remotepath)
}

client.fs.file.download_file(localpath, remotepath, opts) do |step, src, dst|
print_status_redis("#{step}: #{src} -> #{dst}")
print_status_redis("#{step}: #{src.force_encoding("utf-8")} -> #{dst.force_encoding("utf-8")}")
end

result[:status] = true
Expand All @@ -312,8 +307,6 @@ def download(localpath, remotepath)

def execute(remotepath, args)
result = { :status => true, :message => nil, :data => nil, :endflag => nil }
# cmd = "#{remotepath} #{args}"

begin
client.sys.process.execute(remotepath, args, opts = { 'Hidden' => true, 'Subshell' => true })
result[:status] = true
Expand Down

0 comments on commit 3c73fe0

Please sign in to comment.