Query Details
// https://any.run/cybersecurity-blog/ottercookie-malware-analysis/ let QueryLookup = 1h; let CompressData = DeviceFileEvents | where Timestamp > ago(QueryLookup) | where ActionType == "FileCreated" | where InitiatingProcessFileName has "tar" | distinct DeviceName; DeviceNetworkEvents | where Timestamp > ago(QueryLookup) | where ActionType == "HttpConnectionInspected" | where parse_json(AdditionalFields)["direction"] == 'Out' | where parse_json(AdditionalFields)["status_code"] == '200' | extend GeoCtry = tostring(geo_info_from_ip_address(RemoteIP).country) | where GeoCtry == "United States" | where RemotePort == "1224" | where DeviceName has_any(CompressData)
This KQL (Kusto Query Language) query is designed to detect potential malicious activity on devices by analyzing file creation and network events. Here's a simplified explanation:
Time Frame: The query looks at events from the past hour (1h).
File Creation Check:
DeviceFileEvents to find instances where a file was created (ActionType == "FileCreated").Network Activity Check:
DeviceNetworkEvents to find HTTP connections that were inspected (ActionType == "HttpConnectionInspected")."direction" == 'Out') with a successful status code ("status_code" == '200').GeoCtry == "United States") and used port 1224 (RemotePort == "1224").DeviceName has_any(CompressData)).In summary, this query is looking for devices that have created files using a "tar" process and have also made specific outgoing HTTP connections to the United States on port 1224, which could indicate suspicious behavior related to data exfiltration or malware activity.

Steven Lim
Released: June 4, 2025
Tables
Keywords
Operators