fkadibs / BITSServer

A Python3 HTTPServer wrapper for the Windows BITS protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BITSServer

BITSServer is a basic Python3 server for using the Windows Binary Intelligent Transfer Service protocol (BITS), supporting file upload and download from Windows clients using the built-in bitsadmin.exe command-line tool, BitsTransfer PowerShell module, or COM interface.

WARNING: BITSServer uses Python3's built-in http.server library and is NOT recommended for production.

Installation

git clone https://github.com/fkadibs/BITSServer && cd BITSServer/
pip3 install .

Server Operation

BITSServer supports uploading/downloading any files from the working directory. The server logs will write to bitsserver.log

You can run the server from the command line:

python3 -m bitsserver 80

Alternatively, build and run the docker container:

docker build --tag bitsserver .
docker run bitsserver -d -p 80:80 -v /tmp/bits:/app

In this example, we are mapping the local /tmp/bits directory to the container's working directory (/app), acting as our download/upload directory, and log destination.

Client Operation

On the client-side, create a transfer job using the BITS client of your choice. For instance, uploading a file to the server using bitsadmin.exe:

bitsadmin /transfer <name> /upload http://<server>/<filename> <filepath>

Using PowerShell's BitsTransfer module is another option

Import-Module BitsTransfer
Start-BitsTransfer -TransferType Upload -Source <filepath> -Destination http://<server>/<filename> -DisplayName <name>

These are simple examples. For custom client development, BITS jobs can be created and managed locally with the COM interface, or remotely with WinRM.

About

A Python3 HTTPServer wrapper for the Windows BITS protocol

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 99.1%Language:Dockerfile 0.9%