Make screensaver works on OSX

GSoC/Meterpreter_Web_Console
Eliott Teissonniere 2018-06-20 09:13:51 +00:00
parent 351a0bd37f
commit 4c0ac00f38
1 changed files with 8 additions and 1 deletions

View File

@ -13,7 +13,7 @@ class MetasploitModule < Msf::Post
}, },
'License' => MSF_LICENSE, 'License' => MSF_LICENSE,
'Author' => [ 'Eliott Teissonniere'], 'Author' => [ 'Eliott Teissonniere'],
'Platform' => [ 'linux' ], 'Platform' => [ 'linux', 'osx' ],
'SessionTypes' => [ 'shell', 'meterpreter' ], 'SessionTypes' => [ 'shell', 'meterpreter' ],
'Actions' => 'Actions' =>
[ [
@ -44,6 +44,8 @@ class MetasploitModule < Msf::Post
case session.platform case session.platform
when 'linux' when 'linux'
cmd_vexec('xdg-screensaver lock') cmd_vexec('xdg-screensaver lock')
when 'osx'
cmd_vexec('pmset displaysleepnow')
end end
true true
@ -53,6 +55,8 @@ class MetasploitModule < Msf::Post
case session.platform case session.platform
when 'linux' when 'linux'
cmd_vexec('xdg-screensaver activate') cmd_vexec('xdg-screensaver activate')
when 'osx'
cmd_vexec('open -a ScreenSaverEngine')
end end
true true
@ -62,6 +66,9 @@ class MetasploitModule < Msf::Post
case session.platform case session.platform
when 'linux' when 'linux'
cmd_vexec('xdg-screensaver reset') cmd_vexec('xdg-screensaver reset')
when 'osx'
print_error('Not supported on Mac OSX, you can still lock the screen or start the screensaver')
return false
end end
true true