MAR-10334057-2.v1: Pulse Connect Secure
This report is provided "as is" for informational purposes only. The Department of Homeland Security (DHS) does not provide any warranties of any kind regarding any information contained herein. The DHS does not endorse any commercial product or service referenced in this bulletin or otherwise.
This document is marked TLP:WHITE--Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction. For more information on the Traffic Light Protocol (TLP), see http://www.cisa.gov/tlp.
CISA received two (2) files for analysis. The files are Pulse Secure Common Gateway Interface (CGI) scripts that have been modified. The primary purpose of these system modifications is to provide a remote operator Command and Control (C2) access over a compromised device running the modified scripts. This analysis is derived from malicious files found on Pulse Connect Secure devices.
For a downloadable copy of IOCs, see: MAR-10334057-2.v1.WHITE.stix.
Submitted Files (2)
No matches found.
This file is a Pulse Secure CGI script with malicious code patched to the end of the file (Figure 1, 2 and 3).
If the system receives a POST request that match any one of the following three conditions it will trigger the malicious code. Otherwise, it defaults to the original Pulse Secure application.
Condition 1: The attacker submits a RC4 encrypted and base64 encoded shell command under the 'cert' parameter. The command is base64 decoded and RC4 decrypted before it is executed. The command's output is sent to the attacker.
Condition 2: The attacker provides input to two parameters: 'img' and 'name', then it calls the function (sub c), which only processes input to the 'img' parameter. The input is base64 decoded and RC4 decrypted, then it is written to a file named tmp. The file is then RC4 encrypted and base64 encoded before being sent to the attacker.
Condition 3: The attacker submits RC4 encrypted and base64 encoded shell commands under the 'name' parameter, leaving the parameter 'img' blank. The shell command is base64 decoded and RC4 decrypted before it is executed, the command output is RC4 encrypted and base64 encoded before sending to the attacker.
The following functions describe the encryption scheme employed by the malware (Figure 1).
sub r: This function generates random bytes to be used in (sub a) for encryption.
sub a: First it calls the (sub r) function to obtain a random six bytes ($k), which is prepended to the hard coded passphrase ($ph) and forms the RC4 encryption key to encrypt the string ($st). The encrypted string is then base64 encoded.
sub b: First, it base64 decodes the input string. The decoded string ($s) is separated into the first six bytes ($k) and the rest without the first six bytes ($en). The first six bytes ($k) is prepended to the hard coded passphrase ($ph) and forms the RC4 decryption key ($k.$ph) to decrypt the string ($en).
Figure 1 - Screenshot of the patched in malicious code at the end of healthcheck.cgi. This section contains the encryption scheme employed by the malware.
Figure 2 - Screenshot of the patched in malicious code at the end of healthcheck.cgi, continued from Figure 1. This screenshot contains function (sub c) which is called under condition 2 and function (sub d) which is called under condition 1.
Figure 3 - Screenshot of the patched in malicious code at the end of healthcheck.cgi, continued from Figure 1. This screenshot contains function (sub e) which is called under condition 3 and the function (sub f) which decides the execution of functions (sub c, d and e) depending on the input parameters.
No matches found.
No matches found.
This file is a modified version of a Pulse Secure Perl CGI file (Figure 4). It is designed to perform an initial check to determine whether data was passed into the web application within a parameter named "id". If this parameter is provided, the code will extract its contents and execute them on the target system using the system() function. If no "id" parameter is passed to the application, the code will simply execute the main() function of the original Pulse Secure application.
Figure 4 - Screenshot of the malicious code patched-in to the end-of-file.
CISA recommends that users and administrators consider using the following best practices to strengthen the security posture of their organization's systems. Any configuration changes should be reviewed by system owners and administrators prior to implementation to avoid unwanted impacts.
Additional information on malware incident prevention and handling can be found in National Institute of Standards and Technology (NIST) Special Publication 800-83, "Guide to Malware Incident Prevention & Handling for Desktops and Laptops".
CISA continuously strives to improve its products and services. You can help by answering a very short series of questions about this product at the following URL: https://us-cert.cisa.gov/forms/feedback/
What is a MIFR? A Malware Initial Findings Report (MIFR) is intended to provide organizations with malware analysis in a timely manner. In most instances this report will provide initial indicators for computer and network defense. To request additional analysis, please contact CISA and provide information regarding the level of desired analysis.
What is a MAR? A Malware Analysis Report (MAR) is intended to provide organizations with more detailed malware analysis acquired via manual reverse engineering. To request additional analysis, please contact CISA and provide information regarding the level of desired analysis.
Can I edit this document? This document is not to be edited in any way by recipients. All comments or questions related to this document should be directed to the CISA at 1-888-282-0870 or CISA Central.
Can I submit malware to CISA? Malware samples can be submitted via three methods:
CISA encourages you to report any suspicious activity, including cybersecurity incidents, possible malicious code, software vulnerabilities, and phishing-related scams. Reporting forms can be found on CISA's homepage at www.cisa.gov.
July 21, 2021: Initial Version