Check command availability
parent
e523d5a114
commit
c4af2aca53
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue