DEFWEB
Defweb is an enhancement of the standard http.server of python3. Defweb supports https and file uploads and can function as a SOCKS 4, 5 or HTTP proxy. Defweb can act as an TCP reverse proxy and can perform TLS MITM / TLS Interception.
Installing
Installing the package via pypi:
pip install defweb
Options
usage: defweb [-h] [-b BIND] [-p PORT] [-v] [--log-level LOG_LEVEL] [-d DIR] [-i SERVER NAME] [-s] [-r] [--sign] [--key KEY] [--cert CERT] [--proxy] [--proxy_socks_only] [--proxy_http_only]
[--rotate_user_agents] [--ip-limit CIDR] [-u USER:PASSWORD] [--rev_proxy] [--rev_proxy_tls] [-ca] [-pi PROXIED_IP] [-pp PROXIED_PORT] [-ptls] [-m MIDDLEWARES]
optional arguments:
-h, --help show this help message and exit
General options:
-b BIND ip to bind to; defaults to 127.0.0.1
-p PORT port to use; defaults to 8000
-v, --version show version and then exit
--log-level LOG_LEVEL
DEBUG, INFO (default), WARNING, ERROR, CRITICAL
Webserver options:
-d DIR path to use as document root
-i SERVER NAME server name to send in headers
-s, --secure use https instead of http, if --key and --cert are omitted certificates will be auto generated
-r, --recreate_cert re-create the generated ssl certificate
--sign when using auto generated certs (-s without --key or --cert), should they be signed or not
--key KEY key file to use for webserver
--cert CERT certificate file to use for webserver
Proxy options:
--proxy start proxy for SOCKS4, SOCKS5 & HTTP(S)
--proxy_socks_only start proxy only for SOCKS4, SOCKS5
--proxy_http_only start proxy only for HTTP(S)
--rotate_user_agents generate random user agent for each HTTP request (only HTTP supported)
--ip-limit CIDR limit proxy to only accept connections coming from this CIDR range
-u USER:PASSWORD user credentials to use when authenticating to the proxy server
Reverse Proxy options:
--rev_proxy start reverse TCP proxy
--rev_proxy_tls add TLS support to the reverse TCP proxy
-ca whether to setup own CA and sign the certificates used by the --rev_proxy_tls option
-pi PROXIED_IP provide the ip of the service we are proxying for
-pp PROXIED_PORT provide the port of the service we are proxying for
-ptls whether the service we are proxying for uses TLS
-m MIDDLEWARES comma seperated middlewares to use
Usage
python3 -m defweb.main
Upload
Defweb facilitates uploading files to the document root via the PUT command.
Example for 'curl' and wget (the -k switch (curl) and
--no-check-certificate (wget) is needed because Defweb uses self signed
certificates by default).
curl -X PUT --upload-file file.txt https://localhost:8000 -k
wget -O- --method=PUT --body-file=file.txt https://localhost:8000/somefile.txt --no-check-certificate
Metadata
Release files for defweb 0.2.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| defweb-0.2.11.tar.gz | 196.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| defweb-0.2.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 404.7 kB
Release files / defweb-0.2.11.tar.gz
| Download URL | defweb-0.2.11.tar.gz |
|---|---|
| Size | 196.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0c9157597e547986d00cba405cb477f692950cb24deeaf138d56a30b3e19052
|
|
BLAKE2b-256 checksum How to use checksums |
0a2962f4bb13a15466c09745d9b28377cb7b60583b3da8f1f304b06a369b92ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.0
|
Release files / defweb-0.2.11-py3-none-any.whl
| Download URL | defweb-0.2.11-py3-none-any.whl |
|---|---|
| Size | 208.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9308aaf2e01945f565d6092b5c397c1697922af5b90c2a8cd5f4e093aa129f2c
|
|
BLAKE2b-256 checksum How to use checksums |
cb9b4f6f7de7a2bea2911f838c5b5e27862ecad793525879bfbeba1ed78d04f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.0
|
Security for defweb 0.2.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.