Hping Process Activity

Hping ran on a Linux host. Hping is a FOSS command-line packet analyzer and has the ability to construct network packets for a wide variety of network security testing applications, including scanning and firewall auditing.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/02/18"
  3integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_funnel"]
  4maturity = "production"
  5min_stack_version = "8.13.0"
  6min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
  7updated_date = "2025/02/04"
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Hping ran on a Linux host. Hping is a FOSS command-line packet analyzer and has the ability to construct network packets
 13for a wide variety of network security testing applications, including scanning and firewall auditing.
 14"""
 15false_positives = [
 16    """
 17    Normal use of hping is uncommon apart from security testing and research. Use by non-security engineers is very
 18    uncommon.
 19    """,
 20]
 21from = "now-9m"
 22index = ["auditbeat-*", "endgame-*", "logs-auditd_manager.auditd-*", "logs-crowdstrike.fdr*", "logs-endpoint.events.process*", "logs-sentinel_one_cloud_funnel.*"]
 23language = "eql"
 24license = "Elastic License v2"
 25name = "Hping Process Activity"
 26references = ["https://en.wikipedia.org/wiki/Hping"]
 27risk_score = 47
 28rule_id = "90169566-2260-4824-b8e4-8615c3b4ed52"
 29setup = """## Setup
 30
 31This rule requires data coming in from one of the following integrations:
 32- Elastic Defend
 33- Auditbeat
 34
 35### Elastic Defend Integration Setup
 36Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
 37
 38#### Prerequisite Requirements:
 39- Fleet is required for Elastic Defend.
 40- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 41
 42#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
 43- Go to the Kibana home page and click "Add integrations".
 44- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 45- Click "Add Elastic Defend".
 46- Configure the integration name and optionally add a description.
 47- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 48- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
 49- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 50- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
 51For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
 52- Click "Save and Continue".
 53- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
 54For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 55
 56### Auditbeat Setup
 57Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.
 58
 59#### The following steps should be executed in order to add the Auditbeat on a Linux System:
 60- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
 61- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).
 62- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
 63- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
 64- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
 65"""
 66severity = "medium"
 67tags = [
 68    "Domain: Endpoint",
 69    "OS: Linux",
 70    "Use Case: Threat Detection",
 71    "Tactic: Discovery",
 72    "Data Source: Elastic Endgame",
 73    "Data Source: Elastic Defend",
 74    "Data Source: Auditd Manager",
 75    "Data Source: Crowdstrike",
 76    "Data Source: SentinelOne",
 77    "Resources: Investigation Guide",
 78]
 79timestamp_override = "event.ingested"
 80type = "eql"
 81
 82query = '''
 83process where host.os.type == "linux" and event.type == "start" and
 84 event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
 85 process.name in ("hping", "hping2", "hping3")
 86'''
 87note = """## Triage and analysis
 88
 89> **Disclaimer**:
 90> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
 91
 92### Investigating Hping Process Activity
 93
 94Hping is a versatile command-line tool used for crafting and analyzing network packets, often employed in network security testing. Adversaries may exploit Hping to perform reconnaissance, such as scanning networks or probing firewalls, to gather system information. The detection rule identifies Hping's execution on Linux systems by monitoring specific process start events, helping to flag potential misuse indicative of discovery tactics.
 95
 96### Possible investigation steps
 97
 98- Review the process start event details to confirm the execution of Hping, focusing on the process.name field to ensure it matches "hping", "hping2", or "hping3".
 99- Identify the user account associated with the Hping process by examining the user context in the event data to determine if the activity aligns with expected behavior for that user.
