External IP Lookup from Non-Browser Process
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.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/09/04"
3integration = ["endpoint"]
4maturity = "production"
5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
6min_stack_version = "8.3.0"
7updated_date = "2023/06/22"
8
9[rule]
10author = ["Elastic"]
11description = """
12Identifies domains commonly used by adversaries for post-exploitation IP lookups. It is common for adversaries to test
13for Internet access and acquire their external IP address after they have gained access to a system. Among others, this
14has been observed in campaigns leveraging the information stealer, Trickbot.
15"""
16false_positives = [
17 """
18 If the domains listed in this rule are used as part of an authorized workflow, this rule will be triggered by those
19 events. Validate that this is expected activity and tune the rule to fit your environment variables.
20 """,
21]
22from = "now-9m"
23index = ["logs-endpoint.events.*"]
24language = "eql"
25license = "Elastic License v2"
26name = "External IP Lookup from Non-Browser Process"
27note = """## Triage and analysis
28
29### Investigating External IP Lookup from Non-Browser Process
30
31After 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.
32
33This 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.
34
35#### Possible investigation steps
36
37- 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.
38- Identify the user account that performed the action and whether it should perform this kind of action.
39- Contact the account owner and confirm whether they are aware of this activity.
40- Investigate other alerts associated with the user/host during the past 48 hours.
41- Investigate abnormal behaviors observed by the subject process, such as network connections, registry or file modifications, and any spawned child processes.
42
43### False positive analysis
44
45- 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.
46- 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.
47
48### Response and remediation
49
50- Initiate the incident response process based on the outcome of the triage.
51- Isolate the involved hosts to prevent further post-compromise behavior.
52- Use the data collected through the analysis to investigate other machines affected in the environment.
53- 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.
54- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
55- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
56- 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).
57"""
58references = [
59 "https://community.jisc.ac.uk/blogs/csirt/article/trickbot-analysis-and-mitigation",
60 "https://www.cybereason.com/blog/dropping-anchor-from-a-trickbot-infection-to-the-discovery-of-the-anchor-malware",
61]
62risk_score = 21
63rule_id = "1d72d014-e2ab-4707-b056-9b96abe7b511"
64severity = "low"
65tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Discovery", "Resources: Investigation Guide", "Data Source: Elastic Defend"]
66timestamp_override = "event.ingested"
67type = "eql"
68
69query = '''
70network where host.os.type == "windows" and network.protocol == "dns" and
71 process.name != null and user.id not in ("S-1-5-19", "S-1-5-20") and
72 event.action == "lookup_requested" and
73 /* Add new external IP lookup services here */
74 dns.question.name :
75 (
76 "*api.ipify.org",
77 "*freegeoip.app",
78 "*checkip.amazonaws.com",
79 "*checkip.dyndns.org",
80 "*freegeoip.app",
81 "*icanhazip.com",
82 "*ifconfig.*",
83 "*ipecho.net",
84 "*ipgeoapi.com",
85 "*ipinfo.io",
86 "*ip.anysrc.net",
87 "*myexternalip.com",
88 "*myipaddress.com",
89 "*showipaddress.com",
90 "*whatismyipaddress.com",
91 "*wtfismyip.com",
92 "*ipapi.co",
93 "*ip-lookup.net",
94 "*ipstack.com"
95 ) and
96 /* Insert noisy false positives here */
97 not process.executable :
98 (
99 "?:\\Program Files\\*.exe",
100 "?:\\Program Files (x86)\\*.exe",
101 "?:\\Windows\\System32\\WWAHost.exe",
102 "?:\\Windows\\System32\\smartscreen.exe",
103 "?:\\Windows\\System32\\MicrosoftEdgeCP.exe",
104 "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
105 "?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
106 "?:\\Users\\*\\AppData\\Local\\Programs\\Fiddler\\Fiddler.exe",
107 "?:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",
108 "?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe"
109 )
110'''
111
112
113[[rule.threat]]
114framework = "MITRE ATT&CK"
115[[rule.threat.technique]]
116id = "T1016"
117name = "System Network Configuration Discovery"
118reference = "https://attack.mitre.org/techniques/T1016/"
119[[rule.threat.technique.subtechnique]]
120id = "T1016.001"
121name = "Internet Connection Discovery"
122reference = "https://attack.mitre.org/techniques/T1016/001/"
123
124
125[[rule.threat.technique]]
126id = "T1614"
127name = "System Location Discovery"
128reference = "https://attack.mitre.org/techniques/T1614/"
129
130
131[rule.threat.tactic]
132id = "TA0007"
133name = "Discovery"
134reference = "https://attack.mitre.org/tactics/TA0007/"
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).
References
Related rules
- Account Discovery Command via SYSTEM Account
- AdFind Command Activity
- Enumerating Domain Trusts via DSQUERY.EXE
- Enumerating Domain Trusts via NLTEST.EXE
- Enumeration of Administrator Accounts