Skip to main content

A simple Python HTTP file server for upload and download, with optional GUI.

Project description

Install

  • This is learning project tested in Kali and Win11.
  • In Kali or any Linux, use this command to install:
    • pipx install getpost-fileserver
  • While in Windows, use:
    • py -m pip install getpost-fileserver
  • getpost-fileserver-cli.py is the no GUI version.
  • While getpost-fileserver.py is with GUI.
  • Tested in Kali and Windows10/11

Start GUI version getpost-fileserver.py

  • In Kali's terminal, use getpost-fileserver.py.
  • In Windows CMD, use py -m runpy getpost_fileserver.app.

Start CLI version getpost-fileserver-cli.py

  • In Kali's terminal, use getpost-fileserver-cli.py.
  • In Windows CMD, use py -m runpy getpost_fileserver.server.

Intro

This Tool will run python based http GET and Post webserver.

Usage:

  1. The server will list (GET) the content of the current directory where the app located: Browse the IP of the machine with the selected port http://192.168.8.10:80 Or you can use one of the following in linux:
    wget http://192.168.8.10:80/
    Or: curl http://192.168.8.10:80/

  2. The server will accept transferred files (POST) and save them to current directory where the app located. You can use one of the following: \

    • Using curl
      curl.exe -X POST -H "X-Filename: nmap.exe" --data-binary "@C:\Users\kaled\Downloads\nmap-7.98-setup.exe" http://192.168.8.10:80/
      you will get nmap.exe after the upload.
      Where:

      • -X Use the HTTP POST method (send data in the request body).
      • -H "X-Filename: nmap.exe". Add a custom HTTP header named X-Filename with value nmap.exe (your server reads this to pick the filename to save).
      • --data-binary "@C:\Users\kaled\Downloads\nmap-7.98-setup.exe" Send the exact bytes of that local file as the HTTP request body. The @ tells curl to read the file contents.
      • http://192.168.8.10:80/ The destination URL (IP and port 80).
    • Using wget
      wget --method=POST --header="X-Filename: test.txt" --header="Content-Type: application/octet-stream" --body-file="C:\Users\kaled\Downloads\somefile.txt" "http://192.168.8.10:80/"
      Where: \

      • --method=POST sets the method to POST.
      • --header=... sends the custom X-Filename header.
      • test.txt the file name after transferring, it can be anything like key.pem.
      • --body-file=somefile.txt sends the file as raw binary.
      • somefile.txt the file name before transferring, it should be exact.

Created by Kaled Aljebur for learning purposes in teaching classes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

getpost_fileserver-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

getpost_fileserver-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file getpost_fileserver-0.1.0.tar.gz.

File metadata

  • Download URL: getpost_fileserver-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for getpost_fileserver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f7303d1b87ba47d6a59f1c8a7329ea9950339400e5668baba4c1c02c91000bc9
MD5 35a5e229d52dcc49db1d76a50a38a8c0
BLAKE2b-256 0ec7ca7ef053f2ce2b9acadf4e22e8e64ee580c537ddcd01a3683993a9eb65ec

See more details on using hashes here.

File details

Details for the file getpost_fileserver-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for getpost_fileserver-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3de4db521af2b821a48a9bea3ee415de55877fc93772c0a73fb2b485b9e8d60
MD5 19db671b35fb5e1d9f67ab1c75817759
BLAKE2b-256 a49fa05f1ba37570dea7a64c25b76b87627cb1e672fa8a51a4c0fd09cb73a273

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page