sickserv
This is a Python 3.6+ client-server wrapper & framework that allows you to rapidly build simple, fast, encrypted, asynchronous, multi-client application communication.
Highlights:
- Client/server wrapper around Sanic, requests, and websocket-client.
- Provides a framework for multi-client communication, based around unique system identifiers.
- Supports simplistically sending and receiving RC4 encrypted JSON payloads.
- Supports sending either string or byte values using base64 encoding.
- Provides a client and server for either websocket or non-websocket applications.
- Natively asynchronous, provided by Sanic.
- Client/server support for RC4 rekey on-the-fly.
Install
Do it up:
$ pip install sickserv --user
Communication Flow
Initial payloads are always JSON (with a defined endpoint), which are then base64 encoded, RC4 encrypted, and then sent over HTTP or HTTPS (on any port desired).
Send data:
JSON -> base64 encode values -> RC4 encrypt -> send (HTTPS)
Recv data:
recv (HTTPS) -> RC4 decrypt -> base64 decode values -> JSON
Simple Example (non-WebSocket)
See the examples/ folder for more, including: a MUD, chat server, and reverse shell.
Server:
from sickserv import server, set_init_key
from sickserv.server import response
set_init_key('yellow-submarine')
@server.app.route('/test/<sysid>', methods=['POST',])
async def test(request, sysid):
payload = server.unprocess_payload(sysid, request.body)
print(payload)
return_payload = server.process_payload(sysid, {'Look Mom': 'No Hands!'})
return response.text(return_payload)
server.run(port=1337)
Client:
from sickserv import SickServClient, set_init_key
set_init_key('yellow-submarine')
ssc = SickServClient('127.0.0.1', port=1337)
payload = {
'endpoint': 'test',
'example': 'This is some example test data'
}
response = ssc.send(payload)
print(response)
Server side:
$ python server.py
_____ ____ __ __ _ _____ ___ ____ __ __
/ ___/| | / ]| |/ ]/ ___/ / _]| \| | |
( \_ | | / / | ' /( \_ / [_ | D ) | |
\__ | | |/ / | \ \__ || _]| /| | |
/ \ | | / \_ | \/ \ || [_ | \| : |
\ | | \ || . |\ || || . \\ /
\___||____\____||__|\_| \___||_____||__|\_| \_/
v0.1.3 - https://github.com/vesche/sickserv
[2019-10-26 06:12:47 -0500] [31313] [INFO] Goin' Fast @ http://0.0.0.0:1337
[2019-10-26 06:12:47 -0500] [31313] [INFO] Starting worker [31313]
{'example': 'This is some example test data'}
[2019-10-26 06:12:57 -0500] - (sanic.access)[INFO][127.0.0.1:41550]: POST http://127.0.0.1:1337/test/b0610ba87aa2 200 60
Client side:
$ python test_client.py
{'Look Mom': 'No Hands!'}
Rekey
An initial, matching RC4 key must be supplied. However, the session can easily be rekeyed on the fly.
A rekey is done from the client-end, like so:
ssc.rekey() # rekey with a random 16 character length key
ssc.rekey(length=32) # rekey with a random 32 character length key
ssc.rekey(key='purple-submarine') # rekey with a custom defined key
Metadata
Release files for sickserv 0.1.3
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 | |
|---|---|---|---|---|
| sickserv-0.1.3.tar.gz | 9.1 kB | Without provenance | Details |
Release files / sickserv-0.1.3.tar.gz
| Download URL | sickserv-0.1.3.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06c37ba7fa67a85ab2fad2d37e13b9d4a73473df5bfeec8e440c9f355f944dd5
|
|
BLAKE2b-256 checksum How to use checksums |
eeeff14c1c0a7a0b38f7d4b25484448ef14532645d34401c115e0c7ca41c1239
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Security for sickserv 0.1.3
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.