Support Windows screensaver and locking

GSoC/Meterpreter_Web_Console
Eliott Teissonniere 2018-06-21 16:46:00 +00:00
parent a8e9c20d6c
commit 2008de4080
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', 'osx' ], 'Platform' => [ 'linux', 'osx', 'win' ],
'SessionTypes' => [ 'shell', 'meterpreter' ], 'SessionTypes' => [ 'shell', 'meterpreter' ],
'Actions' => 'Actions' =>
[ [
@ -46,6 +46,8 @@ class MetasploitModule < Msf::Post
cmd_vexec('xdg-screensaver lock') cmd_vexec('xdg-screensaver lock')
when 'osx' when 'osx'
cmd_vexec('pmset displaysleepnow') cmd_vexec('pmset displaysleepnow')
when 'windows'
cmd_vexec('rundll32 user32.dll,LockWorkStation')
end end
true true
@ -57,6 +59,8 @@ class MetasploitModule < Msf::Post
cmd_vexec('xdg-screensaver activate') cmd_vexec('xdg-screensaver activate')
when 'osx' when 'osx'
cmd_vexec('open -a ScreenSaverEngine') cmd_vexec('open -a ScreenSaverEngine')
when 'windows'
cmd_vexec('powershell -w hidden -nop -c "Start-Process C:\\Windows\\System32\\scrnsave.scr"')
end end
true true
@ -69,6 +73,9 @@ class MetasploitModule < Msf::Post
when 'osx' when 'osx'
print_error('Not supported on Mac OSX, you can still lock the screen or start the screensaver') print_error('Not supported on Mac OSX, you can still lock the screen or start the screensaver')
return false return false
when 'windows'
print_error('Not supported on Windows, you can still lock the screen or start the screensaver')
return false
end end
true true