Detection rules › Splunk
BitsAdmin NetCat PowerCat File Transfer (Windows Event Log)
This use case is searching for specific keywords that are generated when a file transfer using Bitsadmin, Netcat or PowerCat is made to send data to/from an external source
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Persistence | |
| Stealth | |
| Command & Control |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule body
id: '1067.1102'
title: BitsAdmin NetCat PowerCat File Transfer
description: 'This use case is searching for specific keywords that are generated
when a file transfer using Bitsadmin, Netcat or PowerCat is made to send data to/from
an external source. -- Threat Actor Association: Cadet Blizzard - Software Association:
Black Basta -- Atomics T1105 Test #9'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (("/transfer" OR "/addfile"
OR "Start-BitsTransfer" OR " -vw " OR " -vn " OR " -vwn " OR " -vnw " OR " -w "
OR " -wv " OR " -wn " OR " -wvn " OR " -wnv " OR " -N " OR " -Nv " OR " -Nw " OR
" -Nvw " OR " -Nwv " OR " --send-only") OR ("nc64" OR "nc32" OR "netcat64" OR "netcat32"
OR "ncat" OR "nc" OR "netcat")) | regex process="(\s+\-[Nvw]+\s+\d+?.*?(((\d{1,3}\.){3}\d{1,3})|(\w?\wtps?\:(\/\/|\x5c\x5c)))\s+\d{2,5})|(?i)((ncat|nc|nc64|nc32|netcat64|netcat32|netcat)(\s+|\.exe).*?\-[Nvw]+\s+\d+?.*?(((\d{1,3}\.){3}\d{1,3})|(\w?\wtps?\:(\/\/|\x5c\x5c)))\s+\d{2,5})|(\s+\/(transfer)\s+.*?\w{3,5}\:\/\/)|(?i)(--send-only\s+?$)|(?i)(Start-BitsTransfer)|\s+\/(addfile)\s+"
| rex field=process max_match=1 (?<dest_ip>"\s+((([a-f0-9:]+:+)+[a-f0-9]+)|((\d{1,3}\.){3}\d{1,3}))\s+")|
rex field=dest_ip mode=sed "s/([\n|\r|\s])//g" | table _time, host, user process,
process_*, parent_*, dest_ip | bin span=1s | stats values(*) as * by _time, host
| search NOT dest_ip IN(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, 224.0.0.0/4, 255.255.255.255, "::1", "FE80::/10", "FF00::/8") '
techniques:
- command-and-control:application layer protocol:file transfer protocols
- persistence:bits jobs
- defense-evasion:bits jobs
technique_id:
- T1071.002
- T1197
data_category:
- Windows event logs
references: null
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_winevent` (("/transfer" OR "/addfile" OR "Start-BitsTransfer" OR " -vw " OR " -vn " OR " -vwn " OR " -vnw " OR " -w " OR " -wv " OR " -wn " OR " -wvn " OR " -wnv " OR " -N " OR " -Nv " OR " -Nw " OR " -Nvw " OR " -Nwv " OR " --send-only") OR ("nc64" OR "nc32" OR "netcat64" OR "netcat32" OR "ncat" OR "nc" OR "netcat"))
Stage 2: regex
| regex process="(\s+\-[Nvw]+\s+\d+?.*?(((\d{1,3}\.){3}\d{1,3})|(\w?\wtps?\:(\/\/|\x5c\x5c)))\s+\d{2,5})|(?i)((ncat|nc|nc64|nc32|netcat64|netcat32|netcat)(\s+|\.exe).*?\-[Nvw]+\s+\d+?.*?(((\d{1,3}\.){3}\d{1,3})|(\w?\wtps?\:(\/\/|\x5c\x5c)))\s+\d{2,5})|(\s+\/(transfer)\s+.*?\w{3,5}\:\/\/)|(?i)(--send-only\s+?$)|(?i)(Start-BitsTransfer)|\s+\/(addfile)\s+"
Stage 3: rex
| rex field=process max_match=1 (?<dest_ip>"\s+((([a-f0-9:]+:+)+[a-f0-9]+)|((\d{1,3}\.){3}\d{1,3}))\s+")
Stage 4: rex
| rex field=dest_ip mode=sed "s/([\n|\r|\s])//g"
Stage 5: table
| table _time, host, user process, process_*, parent_*, dest_ip
Stage 6: bucket
| bin span=1s
Stage 7: stats
| stats values(*) as * by _time, host
Stage 8: search
| search NOT dest_ip IN(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, 224.0.0.0/4, 255.255.255.255, "::1", "FE80::/10", "FF00::/8")
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
dest_ip | in | "::1", "FE80::/10", "FF00::/8", 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, 224.0.0.0/4, 255.255.255.255 | excludes:dest_ip |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process | regex_match |
| field:"CommandLine" kind:regex_match |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "/transfer" |
| 1 | "/addfile" |
| 1 | "Start-BitsTransfer" |
| 1 | " -vw " |
| 1 | " -vn " |
| 1 | " -vwn " |
| 1 | " -vnw " |
| 1 | " -w " |
| 1 | " -wv " |
| 1 | " -wn " |
| 1 | " -wvn " |
| 1 | " -wnv " |
| 1 | " -N " |
| 1 | " -Nv " |
| 1 | " -Nw " |
| 1 | " -Nvw " |
| 1 | " -Nwv " |
| 1 | " --send-only" |
| 1 | "nc64" |
| 1 | "nc32" |
| 1 | "netcat64" |
| 1 | "netcat32" |
| 1 | "ncat" |
| 1 | "nc" |
| 1 | "netcat" |