Detecting and Handling Reverse Shell Attacks
Overview
A reverse shell is a network attack technique in which an attacker tricks the target server into initiating a connection to the attacker's server, thereby obtaining command-line (shell) access and control over the compromised server.
The following figure shows how it launches attacks.
- The attacker listens to a port on a server under their control.
- The attacker executes malicious code on the target server by exploiting vulnerabilities.
- The malicious code instructs the target server to proactively connect to the attacker's server.
- After the connection is established, the attacker obtains the shell control of the target server.
Application Scenarios
Traditional security measures cannot effectively identify reverse shell attacks, as the communication traffic is hidden and the behavior characteristics are ambiguous. Once an attack succeeds, the attacker can fully compromise the victim server, leading to severe consequences such as data leakage and service interruption.
HSS provides comprehensive protection against reverse shell attacks through intelligent detection, instant alerting, and automatic threat blocking.
- Intelligent detection: monitors abnormal connection behavior in real time and accurately identifies reverse shell characteristics.
- Instant alerting: notifies the security team immediately upon threat detection, reducing response time.
- Automatic blocking: automatically disconnects malicious connections without manual intervention, preventing the spread of attacks.
Architecture
For common reverse shell attacks, HSS mainly monitors the system calls initiated by the shell process. For some advanced reverse shells, HSS mainly detects socket inheritance and redirection.
HSS has different policies to accurately detect common reverse shells and efficiently capture special reverse shells, offering comprehensive protection for your servers.
Resource and Cost Planning
| Resource | Description | Cost Description |
|---|---|---|
| Host Security Service (HSS) | HSS premium edition. The premium edition is used as an example in this practice. For more HSS editions that support reverse shell detection, see Functions. | For details about billing rules, see Billing Description. |
Solution
The following describes how to detect and handle reverse shell attacks.
Step 1: Enable Reverse Shell Detection
- Log in to the HSS console.
- Buy an HSS edition that supports reverse shell detection. After you install the agent and enable protection, HSS will support reverse shell detection by default. For details, see Access Process.
Step 2: Handle Reverse Shell Alarms
- On the HSS console, choose .
- In the Alarm Types area, choose to check reverse shell alarms. Figure 3 Checking alarms
- Click an alarm name to check alarm details. Figure 4 Alarm details
- Analyze the alarm based on the alarm details. The key indicators are as follows:
- Alarm severity: If the alarm severity is high, handle the alarm as soon as possible.
- Investigation and forensics: The IP address, port, user, and process information related to the attack are displayed.
- Handle the alarm based on the analysis result.
- Real attack: Handle the alarm based on the measures provided in Suggestions and click Marked as handled.
- Non-attack: Click Ignore or Add to alarm whitelist.
Step 3: Enable Automatic Reverse Shell Blocking
Automatic reverse shell blocking depends on HIPS detection and malicious program isolation and killing. Enabling this function can further harden security.
- Log in to the HSS console.
- Choose .
- Click the name of the policy group used for the target asset to go to the policy details page.
- Click HIPS Detection and enable Auto Blocking. Figure 5 HIPS Detection
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot