Check command availability

GSoC/Meterpreter_Web_Console
Eliott Teissonniere 2018-06-14 10:00:26 +00:00
parent e523d5a114
commit c4af2aca53
2 changed files with 8 additions and 1 deletions

View File

@ -24,7 +24,10 @@ class MetasploitModule < Msf::Post
end
def run
print_status('Starting xdg-open...')
unless command_exists? 'xdg-open'
print_error 'xdg-open is not available'
return
end
cmd_exec("xdg-open #{datastore['RES']} > /dev/null")
end
end

View File

@ -35,6 +35,10 @@ class MetasploitModule < Msf::Post
case action.name
when 'STATUS'
unless command_exists? 'xdg-screensaver' # Specific to the X window system, should come preinstalled
print_error 'xdg-screensaver is not installed'
return
end
output = cmd_exec('xdg-screensaver status')
print_status output
when 'LOCK'