Same IP address with multiple csUserAgent
Description
'This alerts when a client IP connects with 1-15 different useragents in less than 1 hour. Limited to 50 or less connections to avoid high traffic. May indicate malicious activity as a probing method.'
Query · kql
W3CIISLog | where scStatus !startswith "20" and scStatus !startswith "30" and cIP !startswith "192.168." and cIP != sIP and cIP != "::1" //Exclude local addresses, using ipv4_is_private operator |where ipv4_is_private(cIP) == false and cIP !startswith "fe80" and cIP !startswith "::" and cIP !startswith "127." | summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), makeset(csUserAgent), ConnectionCount = count() by Computer, sSiteName, sIP, sPort, cIP, csMethod | extend csUserAgentPerIPCount = arraylength(set_csUserAgent) | where csUserAgentPerIPCount between ( 2 .. 15 ) and ConnectionCount <=50 | extend timestamp = StartTime, IPCustomEntity = cIP, HostCustomEntity = Computer