Multi Gather Malware Verifier - Metasploit


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

Module Overview


Name: Multi Gather Malware Verifier
Module: post/multi/gather/check_malware
Source code: modules/post/multi/gather/check_malware.rb
Disclosure date: -
Last modification time: 2017-07-24 06:26:21 +0000
Supported architecture(s): -
Supported platform(s): Linux, OSX, Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module will check a file for malware on VirusTotal based on the checksum.

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/gather/check_malware

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/gather/check_malware
msf post(check_malware) > show options
    ... show and set options ...
msf post(check_malware) > set SESSION session-id
msf post(check_malware) > 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/gather/check_malware")
  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.

  • REMOTEFILE: A file to check from the remote machine

Go back to menu.

Msfconsole Usage


Here is how the multi/gather/check_malware post exploitation module looks in the msfconsole:

msf6 > use post/multi/gather/check_malware

msf6 post(multi/gather/check_malware) > show info

       Name: Multi Gather Malware Verifier
     Module: post/multi/gather/check_malware
   Platform: OSX, Windows, Linux
       Arch: 
       Rank: Normal

Provided by:
  sinn3r <[email protected]>

Compatible session types:
  Meterpreter
  Shell

Basic options:
  Name        Current Setting                                                   Required  Description
  ----        ---------------                                                   --------  -----------
  APIKEY      501caf66349cc7357eb4398ac3298fdd03dec01a3e2f3ad576525aa7b57a1987  yes       VirusTotal API key
  REMOTEFILE                                                                    yes       A file to check from the remote machine
  SESSION                                                                       yes       The session to run this module on.

Description:
  This module will check a file for malware on VirusTotal based on the 
  checksum.

Module Options


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

msf6 post(multi/gather/check_malware) > show options

Module options (post/multi/gather/check_malware):

   Name        Current Setting                                                   Required  Description
   ----        ---------------                                                   --------  -----------
   APIKEY      501caf66349cc7357eb4398ac3298fdd03dec01a3e2f3ad576525aa7b57a1987  yes       VirusTotal API key
   REMOTEFILE                                                                    yes       A file to check from the remote machine
   SESSION                                                                       yes       The session to run this module on.

Advanced Options


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

msf6 post(multi/gather/check_malware) > show advanced

Module advanced options (post/multi/gather/check_malware):

   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/gather/check_malware module can do:

msf6 post(multi/gather/check_malware) > show actions

Post actions:

   Name  Description
   ----  -----------

Evasion Options


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

msf6 post(multi/gather/check_malware) > 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.

<RHOST> - Connection timed out


Here is a relevant code snippet related to the "<RHOST> - Connection timed out" error message:

44:	    http = Net::HTTP::new(url.host, url.port)
45:	    http.use_ssl = true
46:	    res = http.start {|http| http.request(req)}
47:	
48:	    unless res
49:	      print_error("#{rhost} - Connection timed out")
50:	      return ''
51:	    end
52:	
53:	    case res.code
54:	    when 204

<RHOST> - You have reached the request limit, please wait for one minute to try again


Here is a relevant code snippet related to the "<RHOST> - You have reached the request limit, please wait for one minute to try again" error message:

50:	      return ''
51:	    end
52:	
53:	    case res.code
54:	    when 204
55:	      print_error("#{rhost} - You have reached the request limit, please wait for one minute to try again")
56:	      return ''
57:	    when 403
58:	      print_error("#{rhost} - No privilege to execute this request probably due to an invalye API key")
59:	      return ''
60:	    end

<RHOST> - No privilege to execute this request probably due to an invalye API key


Here is a relevant code snippet related to the "<RHOST> - No privilege to execute this request probably due to an invalye API key" error message:

53:	    case res.code
54:	    when 204
55:	      print_error("#{rhost} - You have reached the request limit, please wait for one minute to try again")
56:	      return ''
57:	    when 403
58:	      print_error("#{rhost} - No privilege to execute this request probably due to an invalye API key")
59:	      return ''
60:	    end
61:	
62:	    body = ''
63:	    begin

<RHOST> - Unable to parse the response


Here is a relevant code snippet related to the "<RHOST> - Unable to parse the response" error message:

61:	
62:	    body = ''
63:	    begin
64:	      body = JSON.parse(res.body)
65:	    rescue JSON::ParserError
66:	      print_error("#{rhost} - Unable to parse the response")
67:	      return body
68:	    end
69:	
70:	    body
71:	  end

<RHOST> - File not found: <FILENAME>


Here is a relevant code snippet related to the "<RHOST> - File not found: <FILENAME>" error message:

106:	  def run
107:	    filename = datastore['REMOTEFILE']
108:	    api_key  = datastore['APIKEY']
109:	
110:	    unless file?(filename)
111:	      print_error("#{rhost} - File not found: #{filename}")
112:	      return
113:	    end
114:	
115:	    checksum = file_remote_digestsha1(filename)
116:	    print_status("#{rhost} - Checking: #{filename}...")

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • sinn3r

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.