Sliver gRPC client library.
Project description
SliverPy
SliverPy is a Python gRPC client library for Sliver. SliverPy can be used to automate any operator interaction with Sliver and connects to servers using gRPC over Mutual TLS (i.e., multiplayer) using Sliver operator configuration files. For more details, please see the project documentation.
⚠️ Not all features in Sliver v1.5+ are supported yet.
Install
Install the package using pip, for best compatibility use Sliver Server v1.5 or later:
pip3 install sliver-py
Examples
For more examples and details please read the project documentation.
Interact with Sessions
#!/usr/bin/env python3
import os
import asyncio
from sliver import SliverClientConfig, SliverClient
CONFIG_DIR = os.path.join(os.path.expanduser("~"), ".sliver-client", "configs")
DEFAULT_CONFIG = os.path.join(CONFIG_DIR, "default.cfg")
async def main():
config = SliverClientConfig.parse_config_file(DEFAULT_CONFIG)
client = AsyncSliverClient(config)
print('[*] Connected to server ...')
await client.connect()
sessions = await client.sessions()
print('[*] Sessions: %r' % sessions)
if len(sessions):
print('[*] Interacting with session %s', sessions[0].ID)
interact = await client.interact_session(sessions[0].ID)
ls = await interact.ls()
print('[*] ls: %r' % ls)
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Interact with Beacons
#!/usr/bin/env python3
import os
import asyncio
from sliver import SliverClientConfig, SliverClient
CONFIG_DIR = os.path.join(os.path.expanduser("~"), ".sliver-client", "configs")
DEFAULT_CONFIG = os.path.join(CONFIG_DIR, "default.cfg")
async def main():
config = SliverClientConfig.parse_config_file(DEFAULT_CONFIG)
client = SliverClient(config)
print('[*] Connected to server ...')
await client.connect()
version = await client.version()
print('[*] Server version: %s' % version)
beacons = await client.beacons()
print('[*] Beacons: %r' % beacons)
if len(beacons):
print('[*] Interacting with beacon: %r' % beacons[0].ID)
interact = await client.interact_beacon(beacons[0].ID)
ls_task = await interact.ls()
print('[*] Created ls task: %r' % ls_task)
print('[*] Waiting for task results ...')
ls = await ls_task
print('[*] ls: %r' % ls)
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
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
Built Distribution
File details
Details for the file sliver-py-0.0.17.tar.gz
.
File metadata
- Download URL: sliver-py-0.0.17.tar.gz
- Upload date:
- Size: 83.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c0a01e9e203b7f1acb1f3f5c8501ee0fecc9c53674e672e37660bccc7e9340f |
|
MD5 | 4ea9adb3d5f2139b8865c6fe40757e76 |
|
BLAKE2b-256 | cf27b2e238c1177b8e5f3c6d6f90a25a53dce1a3b676d0088a248db225ccceb2 |
File details
Details for the file sliver_py-0.0.17-py3-none-any.whl
.
File metadata
- Download URL: sliver_py-0.0.17-py3-none-any.whl
- Upload date:
- Size: 87.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ae3bfc0b2c76340e03a9362884cb8e127a2b2f37b9acafa1f8288a23b6308e6 |
|
MD5 | 3506ed10a626f36ef352bbf9cbd81a24 |
|
BLAKE2b-256 | 7224e3570fbef5a0ffae9d520655ee9cf815bb4c7ce64a4b63f7b73fa5a6978b |