Serving Your Files
All the ways to host your files during an engagement.
HTTP
Here we call a Python 3.X web server in the directory that you ran the command. Change the port number from 80 to any port you desire. If you change the port number from port 80, remember when fetching your files you will have to call it with http://192.168.1.1:8000 instead of just http://192.168.1.1. Port 80 is the default for HTTP, so in the previous example, http://192.168.1.1:80 will produce the same result. We can also use Python2 if we need to, however, I have never encountered a real use for this.
Again, the same rules of changing the port number apply here as well.
Tips
Unlike your VPN configuration, if you pause your VM and power it back on again, the Python HTTP server will still be intact in whatever directory you ran the command. For this reason, I set up a page specifically to run my web server, so I never have to turn it on when I need it. Additionally, I have also created a 'transfers' directory in which I run my server, where I keep commonly transferred programs and scripts like netcat and web shells.
SMB
First, we start the SMB server using smbserver.py, which is from the impacket set of tools. The option share
is whatever name we want or SMB share to be. You can change this to whatever you would like, just make sure to reflect it in commands to come. Next, .
selects the directory we are currently in as the host for serving files. Change this as well if you need to select a different directory. -smb2support
adds much needed compatibility. The -username
and -password
options both allow you to set what password and username to have access to this share. I highly recommend not running this SMB server anonymously as it can cause issues. Simply enter your desired username and password in the $username
and$password
fields, respectively.
FTP
We use Python3 to launch pyftpdlib (install instructions in Overview). Use the -p 21
flag to select which port you want to host FTP on. By default, pyftpdlib will host it on port 2121. This will launch the FTP in anonymous mode, where any user can log in with the credentials anonymous:anonymous
. Additionally, the -w
flag allows the anonymous user to write files as opposed to just read.
Last updated