External IP Lookup from Non-Browser Processedit

Identifies domains commonly used by adversaries for post-exploitation IP lookups. It is common for adversaries to test for Internet access and acquire their external IP address after they have gained access to a system. Among others, this has been observed in campaigns leveraging the information stealer, Trickbot.

Rule type: eql

Rule indices:

  • logs-endpoint.events.*

Severity: low

Risk score: 21

Runs every: 5 minutes

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100

References:

Tags:

  • Elastic
  • Host
  • Windows
  • Threat Detection
  • Discovery
  • Investigation Guide

Version: 102 (version history)

Added (Elastic Stack release): 7.10.0

Last modified (Elastic Stack release): 8.6.0

Rule authors: Elastic

Rule license: Elastic License v2

Potential false positivesedit

If the domains listed in this rule are used as part of an authorized workflow, this rule will be triggered by those events. Validate that this is expected activity and tune the rule to fit your environment variables.

Investigation guideedit

## Triage and analysis

### Investigating External IP Lookup from Non-Browser Process

After successfully compromising an environment, attackers may try to gain situational awareness to plan their next steps.
This can happen by running commands to enumerate network resources, users, connections, files, and installed security
software.

This rule looks for connections to known IP lookup services through non-browser processes or non-installed programs.
Using only the IP address of the compromised system, attackers can obtain valuable information such as the system's
geographic location, the company that owns the IP, whether the system is cloud-hosted, and more.

#### Possible investigation steps

- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files
for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the account owner and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Investigate abnormal behaviors observed by the subject process, such as network connections, registry or file
modifications, and any spawned child processes.

### False positive analysis

- Discovery activities are not inherently malicious if they occur in isolation. As long as the analyst did not identify
suspicious activity related to the user or host, such alerts can be dismissed.
- If this rule is noisy in your environment due to expected activity, consider adding exceptions — preferably with a combination
of user and command line conditions.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved hosts to prevent further post-compromise behavior.
- Use the data collected through the analysis to investigate other machines affected in the environment.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are
identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business
systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and
malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the
mean time to respond (MTTR).

Rule queryedit

network where network.protocol == "dns" and process.name != null
and user.id not in ("S-1-5-19", "S-1-5-20") and event.action ==
"lookup_requested" and /* Add new external IP lookup services here
*/ dns.question.name : ( "*api.ipify.org",
"*freegeoip.app", "*checkip.amazonaws.com",
"*checkip.dyndns.org", "*freegeoip.app",
"*icanhazip.com", "*ifconfig.*", "*ipecho.net",
"*ipgeoapi.com", "*ipinfo.io", "*ip.anysrc.net",
"*myexternalip.com", "*myipaddress.com",
"*showipaddress.com", "*whatismyipaddress.com",
"*wtfismyip.com", "*ipapi.co", "*ip-lookup.net",
"*ipstack.com" ) and /* Insert noisy false positives here */
not process.executable : ( "?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\WWAHost.exe",
"?:\\Windows\\System32\\smartscreen.exe",
"?:\\Windows\\System32\\MicrosoftEdgeCP.exe",
"?:\\ProgramData\\Microsoft\\Windows
Defender\\Platform\\*\\MsMpEng.exe", "?:\\Users\\*\\AppData\\Loc
al\\Google\\Chrome\\Application\\chrome.exe",
"?:\\Users\\*\\AppData\\Local\\Programs\\Fiddler\\Fiddler.exe",
"?:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",
"?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe"
)

Threat mappingedit

Framework: MITRE ATT&CKTM

Rule version historyedit

Version 102 (8.6.0 release)
  • Formatting only
Version 101 (8.5.0 release)
  • Formatting only
Version 10 (8.4.0 release)
  • Formatting only
Version 8 (8.3.0 release)
  • Formatting only
Version 7 (8.1.0 release)
  • Formatting only
Version 6 (7.15.0 release)
  • Rule name changed from: External IP Lookup fron Non-Browser Process
Version 5 (7.14.0 release)
  • Updated query, changed from:

    network where network.protocol == "dns" and process.name != null
    and user.id not in ("S-1-5-19", "S-1-5-20") and event.action ==
    "lookup_requested" and /* Add new external IP lookup services here
    */ dns.question.name : ( "*api.ipify.org",
    "*freegeoip.app", "*checkip.amazonaws.com",
    "*checkip.dyndns.org", "*freegeoip.app",
    "*icanhazip.com", "*ifconfig.*", "*ipecho.net",
    "*ipgeoapi.com", "*ipinfo.io", "*ip.anysrc.net",
    "*myexternalip.com", "*myipaddress.com",
    "*showipaddress.com", "*whatismyipaddress.com",
    "*wtfismyip.com" ) and /* Insert noisy false positives here */
    not process.executable : ( "?:\\Program Files\\*.exe",
    "?:\\Program Files (x86)\\*.exe",
    "?:\\Windows\\System32\\WWAHost.exe",
    "?:\\Windows\\System32\\smartscreen.exe",
    "?:\\Windows\\System32\\MicrosoftEdgeCP.exe",
    "?:\\ProgramData\\Microsoft\\Windows
    Defender\\Platform\\*\\MsMpEng.exe", "?:\\Users\\*\\AppData\\Loc
    al\\Google\\Chrome\\Application\\chrome.exe",
    "?:\\Users\\*\\AppData\\Local\\Programs\\Fiddler\\Fiddler.exe",
    "?:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",
    "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe"
    )
Version 4 (7.13.0 release)
  • Rule name changed from: Public IP Reconnaissance Activity
  • Updated query, changed from:

    event.category:network AND event.type:connection AND
    server.domain:(ipecho.net OR ipinfo.io OR ifconfig.co OR ifconfig.me
    OR icanhazip.com OR myexternalip.com OR api.ipify.org OR
    bot.whatismyipaddress.com OR ip.anysrc.net OR wtfismyip.com) AND NOT
    http.response.status_code:302 AND status:OK AND NOT
    _exists_:http.request.referrer
Version 3 (7.12.0 release)
  • Formatting only
Version 2 (7.11.2 release)
  • Formatting only