File Transfer - Quick Commands
Certutil (Windows)
Python
HTTP
You can navigate to the IP and port 80
(or whatever port you set) and browse the directory.
You can chain this with certutil
and prop up the http server on the attacker machine and use certutil
to transfer tools over to the victim machine (Windows).
FTP
PHP
Base64
Now copy the base64 string and go to the remote host and decode it and pipe it into a file:
SCP (Requires SSH Access)
To use Secure Copy (SCP)
linenume.sh
: This is the file to transfer/tmp/linenum.sh
: You must specify the destination directory and filename for the transferred file
To use scp with an ssh access key:
To transfer a directory:
Wget (Linux)
Downloading a file and saving it with a specific name:
Resuming a download:
If a download is interrupted, you can resume it with the -c
option:
Downloading multiple files:
Downloading in the Background:
To download a file in the background (i.e., without holding up your terminal), use the -b
option:
Adjusting Speed Limit:
If needed, you can limit the download speed with --limit-rate
:
Additional Options
Verbose Mode: Use
-v
to enable verbose output, showing detailed information about the download process.User Authentication: Use
--user
and--password
options for sites requiring authentication.Using Proxy: Use
--proxy-user
and--proxy-password
for proxy authentication.
cURL
If you are on a compromised machine you can use:
Example transferring over nmap and changing permissions of the file:
Metasploit
Upload/Download feature, so if we have a meterpreter shell it is very easy to upload/download a file
SMBServer.py
Run smbserver.py
, and set the shareName and sharePath:
smbserver.py
: Refers to the smbserver.py script, which is part of the Impacket toolkit. This script allows you to create an SMB server.p
: share name that will be created and can be accessed.
: The dot represents the current directory. It specifies the path to the directory that you want to share as an SMB share. In this case, it means the current directory in which you are running the command.
Now from the Windows machine on the same network, you can copy from the share you setup on the Kali box:
Validating File Transfers
Last updated