Preparing environment for file transfer
Just listing of tricks and/or scripts that can assist on getting the environment ready for receiving external files
Python HTTP Server
Python have a built-in simple server that is useful to transfer files to a machine. The downside is the server is not prepared to receive files as it does not support POST method.
A lot of users in github have implemented workarounds with modifications to original python module. One of them implemented in Python3 is the following code by TJNull on his OSCP repository.
-
Demo
Webdav
If you want to use curl -T
features for example (Uploading a file via PUT, web-dav like). Need to setup a webserver capable to understand this requests. Nginx is typically present on pentest distros and it is easy enough to configure this functionality.
- First of all, add to your
/etc/nginx/sites-available/<site>
your desired configuration. Example:
1 2 3 4 5 6 7 8 9 |
|
sites-enabled
1 2 3 4 |
|
- Set permissions to the nginx user (typically
www-data
) on the target folder
1 |
|
- And finally, start the service and test