Multi Manage the screensaver of the target computer - Metasploit


This page contains detailed information about how to use the post/multi/manage/screensaver metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Multi Manage the screensaver of the target computer
Module: post/multi/manage/screensaver
Source code: modules/post/multi/manage/screensaver.rb
Disclosure date: -
Last modification time: 2018-06-21 16:46:00 +0000
Supported architecture(s): -
Supported platform(s): Linux, OSX, Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module allows you to turn on or off the screensaver of the target computer and also lock the current session.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Basic Usage


There are two ways to execute this post module.

From the Meterpreter prompt

The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:

meterpreter > run post/multi/manage/screensaver

From the msf prompt

The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.

msf > use post/multi/manage/screensaver
msf post(screensaver) > show options
    ... show and set options ...
msf post(screensaver) > set SESSION session-id
msf post(screensaver) > exploit

If you wish to run the post against all sessions from framework, here is how:

1 - Create the following resource script:


framework.sessions.each_pair do |sid, session|
  run_single("use post/multi/manage/screensaver")
  run_single("set SESSION #{sid}")
  run_single("run")
end

2 - At the msf prompt, execute the above resource script:

msf > resource path-to-resource-script

Required Options


  • SESSION: The session to run this module on.

Knowledge Base


This module allows you to control the screensaver or lock the session.

Vulnerable Application


The following platforms are supported:

  • Windows
  • Linux
  • OS X

WARNING: only Linux supports stopping the screensaver.

Verification Steps


  1. Obtain a session.
  2. In msfconsole do use post/multi/manage/screensaver.
  3. Set the SESSION option.
  4. Choose the action you want to perform via set action NAME (available actions described below).
  5. Do run.

Actions


LOCK

If you use set action LOCK the run command will lock the current session, the user will have to login again.

START

If you use set action START the run command will start the screensaver, depending on its settings the user may have to login again.

STOP

If you use set action STOP the run command will stop the screensaver.

Go back to menu.

Msfconsole Usage


Here is how the multi/manage/screensaver post exploitation module looks in the msfconsole:

msf6 > use post/multi/manage/screensaver

msf6 post(multi/manage/screensaver) > show info

       Name: Multi Manage the screensaver of the target computer
     Module: post/multi/manage/screensaver
   Platform: Linux, OSX, Windows
       Arch: 
       Rank: Normal

Provided by:
  Eliott Teissonniere

Compatible session types:
  Meterpreter
  Shell

Available actions:
  Name   Description
  ----   -----------
  LOCK   Lock the current session
  START  Start the screensaver, may lock the current session
  STOP   Stop the screensaver, user may be prompted for its password

Basic options:
  Name     Current Setting  Required  Description
  ----     ---------------  --------  -----------
  SESSION                   yes       The session to run this module on.

Description:
  This module allows you to turn on or off the screensaver of the 
  target computer and also lock the current session.

Module Options


This is a complete list of options available in the multi/manage/screensaver post exploitation module:

msf6 post(multi/manage/screensaver) > show options

Module options (post/multi/manage/screensaver):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SESSION                   yes       The session to run this module on.

Advanced Options


Here is a complete list of advanced options supported by the multi/manage/screensaver post exploitation module:

msf6 post(multi/manage/screensaver) > show advanced

Module advanced options (post/multi/manage/screensaver):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   VERBOSE    false            no        Enable detailed status messages
   WORKSPACE                   no        Specify the workspace for this module

Post Actions


This is a list of all post exploitation actions which the multi/manage/screensaver module can do:

msf6 post(multi/manage/screensaver) > show actions

Post actions:

   Name   Description
   ----   -----------
   LOCK   Lock the current session
   START  Start the screensaver, may lock the current session
   STOP   Stop the screensaver, user may be prompted for its password

Evasion Options


Here is the full list of possible evasion options supported by the multi/manage/screensaver post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 post(multi/manage/screensaver) > show evasion

Module evasion options:

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

Command failed


Here is a relevant code snippet related to the "Command failed" error message:

31:	    print_status("Executing '#{cmd}'")
32:	
33:	    begin
34:	      cmd_exec(cmd)
35:	    rescue EOFError
36:	      print_error('Command failed')
37:	      return false
38:	    end
39:	
40:	    true
41:	  end

Not supported on Mac OSX, you can still lock the screen or start the screensaver


Here is a relevant code snippet related to the "Not supported on Mac OSX, you can still lock the screen or start the screensaver" error message:

69:	  def stop_screensaver
70:	    case session.platform
71:	    when 'linux'
72:	      cmd_vexec('xdg-screensaver reset')
73:	    when 'osx'
74:	      print_error('Not supported on Mac OSX, you can still lock the screen or start the screensaver')
75:	      return false
76:	    when 'windows'
77:	      print_error('Not supported on Windows, you can still lock the screen or start the screensaver')
78:	      return false
79:	    end

Not supported on Windows, you can still lock the screen or start the screensaver


Here is a relevant code snippet related to the "Not supported on Windows, you can still lock the screen or start the screensaver" error message:

72:	      cmd_vexec('xdg-screensaver reset')
73:	    when 'osx'
74:	      print_error('Not supported on Mac OSX, you can still lock the screen or start the screensaver')
75:	      return false
76:	    when 'windows'
77:	      print_error('Not supported on Windows, you can still lock the screen or start the screensaver')
78:	      return false
79:	    end
80:	
81:	    true
82:	  end

Please specify an action


Here is a relevant code snippet related to the "Please specify an action" error message:

81:	    true
82:	  end
83:	
84:	  def run
85:	    if action.nil?
86:	      print_error('Please specify an action')
87:	    end
88:	
89:	    case action.name
90:	     when 'LOCK'
91:	       return lock_session

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • Eliott Teissonniere

Version


This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.