LoFP LoFP / a shared nat, proxy, or build system can still mix curl with a browser and python or the aws cli in the same minute. exclude that address on source.ip. esql.* fields cannot be used in an exception entry.

Techniques

Sample rules

Curl and Multiple HTTP Client Families from One External IP

Description

Detects one external address using curl plus at least two other HTTP client families in a single minute, with 20 or more requests and at least two distinct event outcomes. The other families are Python, norma (ARTEX web fetch), a browser, and the AWS CLI, AWS SDK, or Boto3. A browser, Python, and the AWS CLI without curl is not a match. The same mix has been reported for agentic offensive frameworks, and it also comes from other automation. The look is limited to data streams that already carry user_agent.original.

Detection logic

from
    logs-aws.cloudtrail-*,
    logs-aws.eks_audit-*,
    logs-nginx.access-*,
    logs-apache.access-*,
    logs-apache_tomcat.access-*,
    logs-iis.access-*,
    logs-traefik.access-*,
    logs-zeek.http*,
    logs-network_traffic.http*,
    logs-azure.signinlogs-*,
    logs-azure.auditlogs-*,
    logs-azure.graphactivitylogs-*,
    logs-azure.aadgraphactivitylogs-*,
    logs-o365.audit-*,
    logs-kubernetes.audit_logs-*,
    logs-gcp.audit-*,
    logs-gcp_vertexai.auditlogs-*,
    logs-anthropic.audit-*,
    logs-openai_chatgpt_enterprise.auth_log-*,
    logs-okta.system-*
| where user_agent.original is not null and source.ip is not null
| eval Esql.ua_lower = to_lower(user_agent.original)
// curl*, python*/Python*, norma*, Mozilla/5.0*, Boto3*, aws-cli*, aws-sdk*
| where
    Esql.ua_lower like "curl*" or
    Esql.ua_lower like "python*" or
    Esql.ua_lower like "norma*" or
    Esql.ua_lower like "mozilla/5.0*" or
    Esql.ua_lower like "boto3*" or
    Esql.ua_lower like "aws-cli*" or
    Esql.ua_lower like "aws-sdk*"
// TO_IP handles indices where source.ip is mapped as keyword instead of ip
| eval Esql.source_ip = to_ip(source.ip)
| where Esql.source_ip is not null and not cidr_match(
    Esql.source_ip,
    "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16",
    "127.0.0.0/8", "169.254.0.0/16", "100.64.0.0/10",
    "0.0.0.0/8", "224.0.0.0/4", "255.255.255.255/32",
    "::1/128", "fc00::/7", "fe80::/10", "ff00::/8"
)
| eval Esql.ua_family = case(
    Esql.ua_lower like "boto3*" or Esql.ua_lower like "aws-cli*" or Esql.ua_lower like "aws-sdk*", "aws",
    Esql.ua_lower like "python*", "python",
    Esql.ua_lower like "curl*", "curl",
    Esql.ua_lower like "norma*", "norma",
    Esql.ua_lower like "mozilla/5.0*", "browser",
    "other"
)
| eval Esql.is_curl = case(Esql.ua_family == "curl", 1, 0)
| stats
    Esql.request_count = count(*),
    Esql.curl_request_count = sum(Esql.is_curl),
    Esql.ua_family_distinct_count = count_distinct(Esql.ua_family),
    Esql.ua_family_values = values(Esql.ua_family),
    Esql.ua_distinct_count = count_distinct(user_agent.original),
    Esql.ua_values = values(user_agent.original),
    Esql.event_action_values = values(event.action),
    Esql.outcome_distinct_count = count_distinct(event.outcome),
    Esql.outcome_values = values(event.outcome)
  by source.ip = Esql.source_ip, Esql.time_window = date_trunc(1 minute, @timestamp), data_stream.namespace
| where
    Esql.curl_request_count > 0 and
    Esql.ua_family_distinct_count >= 3 and
    Esql.request_count >= 20 and
    Esql.outcome_distinct_count >= 2
| sort Esql.request_count desc
| keep source.ip, Esql.*, data_stream.namespace