Transfer Files
Techinque
Table of Contents
Transfer Files on Linux
Set Up a Simple Python Webserver
For the examples using curl
and wget
we need to download from a web-server. This is an easy way to set up a web-server. This command will make the entire folder, from where you issue the command, available on port 9999.
Wget
You can download files using wget
like this:
Curl
Netcat
Another easy way to transfer files is by using netcat.
If you can't have an interactive shell it might be risky to start listening on a port, since it could be that the attacking-machine is unable to connect. So you are left hanging and can't do ctr-c
because that will kill your session.
So instead you can connect from the target machine like this.
On attacking machine:
On target machine:
You can of course also do it the risky way, the other way around:
So on the victim-machine we run nc
like this:
And on the attacking machine we send the file like this:
I have sometimes received this error:
I have just run this command instead: