Detection rules › Kusto

Palo Alto - possible nmap scan on with top 100 option

Status
available
Severity
medium
Time window
2m
Group by
Computer, DestinationIP, SourceIP
Source
github.com/Azure/Azure-Sentinel

'Detect possible execution of Nmap top 100 option. This detection will detect scanning of 90% of Top 100 port of NMAP in less than 2 minutes. Unusual port only access through a scan are present in this list which is a good indicator of reconnaissance tactics. Whitelisting of Company scanners is required with implementation of the rule. Ref : https://nmap.org/book/performance-port-selection.html'

MITRE ATT&CK coverage

TacticTechniques
ReconnaissanceT1595 Active Scanning

Rule body kusto

id: 4d61bb9a-7f6d-45b1-ac0e-517e2a92f6fd
name: Palo Alto - possible nmap scan on with top 100 option
description: |
  'Detect possible execution of Nmap top 100 option. This detection will detect scanning of 90% of Top 100 port of NMAP in less than 2 minutes. Unusual port only access through a scan are present in this list which is a good indicator of reconnaissance tactics. Whitelisting of Company scanners is required with implementation of the rule. Ref : https://nmap.org/book/performance-port-selection.html'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: CefAma
    dataTypes:
      - CommonSecurityLog
queryFrequency: 5m
queryPeriod: 5m
triggerOperator: gt
triggerThreshold: 0
tactics:
  - Reconnaissance
relevantTechniques:
  - T1595
query: |
 CommonSecurityLog
 | where ipv4_is_private(SourceIP)
 | where DestinationPort in (7, 9, 13, 21, 22, 23, 25, 26, 37, 79, 81, 88, 106, 110, 111, 119, 135, 139, 143, 144, 179, 199, 389, 427, 444, 445, 465, 513, 514, 515, 543, 544, 548, 554, 587, 631, 646, 873, 990, 993, 995, 1025, 1026, 1027, 1028, 1029, 1110, 1433, 1720, 1723, 1755, 1900, 2000, 2001, 2049, 2121, 2717, 3000, 3128, 3306, 3389, 3986, 4899, 5000, 5009, 5051, 5060, 5101, 5190, 5357, 5432, 5631, 5666, 5800, 5900, 6000, 6001, 6646, 7070, 8000, 8008, 8009, 8080, 8081, 8443, 8888, 9100, 9999, 10000, 32768, 49152, 49153, 49154, 49155, 49156, 49157)
 | summarize
     dcount(DestinationPort),
     make_set(DestinationPort),
     make_set(ApplicationProtocol),
     make_set(Activity),
     make_set(SourcePort),
     StartTime = min(TimeGenerated),
     EndTime = max(TimeGenerated)
     by SourceIP, DestinationIP, Computer, bin(TimeGenerated, 2m)
 | where dcount_DestinationPort > 90
entityMappings:
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: DestinationIP
  - entityType: Host
    fieldMappings:
      - identifier: FullName
        columnName: Computer
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: SourceIP
version: 1.0.0
kind: Scheduled

Stages and Predicates

Stage 1: source

CommonSecurityLog

Stage 2: where

| where ipv4_is_private(SourceIP)

Stage 3: where

| where DestinationPort in (7, 9, 13, 21, 22, 23, 25, 26, 37, 79, 81, 88, 106, 110, 111, 119, 135, 139, 143, 144, 179, 199, 389, 427, 444, 445, 465, 513, 514, 515, 543, 544, 548, 554, 587, 631, 646, 873, 990, 993, 995, 1025, 1026, 1027, 1028, 1029, 1110, 1433, 1720, 1723, 1755, 1900, 2000, 2001, 2049, 2121, 2717, 3000, 3128, 3306, 3389, 3986, 4899, 5000, 5009, 5051, 5060, 5101, 5190, 5357, 5432, 5631, 5666, 5800, 5900, 6000, 6001, 6646, 7070, 8000, 8008, 8009, 8080, 8081, 8443, 8888, 9100, 9999, 10000, 32768, 49152, 49153, 49154, 49155, 49156, 49157)