100- Analyze the command line arguments used with the Hping process to understand the intent of the execution, such as specific network targets or options that indicate scanning or probing activities.
101- Check the timing and frequency of the Hping process execution to assess whether it aligns with routine network testing schedules or if it appears anomalous.
102- Investigate the source and destination IP addresses involved in the Hping activity to identify potential targets and assess whether they are internal or external to the organization.
103- Correlate the Hping activity with other security events or alerts from the same host or network segment to identify any related suspicious activities or patterns.
104- Consult with the system owner or network security team to verify if the Hping activity was authorized as part of legitimate security testing or if it requires further investigation.
105
106### False positive analysis
107
108- Routine network testing by IT teams may trigger the rule when using Hping for legitimate purposes. To manage this, create exceptions for known IP addresses or user accounts involved in regular network audits.
109- Automated scripts or cron jobs that utilize Hping for monitoring network performance can lead to false positives. Identify these scripts and exclude their execution paths or associated user accounts from the detection rule.
110- Security training exercises or penetration testing activities might involve Hping usage. Coordinate with security teams to whitelist these activities by specifying time windows or specific user roles.
111- Development or testing environments where Hping is used for application testing can cause alerts. Exclude these environments by filtering based on hostnames or network segments associated with non-production systems.
112
113### Response and remediation
114
115- Immediately isolate the affected Linux host from the network to prevent further reconnaissance or potential lateral movement by the adversary.
116- Terminate any active Hping processes on the affected host to stop ongoing packet crafting or network probing activities.
117- Conduct a thorough review of network logs and firewall configurations to identify any unauthorized access or anomalies that may have been exploited using Hping.
118- Perform a comprehensive scan of the affected system for additional indicators of compromise, such as unauthorized user accounts or unexpected changes to system files.
119- Reset credentials and review access permissions for accounts on the affected host to ensure no unauthorized access persists.
120- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
121- Update detection and monitoring systems to enhance visibility and alerting for similar reconnaissance activities, ensuring rapid response to future threats."""
122
123
124[[rule.threat]]
125framework = "MITRE ATT&CK"
126[[rule.threat.technique]]
127id = "T1082"
128name = "System Information Discovery"
129reference = "https://attack.mitre.org/techniques/T1082/"
130
131
132[rule.threat.tactic]
133id = "TA0007"
134name = "Discovery"
135reference = "https://attack.mitre.org/tactics/TA0007/"

Triage and analysis

Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

Investigating Hping Process Activity

Hping is a versatile command-line tool used for crafting and analyzing network packets, often employed in network security testing. Adversaries may exploit Hping to perform reconnaissance, such as scanning networks or probing firewalls, to gather system information. The detection rule identifies Hping's execution on Linux systems by monitoring specific process start events, helping to flag potential misuse indicative of discovery tactics.

Possible investigation steps

  • Review the process start event details to confirm the execution of Hping, focusing on the process.name field to ensure it matches "hping", "hping2", or "hping3".
  • Identify the user account associated with the Hping process by examining the user context in the event data to determine if the activity aligns with expected behavior for that user.
  • Analyze the command line arguments used with the Hping process to understand the intent of the execution, such as specific network targets or options that indicate scanning or probing activities.
  • Check the timing and frequency of the Hping process execution to assess whether it aligns with routine network testing schedules or if it appears anomalous.
  • Investigate the source and destination IP addresses involved in the Hping activity to identify potential targets and assess whether they are internal or external to the organization.
  • Correlate the Hping activity with other security events or alerts from the same host or network segment to identify any related suspicious activities or patterns.
  • Consult with the system owner or network security team to verify if the Hping activity was authorized as part of legitimate security testing or if it requires further investigation.

False positive analysis

  • Routine network testing by IT teams may trigger the rule when using Hping for legitimate purposes. To manage this, create exceptions for known IP addresses or user accounts involved in regular network audits.
  • Automated scripts or cron jobs that utilize Hping for monitoring network performance can lead to false positives. Identify these scripts and exclude their execution paths or associated user accounts from the detection rule.
  • Security training exercises or penetration testing activities might involve Hping usage. Coordinate with security teams to whitelist these activities by specifying time windows or specific user roles.
  • Development or testing environments where Hping is used for application testing can cause alerts. Exclude these environments by filtering based on hostnames or network segments associated with non-production systems.

Response and remediation

  • Immediately isolate the affected Linux host from the network to prevent further reconnaissance or potential lateral movement by the adversary.
  • Terminate any active Hping processes on the affected host to stop ongoing packet crafting or network probing activities.
  • Conduct a thorough review of network logs and firewall configurations to identify any unauthorized access or anomalies that may have been exploited using Hping.
  • Perform a comprehensive scan of the affected system for additional indicators of compromise, such as unauthorized user accounts or unexpected changes to system files.
  • Reset credentials and review access permissions for accounts on the affected host to ensure no unauthorized access persists.
  • Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
  • Update detection and monitoring systems to enhance visibility and alerting for similar reconnaissance activities, ensuring rapid response to future threats.

References

Related rules

to-top