ioc_ip_target


Description

Detect network events that indicate communication to a watchlisted IP address

Query · yara_l

events:
    $network.metadata.event_type = "NETWORK_CONNECTION"
    $network.target.ip = $ip
    //Target IP is not part of RFC1918 space, can modify as needed
    not net.ip_in_range_cidr($network.target.ip, "10.0.0.0/24")
    not net.ip_in_range_cidr($network.target.ip, "172.16.0.0/12")
    not net.ip_in_range_cidr($network.target.ip, "192.168.0.0/16")

    // Correlates with MISP data; can be modified based on your MISP parser or other TI
    $ioc.graph.metadata.product_name = "MISP"
    $ioc.graph.metadata.entity_type = "IP_ADDRESS"
    $ioc.graph.metadata.source_type = "ENTITY_CONTEXT"
    $ioc.graph.entity.ip = $ip

  match:
    $ip over 5m

  outcome:
    $risk_score = 65
    $event_count = count_distinct($network.metadata.id)
    // added to populate alert graph with additional context
    $principal_ip = array_distinct($network.principal.ip)
    // Commented out target.ip because it is already represented in graph as match variable. If match changes, can uncomment to add to results
    //$target_ip = array_distinct($network.target.ip)
    $principal_process_pid = array_distinct($network.principal.process.pid)
    $principal_process_command_line = array_distinct($network.principal.process.command_line)
    $principal_process_file_sha256 = array_distinct($network.principal.process.file.sha256)
    $principal_process_file_full_path = array_distinct($network.principal.process.file.full_path)
    $principal_process_product_specific_process_id = array_distinct($network.principal.process.product_specific_process_id)
    $principal_process_parent_process_product_specific_process_id = array_distinct($network.principal.process.parent_process.product_specific_process_id)
    $target_process_pid = array_distinct($network.target.process.pid)
    $target_process_command_line = array_distinct($network.target.process.command_line)
    $target_process_file_sha256 = array_distinct($network.target.process.file.sha256)
    $target_process_file_full_path = array_distinct($network.target.process.file.full_path)
    $target_process_product_specific_process_id = array_distinct($network.target.process.product_specific_process_id)
    $target_process_parent_process_product_specific_process_id = array_distinct($network.target.process.parent_process.product_specific_process_id)
    $principal_user_userid = array_distinct($network.principal.user.userid)
    $target_user_userid = array_distinct($network.target.user.userid)

  condition:
    $network and $ioc
Raw source ioc_ip_target · YARA-L
Esc
Published by chronicle/detection-rules ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
rule ioc_ip_target {

  meta:
    author = "Google Cloud Security"
    description = "Detect network events that indicate communication to a watchlisted IP address"
    rule_id = "mr_cb71b798-5931-47a9-8572-8166db41fc5c"
    rule_name = "IOC IP Target"
    type = "alert"
    tags = "threat indicators"
    assumption = "Assumes MISP data has been ingested into entity graph; this rule can be modified to utilize other TI indicators"
    data_source = "microsoft windows events"
    severity = "Medium"
    priority = "Medium"

  events:
    $network.metadata.event_type = "NETWORK_CONNECTION"
    $network.target.ip = $ip
    //Target IP is not part of RFC1918 space, can modify as needed
    not net.ip_in_range_cidr($network.target.ip, "10.0.0.0/24")
    not net.ip_in_range_cidr($network.target.ip, "172.16.0.0/12")
    not net.ip_in_range_cidr($network.target.ip, "192.168.0.0/16")

    // Correlates with MISP data; can be modified based on your MISP parser or other TI
    $ioc.graph.metadata.product_name = "MISP"
    $ioc.graph.metadata.entity_type = "IP_ADDRESS"
    $ioc.graph.metadata.source_type = "ENTITY_CONTEXT"
    $ioc.graph.entity.ip = $ip

  match:
    $ip over 5m

  outcome:
    $risk_score = 65
    $event_count = count_distinct($network.metadata.id)
    // added to populate alert graph with additional context
    $principal_ip = array_distinct($network.principal.ip)
    // Commented out target.ip because it is already represented in graph as match variable. If match changes, can uncomment to add to results
    //$target_ip = array_distinct($network.target.ip)
    $principal_process_pid = array_distinct($network.principal.process.pid)
    $principal_process_command_line = array_distinct($network.principal.process.command_line)
    $principal_process_file_sha256 = array_distinct($network.principal.process.file.sha256)
    $principal_process_file_full_path = array_distinct($network.principal.process.file.full_path)
    $principal_process_product_specific_process_id = array_distinct($network.principal.process.product_specific_process_id)
    $principal_process_parent_process_product_specific_process_id = array_distinct($network.principal.process.parent_process.product_specific_process_id)
    $target_process_pid = array_distinct($network.target.process.pid)
    $target_process_command_line = array_distinct($network.target.process.command_line)
    $target_process_file_sha256 = array_distinct($network.target.process.file.sha256)
    $target_process_file_full_path = array_distinct($network.target.process.file.full_path)
    $target_process_product_specific_process_id = array_distinct($network.target.process.product_specific_process_id)
    $target_process_parent_process_product_specific_process_id = array_distinct($network.target.process.parent_process.product_specific_process_id)
    $principal_user_userid = array_distinct($network.principal.user.userid)
    $target_user_userid = array_distinct($network.target.user.userid)

  condition:
    $network and $ioc
}

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.