Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/documentation/modules/post/windows/gather/credentials/securecrt.md
Views: 11791
Vulnerable Application
All SecureCRT installations are affected, regardless of which OS they are installed on, since they all use the same encryption mechanisms described by HyperSine in his GitHub paper. Note that at the moment this module only supports exploiting Windows machines.
Overview
All versions of SecureCRT have an option to allow users to store an encrypted copy of their session information on the local computer, allowing them to easily restart a session without having to reenter all the connection details such as the host, username, and password. These details are stored in a local session file, and SecureCRT will additionally encrypt the password with AES encryption.
Unfortunately for SecureCRT users, the encryption mechanism used uses a weak IV of all 0's, and the encryption keys that are utilized to encrypt the passwords have been publicly reversed and documented by HyperSine in his GitHub paper.
In addition, HyperSine also published a PoC script that allows users to decrypt SecureCRT session files, regardless of the version of SecureCRT installed. The only limitation is that users must know the SecureCRT configuration password if one was set at installation. At the time of writing, September 11, 2020, it appears that Vandyke, the creators of SecureCRT, have still not changed the implementation details for this session encryption algorithm.
This module ports the work from HyperSine and implements it in a Metasploit module that allows users to easily retrieve any SecureCRT session files from a compromised Windows machine and then decrypt the session passwords where its possible to do so. All session information retrieved will be stored a Metasploit loot file, along with the password if it can be decrypted.
Setup Steps
Download the latest installer of SecureCRT from https://www.vandyke.com/cgi-bin/releases.php?product=securecrt. You will need a valid login, which can be obtained by completing the registration form at https://www.vandyke.com/cgi-bin/download_application.php?pid=scrt_x64_873&force=1, after which an email will be sent to you with the valid login details.
Follow the installer's prompts to install the software. Select all the default settings.
Once everything has been installed, start SecureCRT. A prompt will appear asking if one wants to set a configuration passphrase to encrypt sensitive data such as saved passwords and login actions. Set a passphrase of your choice here, but be sure to remember it.
Set up a SSH server on your target. For Windows 10 v1809 and later and Windows Server 2019 and later, this can be done by running the PowerShell command
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
, followed byStart-Service sshd
.
Verification Steps
Use SecureCRT to login to a SSH server of your choosing. When logging in, remember to select the check boxes to save the username (should be selected by default), as well as the checkbox to save the account password.
Get a
meterpreter
session on the Windows host running SecureCRT.Do:
run post/windows/gather/credentials/securecrt
Optional: Run
set PASSPHRASE *SecureCRT configuration passphrase*
if a configuration passphrase was set for SecureCRT and you are aware of what its value is.If the session file was saved on the target, the module will print out the details of the host and port that the user connected to, as well as which username the user signed in with and the plaintext version of the password that was used.
Options
PASSPHRASE
The configuration password that was set when SecureCRT was installed, if one was supplied. Note that if this value is not supplied and SecureCRT was set up to use a configuration password, it will not be possible to decrypt the encrypted SecureCRT passwords that are retrieved.
SESSION_PATH
The path to the SecureCRT session directory on the target's computer. By default this is normally stored at C:\\Users\\*current user name*\\AppData\\Roaming\\VanDyke\\Config\\Sessions
if SecureCRT is installed on the system, however SecureCRT also has a portable version that stores the session information in a local folder along with the SecureCRT binary itself, allowing users to easily transfer their session information between machines. In this case, users can set the SESSION_PATH
option to the location of the session directory within the portable folder to allow them to obtain SecureCRT session information even if a portable version of SecureCRT is utilized on the target.