Stage 4: summarize

| summarize
    dcount(DestinationPort),
    make_set(DestinationPort),
    make_set(ApplicationProtocol),
    make_set(Activity),
    make_set(SourcePort),
    StartTime = min(TimeGenerated),
    EndTime = max(TimeGenerated)
    by SourceIP, DestinationIP, Computer, bin(TimeGenerated, 2m)

Stage 5: where

| where dcount_DestinationPort > 90

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
DestinationPortin
  • 10000 transforms: cased
  • 1025 transforms: cased
  • 1026 transforms: cased
  • 1027 transforms: cased
  • 1028 transforms: cased
  • 1029 transforms: cased
  • 106 transforms: cased
  • 110 transforms: cased
  • 111 transforms: cased
  • 1110 transforms: cased
  • 119 transforms: cased
  • 13 transforms: cased
  • 135 transforms: cased
  • 139 transforms: cased
  • 143 transforms: cased
  • 1433 transforms: cased
  • 144 transforms: cased
  • 1720 transforms: cased
  • 1723 transforms: cased
  • 1755 transforms: cased
  • 179 transforms: cased
  • 1900 transforms: cased
  • 199 transforms: cased
  • 2000 transforms: cased
  • 2001 transforms: cased
  • 2049 transforms: cased
  • 21 transforms: cased
  • 2121 transforms: cased
  • 22 transforms: cased
  • 23 transforms: cased
  • 25 transforms: cased
  • 26 transforms: cased
  • 2717 transforms: cased
  • 3000 transforms: cased
  • 3128 transforms: cased
  • 32768 transforms: cased
  • 3306 transforms: cased
  • 3389 transforms: cased
  • 37 transforms: cased
  • 389 transforms: cased
  • 3986 transforms: cased
  • 427 transforms: cased
  • 444 transforms: cased
  • 445 transforms: cased
  • 465 transforms: cased
  • 4899 transforms: cased
  • 49152 transforms: cased
  • 49153 transforms: cased
  • 49154 transforms: cased
  • 49155 transforms: cased
  • 49156 transforms: cased
  • 49157 transforms: cased
  • 5000 transforms: cased
  • 5009 transforms: cased
  • 5051 transforms: cased
  • 5060 transforms: cased
  • 5101 transforms: cased
  • 513 transforms: cased
  • 514 transforms: cased
  • 515 transforms: cased
  • 5190 transforms: cased
  • 5357 transforms: cased
  • 543 transforms: cased
  • 5432 transforms: cased
  • 544 transforms: cased
  • 548 transforms: cased
  • 554 transforms: cased
  • 5631 transforms: cased
  • 5666 transforms: cased
  • 5800 transforms: cased
  • 587 transforms: cased
  • 5900 transforms: cased
  • 6000 transforms: cased
  • 6001 transforms: cased
  • 631 transforms: cased
  • 646 transforms: cased
  • 6646 transforms: cased
  • 7 transforms: cased
  • 7070 transforms: cased
  • 79 transforms: cased
  • 8000 transforms: cased
  • 8008 transforms: cased
  • 8009 transforms: cased
  • 8080 transforms: cased
  • 8081 transforms: cased
  • 81 transforms: cased
  • 8443 transforms: cased
  • 873 transforms: cased
  • 88 transforms: cased
  • 8888 transforms: cased
  • 9 transforms: cased
  • 9100 transforms: cased
  • 990 transforms: cased
  • 993 transforms: cased
  • 995 transforms: cased
  • 9999 transforms: cased
SourceIPcidr_match
  • 10.0.0.0/8
  • 127.0.0.0/8
  • 169.254.0.0/16
  • 172.16.0.0/12
  • 192.168.0.0/16
dcount_DestinationPortgt
  • 90 transforms: cased

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
Computersummarize
DestinationIPsummarize
EndTimesummarize
SourceIPsummarize
StartTimesummarize