Detection rule
External Remote RDP Logon from Public IP
Overview
Detects successful logon from public IP address via RDP. This can indicate a publicly-exposed RDP port.
- Rule id
259a9cdf-c4dd-4fa2-b243-2269e5ab18a2- ATT&CK techniques
- T1078 Valid Accounts, T1110 Brute Force, T1133 External Remote Services
- Severity
- Medium
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- n0n, The Gentlemen, qilin, INC Ransom, Akira, safepay, Play, nightspire
Validation
- ExperimentalSyntax checked only. Not yet tested on events.
- Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
- SIEM-validatedRun in a real SIEM, with a recorded result.
1 of 1 positive test events matched; 2 of 2 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.
Detection logic and queries
Queries are shown exactly as generated. Test them in your environment before you deploy them.
Sigma
Sigma (YAML) · 259a9cdf-c4dd-4fa2-b243-2269e5ab18a2
title: External Remote RDP Logon from Public IP
id: 259a9cdf-c4dd-4fa2-b243-2269e5ab18a2
related:
- id: 78d5cab4-557e-454f-9fb9-a222bd0d5edc
type: derived
status: test
description: Detects successful logon from public IP address via RDP. This can indicate a publicly-exposed RDP port.
references:
- https://www.inversecos.com/2020/04/successful-4624-anonymous-logons-to.html
- https://twitter.com/Purp1eW0lf/status/1616144561965002752
author: Micah Babinski (@micahbabinski), Zach Mathis (@yamatosecurity)
date: 2023-01-19
modified: 2026-11-03
tags:
- attack.privilege-escalation
- attack.persistence
- attack.initial-access
- attack.credential-access
- attack.stealth
- attack.t1133
- attack.t1078
- attack.t1110
logsource:
product: windows
service: security
detection:
selection:
EventID: 4624
LogonType: 10
filter_main_local_ranges:
IpAddress|cidr:
- '::1/128' # IPv6 loopback
- '10.0.0.0/8'
- '127.0.0.0/8'
- '172.16.0.0/12'
- '192.168.0.0/16'
- '169.254.0.0/16'
- 'fc00::/7' # IPv6 private addresses
- 'fe80::/10' # IPv6 link-local addresses
filter_main_null:
IpAddress: null
filter_main_empty:
IpAddress:
- '-'
- ''
condition: selection and not 1 of filter_main_*
falsepositives:
- Legitimate or intentional inbound connections from public IP addresses on the RDP port.
level: mediumQRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: External Remote RDP Logon from Public IP- Rule type
- Event rule (Local)
- Log source types
- Microsoft Windows Security Event Log DSM (Security channel)
Building blocks
BB:OffSet7:External Remote RDP Logon from Public IP:selection(match)All test lines must match (AND).Event IDis equal to (case-insensitive):4624Logon Typeis equal to (case-insensitive):10
BB:OffSet7:External Remote RDP Logon from Public IP:filter_main_local_ranges(exclusion)All test lines must match (AND).- custom property needed:
IpAddressis in the network (CIDR):::1/128,10.0.0.0/8,127.0.0.0/8,172.16.0.0/12,192.168.0.0/16,169.254.0.0/16,fc00::/7,fe80::/10No QRadar property mapped for "IpAddress": create a custom event property (regex or JSON) on the DSM first.
- custom property needed:
BB:OffSet7:External Remote RDP Logon from Public IP:filter_main_null(exclusion)All test lines must match (AND).- custom property needed:
IpAddressis equal to (case-insensitive):No QRadar property mapped for "IpAddress": create a custom event property (regex or JSON) on the DSM first.
- custom property needed:
BB:OffSet7:External Remote RDP Logon from Public IP:filter_main_empty(exclusion)All test lines must match (AND).- custom property needed:
IpAddressis equal to (case-insensitive):-No QRadar property mapped for "IpAddress": create a custom event property (regex or JSON) on the DSM first.
- custom property needed:
Main rule, option A (building blocks)
- when the event(s) were detected by one or more of these log source types:
Microsoft Windows Security Event Log DSM (Security channel) - when an event matches the condition built from these building blocks:
BB:OffSet7:External Remote RDP Logon from Public IP:selection AND NOT (ANY of [BB:OffSet7:External Remote RDP Logon from Public IP:filter_main_local_ranges, BB:OffSet7:External Remote RDP Logon from Public IP:filter_main_null, BB:OffSet7:External Remote RDP Logon from Public IP:filter_main_empty])
Main rule, option B (AQL filter test)
Not available: the AQL conversion failed for this rule.
Rule response
- Severity 5, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)
Limitations
- AQL conversion failed (field 'IpAddress' is not supported); only the building-block design is available.
- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.
Splunk
Splunk SPLSearch
Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.
source="WinEventLog:Security" EventCode=4624 LogonType=10 NOT (IpAddress="::1/128" OR IpAddress="10.0.0.0/8" OR IpAddress="127.0.0.0/8" OR IpAddress="172.16.0.0/12" OR IpAddress="192.168.0.0/16" OR IpAddress="169.254.0.0/16" OR IpAddress="fc00::/7" OR IpAddress="fe80::/10" OR NOT IpAddress=* OR IpAddress IN ("-", ""))Splunk savedsearches.conf stanzaScheduled search template
Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.
[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now
[External Remote RDP Logon from Public IP]
description = Detects successful logon from public IP address via RDP. This can indicate a publicly-exposed RDP port.
search = source="WinEventLog:Security" EventCode=4624 LogonType=10 NOT (IpAddress="::1/128" OR IpAddress="10.0.0.0/8" OR IpAddress="127.0.0.0/8" OR IpAddress="172.16.0.0/12" OR IpAddress="192.168.0.0/16" OR IpAddress="169.254.0.0/16" OR IpAddress="fc00::/7" OR IpAddress="fe80::/10" OR NOT IpAddress=* OR IpAddress IN ("-", ""))Microsoft Sentinel
Microsoft Sentinel KQL (ASIM)Hunting query
Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.
SecurityEvent
| where (EventID == 4624 and LogonType == 10) and (not(((ipv4_is_in_range(IpAddress, "::1/128") or ipv4_is_in_range(IpAddress, "10.0.0.0/8") or ipv4_is_in_range(IpAddress, "127.0.0.0/8") or ipv4_is_in_range(IpAddress, "172.16.0.0/12") or ipv4_is_in_range(IpAddress, "192.168.0.0/16") or ipv4_is_in_range(IpAddress, "169.254.0.0/16") or ipv4_is_in_range(IpAddress, "fc00::/7") or ipv4_is_in_range(IpAddress, "fe80::/10")) or isnull(IpAddress) or (IpAddress in~ ("-", "")))))Elastic
Elastic Lucene (ECS)Hunting query
Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.
winlog.channel:Security AND ((event.code:4624 AND winlog.event_data.LogonType:10) AND (NOT ((source.ip:\:\:1\/128 OR source.ip:10.0.0.0\/8 OR source.ip:127.0.0.0\/8 OR source.ip:172.16.0.0\/12 OR source.ip:192.168.0.0\/16 OR source.ip:169.254.0.0\/16 OR source.ip:fc00\:\:\/7 OR source.ip:fe80\:\:\/10) OR (NOT _exists_:source.ip) OR (source.ip:(\- OR "")))))Elastic EQL (ECS)Hunting query
EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.
any where winlog.channel:"Security" and ((event.code:"4624" and winlog.event_data.LogonType:"10") and (not ((cidrMatch(source.ip, "::1/128") or cidrMatch(source.ip, "10.0.0.0/8") or cidrMatch(source.ip, "127.0.0.0/8") or cidrMatch(source.ip, "172.16.0.0/12") or cidrMatch(source.ip, "192.168.0.0/16") or cidrMatch(source.ip, "169.254.0.0/16") or cidrMatch(source.ip, "fc00::/7") or cidrMatch(source.ip, "fe80::/10")) or (?source.ip == null) or (source.ip like~ ("-", "")))))Elastic ES|QL (ECS)Hunting query
ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.
from * metadata _id, _index, _version | where winlog.channel=="Security" and event.code=="4624" and winlog.event_data.LogonType=="10" and not (cidr_match(source.ip, "::1/128") or cidr_match(source.ip, "10.0.0.0/8") or cidr_match(source.ip, "127.0.0.0/8") or cidr_match(source.ip, "172.16.0.0/12") or cidr_match(source.ip, "192.168.0.0/16") or cidr_match(source.ip, "169.254.0.0/16") or cidr_match(source.ip, "fc00::/7") or cidr_match(source.ip, "fe80::/10") or source.ip is null or source.ip in ("-", ""))No working conversion: Microsoft Defender XDR KQL (DeviceLogonEvents has equivalent columns (RemoteIP, string LogonType) but the stock pipeline does not map them and the numeric LogonType values do not translate 1:1; see the native draft.); IBM QRadar AQL (hunting query) (QRadar AQL backend has no property mapping for field "IpAddress")
Required telemetry
- Log source
product: windows · service: security- Fields used
EventIDIpAddressLogonType
False positives
- Legitimate or intentional inbound connections from public IP addresses on the RDP port.
Investigation and response
No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.
References
Author and attribution
- Author
- Micah Babinski (@micahbabinski), Zach Mathis (@yamatosecurity)
- Source
- SigmaHQ ·
rules/windows/builtin/security/account_management/win_security_successful_external_remote_rdp_login.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2