This package implements a web server to run scripts or executables from the command line and display the result in a web interface.
Project description
WebScripts
Description
This package implements a web server to run scripts or executables from the command line and display the result in a web interface.
Goals
Create a safe, secure and easy way to share console scripts and scripting environnments with your team or people without IT knowledge.
- secure
- SAST - Static Application Security Testing using bandit
- Web pentest using Kali Linux Web tools and my little experience in Web Hacking
- centralization of logs (using Syslog on Linux and Event Viewer on Windows)
- easy to update and patch security issues on Linux (critical functions are implemented in Standard Library and are updated with your system) (WebScripts does not require any python package)
- easy to deploy securely
- easy to configure securely (read the documentation)
- INI/CFG syntax
- JSON syntax
- unittest
Requirements
This package require:
- python3
- python3 Standard Library
Optional on Windows:
- pywin32 (to centralize logs in Event Viewer)
Installation
pip install WebScripts
Basic Usages
Command line
WebScripts
python3 -m WebScripts
WebScripts --help
WebScripts -h # Print help message and command line options
WebScripts --interface "192.168.1.2" --port 80
WebScripts -i "192.168.1.2" -p 80 # Change interface and port
# /!\ do not use the --debug option on the production environment
WebScripts --debug
WebScripts -d # Print informations about server configuration in errors pages (404 and 500)
# /!\ do not use the --security option on the production environment
WebScripts --security
WebScripts -s # Do not use HTTP security headers (for debugging)
WebScripts --accept-unauthenticated-user --accept-unknow-user
# Accept unauthenticated user
Python script
import WebScripts
WebScripts.main()
from WebScripts import Configuration, Server, main
from wsgiref import simple_server
config = Configuration()
config.add_conf(
interface="",
port=8000,
scripts_path = [
"./scripts/account",
"./scripts/passwords"
],
json_scripts_config = [
"./config/scripts/*.json"
],
ini_scripts_config = [
"./config/scripts/*.ini"
],
documentations_path = [
"./doc/*.html"
],
js_path = [
"./static/js/*.js"
],
statics_path = [
"./static/html/*.html",
"./static/css/*.css",
"./static/images/*.jpg",
"./static/pdf/*.pdf"
],
)
config.set_defaults()
config.check_required()
config.get_unexpecteds()
config.build_types()
server = Server(config)
httpd = simple_server.make_server(server.interface, server.port, server.app)
httpd.serve_forever()
Documentation
Wiki
- Installation
- Usages
- Server Configuration
- Script Configuration
- Argument Configuration
- Logs
- Authentication
- Default Database
- Access and Permissions
- Security Considerations
- API
- Custom WEB Interface
- Modules (Custom responses and code)
- Code analysis for security (SAST)
- Security checks and tests (pentest tools)
Examples
PyDoc
- Index
- WebScripts
- Pages
- commons
- utils
- Errors
- Default Database Manager
- Default Upload Manager
- Default Request Manager
- Default module errors
Links
Pictures
License
Licensed under the GPL, version 3.
Run tests
python -m unittest discover -s test -p Test*.py -v
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
WebScripts-1.2.11.tar.gz
(205.1 kB
view details)
File details
Details for the file WebScripts-1.2.11.tar.gz.
File metadata
- Download URL: WebScripts-1.2.11.tar.gz
- Upload date:
- Size: 205.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64ae6866b5ee497362a49e3589a3dde0a1afb93b7ba0a6254cb1f7e16fa28019
|
|
| MD5 |
233bbf5324511924fc3a55242b7738f3
|
|
| BLAKE2b-256 |
1281a2c42ff1f64213ed7f4b6a45d3fd44c88933b0dba90d660fbfade7a65d08
|