System Public IP Discovery via DNS Query

Identifies DNS queries to known public IP address lookup web services. Malwares tend to perform this action to assess potential targets.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2025/08/20"
  3integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "crowdstrike"]
  4maturity = "production"
  5updated_date = "2025/08/20"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies DNS queries to known public IP address lookup web services. Malwares tend to perform this action to assess potential targets.
 11"""
 12from = "now-9m"
 13index = [
 14    "endgame-*",
 15    "logs-endpoint.events.network-*",
 16    "logs-sentinel_one_cloud_funnel.*",
 17    "logs-crowdstrike.fdr*",
 18    "logs-windows.forwarded*",
 19    "logs-windows.sysmon_operational-*",
 20    "winlogbeat-*"
 21]
 22language = "eql"
 23license = "Elastic License v2"
 24name = "System Public IP Discovery via DNS Query"
 25note = """## Triage and analysis
 26
 27### Investigating System Public IP Discovery via DNS Query
 28
 29#### Possible investigation steps
 30
 31- Investigate the process execution chain (parent process tree) for unknown processes or malicious scripts.
 32- Verify if the executed process is persistent on the host like common mechanisms Startup folder, task or Run key.
 33- Review any unusual network, files or registry events by the same process.
 34- Investigate other alerts associated with the user/host during the past 48 hours.
 35- Extract this communication's indicators of compromise (IoCs) and use traffic logs to search for other potentially compromised hosts.
 36
 37### False positive analysis
 38
 39- Trusted domain from an expected process running in the environment.
 40
 41### Response and remediation
 42
 43- Initiate the incident response process based on the outcome of the triage.
 44- Isolate the involved host to prevent further post-compromise behavior.
 45- Immediately block the identified indicators of compromise (IoCs).
 46- Implement any temporary network rules, procedures, and segmentation required to contain the attack.
 47- 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.
 48- Update firewall rules to be more restrictive.
 49- Reimage the host operating system or restore the compromised files to clean versions.
 50- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 51- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 52- 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).
 53"""
 54references = ["https://attack.mitre.org/techniques/T1016/"]
 55risk_score = 73
 56rule_id = "642ce354-4252-4d43-80c9-6603f16571c1"
 57severity = "high"
 58tags = [
 59    "Domain: Endpoint",
 60    "OS: Windows",
 61    "Use Case: Threat Detection",
 62    "Tactic: Discovery",
 63    "Tactic: Command and Control",
 64    "Resources: Investigation Guide",
 65    "Data Source: Elastic Endgame",
 66    "Data Source: Elastic Defend",
 67    "Data Source: SentinelOne",
 68    "Data Source: Crowdstrike",
 69    "Data Source: Sysmon",
 70]
 71timestamp_override = "event.ingested"
 72type = "eql"
 73
 74query = '''
 75network where host.os.type == "windows" and dns.question.name != null and
 76(
 77  process.name : ("MSBuild.exe", "mshta.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "msiexec.exe", "rundll32.exe",
 78  "bitsadmin.exe", "InstallUtil.exe", "RegAsm.exe", "vbc.exe", "RegSvcs.exe", "python.exe", "regsvr32.exe", "dllhost.exe",
 79  "node.exe", "javaw.exe", "java.exe", "*.pif", "*.com") or
 80
 81  ?process.code_signature.trusted != true or
 82
 83  ?process.code_signature.subject_name : ("AutoIt Consulting Ltd", "OpenJS Foundation", "Python Software Foundation") or
 84
 85  ?process.executable : ("?:\\Users\\*.exe", "", "?:\\ProgramData\\*.exe",  "?\\Device\\HarddiskVolume?\\Users\\*.exe",  "?\\Device\\HarddiskVolume?\\ProgramData\\*.exe")
 86 ) and
 87 dns.question.name :
 88         (
 89          "ip-api.com",
 90          "checkip.dyndns.org",
 91          "api.ipify.org",
 92          "api.ipify.com",
 93          "whatismyip.akamai.com",
 94          "bot.whatismyipaddress.com",
 95          "ifcfg.me",
 96          "ident.me",
 97          "ipof.in",
 98          "ip.tyk.nu",
 99          "icanhazip.com",
100          "curlmyip.com",
101          "wgetip.com",
102          "eth0.me",
103          "ipecho.net",
104          "ip.appspot.com",
105          "api.myip.com",
106          "geoiptool.com",
107          "api.2ip.ua",
108          "api.ip.sb",
109          "ipinfo.io",
110          "checkip.amazonaws.com",
111          "wtfismyip.com",
112          "iplogger.*",
113          "freegeoip.net",
114          "freegeoip.app",
115          "ipinfo.io",
116          "geoplugin.net",
117          "myip.dnsomatic.com",
118          "www.geoplugin.net",
119          "api64.ipify.org",
120          "ip4.seeip.org",
121          "*.geojs.io",
122          "*portmap.io",
123          "api.2ip.ua",
124          "api.db-ip.com",
125          "geolocation-db.com",
126          "httpbin.org",
127          "myip.opendns.com"
128         )
129'''
130
131
132[[rule.threat]]
133framework = "MITRE ATT&CK"
134[[rule.threat.technique]]
135id = "T1016"
136name = "System Network Configuration Discovery"
137reference = "https://attack.mitre.org/techniques/T1016/"
138
139
140[rule.threat.tactic]
141id = "TA0007"
142name = "Discovery"
143reference = "https://attack.mitre.org/tactics/TA0007/"
144
145
146[[rule.threat]]
147framework = "MITRE ATT&CK"
148[[rule.threat.technique]]
149id = "T1071"
150name = "Application Layer Protocol"
151reference = "https://attack.mitre.org/techniques/T1071/"
152[[rule.threat.technique.subtechnique]]
153id = "T1071.004"
154name = "DNS"
155reference = "https://attack.mitre.org/techniques/T1071/004/"
156
157
158[rule.threat.tactic]
159id = "TA0011"
160name = "Command and Control"
161reference = "https://attack.mitre.org/tactics/TA0011/"

Triage and analysis

Investigating System Public IP Discovery via DNS Query

Possible investigation steps

  • Investigate the process execution chain (parent process tree) for unknown processes or malicious scripts.
  • Verify if the executed process is persistent on the host like common mechanisms Startup folder, task or Run key.
  • Review any unusual network, files or registry events by the same process.
  • Investigate other alerts associated with the user/host during the past 48 hours.
  • Extract this communication's indicators of compromise (IoCs) and use traffic logs to search for other potentially compromised hosts.

False positive analysis

  • Trusted domain from an expected process running in the environment.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved host to prevent further post-compromise behavior.
  • Immediately block the identified indicators of compromise (IoCs).
  • Implement any temporary network rules, procedures, and segmentation required to contain the attack.
  • 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.
  • Update firewall rules to be more restrictive.
  • Reimage the host operating system or restore the compromised files to clean versions.
  • 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 through 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

to-top