NetAPI IP addresses that have attacked NetAPI honeypot sensors in the last 48 hours
TI Feed Net API Honeypot Attacker I Ps
Query
let ThreatIntelFeed = externaldata(DestIP: string)[@"https://netapi.com/api2/?method=compromised&dataset_type=ip"] with (format="txt", ignoreFirstRecord=True);
let IPRegex = '[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}';
let MaliciousIP = materialize (
ThreatIntelFeed
| where DestIP matches regex IPRegex
| distinct DestIP
);
DeviceNetworkEvents
| where RemoteIP in (MaliciousIP)
| extend GeoIPInfo = geo_info_from_ip_address(RemoteIP)
| extend country = tostring(parse_json(GeoIPInfo).country), state = tostring(parse_json(GeoIPInfo).state), city = tostring(parse_json(GeoIPInfo).city), latitude = tostring(parse_json(GeoIPInfo).latitude), longitude = tostring(parse_json(GeoIPInfo).longitude)About this query
NetAPI IP addresses that have attacked NetAPI honeypot sensors in the last 48 hours
Source: NetAPI
Feed information: https://netapi.com/compromised-ips/
Feed link: https://netapi.com/api2/?method=compromised&dataset_type=ip
Defender XDR
Sentinel
let ThreatIntelFeed = externaldata(DestIP: string)[@"https://netapi.com/api2/?method=compromised&dataset_type=ip"] with (format="txt", ignoreFirstRecord=True);
let IPRegex = '[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}';
let MaliciousIP = materialize (
ThreatIntelFeed
| where DestIP matches regex IPRegex
| distinct DestIP
);
DeviceNetworkEvents
| where RemoteIP in (MaliciousIP)
| extend GeoIPInfo = geo_info_from_ip_address(RemoteIP)
| extend country = tostring(parse_json(GeoIPInfo).country), state = tostring(parse_json(GeoIPInfo).state), city = tostring(parse_json(GeoIPInfo).city), latitude = tostring(parse_json(GeoIPInfo).latitude), longitude = tostring(parse_json(GeoIPInfo).longitude)
Explanation
This query is designed to identify and provide information about IP addresses that have attacked NetAPI honeypot sensors in the last 48 hours. Here's a simple breakdown of what the query does:
-
Data Source: It pulls data from an external threat intelligence feed provided by NetAPI, which lists compromised IP addresses. The data is fetched from the URL:
https://netapi.com/api2/?method=compromised&dataset_type=ip. -
IP Address Validation: It uses a regular expression to ensure that the IP addresses in the feed are valid IPv4 addresses.
-
Identify Malicious IPs: The query filters and extracts distinct IP addresses from the feed that match the IP address format.
-
Network Events Matching: It checks the network events recorded in the system to see if any of these malicious IP addresses have interacted with the network.
-
Geolocation Information: For each malicious IP address found in the network events, it retrieves geolocation information, including the country, state, city, latitude, and longitude.
-
Output: The result is a list of malicious IP addresses that have attacked the network, along with their geolocation details, helping to understand where these attacks are originating from.
This query is executed in both Defender XDR and Sentinel environments, and the logic is identical in both cases.