mirror of
https://github.com/DaanSelen/meshbook.git
synced 2026-02-20 08:22:11 +00:00
encountering errors, debugging from remote machine...
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
*.conf
|
||||
venv
|
||||
.vscode
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
|
||||
18
README.md
18
README.md
@@ -9,7 +9,23 @@ And many people will be comfortable with YAML configurations! It's almost like J
|
||||
The quickest way to start is to grab a template from the templates folder in this repository.<br>
|
||||
Make sure to correctly pass the MeshCentral websocket API as `wss://<MeshCentral-Host>/control.ashx`.<br>
|
||||
And make sure to fill in the credentails of an account which has remote commands permissions.<br>
|
||||
Then make a yaml with a target and some commands! See below examples as a guideline. And do not forget to look at the bottom's notice.
|
||||
Then make a yaml with a target and some commands! See below examples as a guideline. And do not forget to look at the bottom's notice.<br>
|
||||
To install, follow the following commands:<br>
|
||||
|
||||
```shell
|
||||
python3 -m venv ./venv
|
||||
```
|
||||
```shell
|
||||
source ./venv/bin/activate
|
||||
cd ./meshbook
|
||||
```
|
||||
```shell
|
||||
pip3 install -r requirements.txt
|
||||
```
|
||||
Then you can use meshbook, for example:
|
||||
```shell
|
||||
python3 meshbook.py -pb examples/ping.yaml
|
||||
```
|
||||
|
||||
# Example:
|
||||
|
||||
|
||||
@@ -3,4 +3,7 @@ name: Ping Multiple Points
|
||||
company: Temp-Agents
|
||||
tasks:
|
||||
- name: Ping Cloudflare
|
||||
command: "ping 1.1.1.1 -c 4"
|
||||
command: "ping 1.1.1.1 -c 4"
|
||||
|
||||
- name: Ping Google
|
||||
command: "ping 8.8.8.8 -c 4"
|
||||
@@ -116,7 +116,10 @@ class MeshcallerWebSocket:
|
||||
async def ws_handler(self, uri: str, username: str, password: str):
|
||||
"""Main WebSocket connection handler."""
|
||||
login_string = f'{MeshcallerUtilities.base64_encode(username)},{MeshcallerUtilities.base64_encode(password)}'
|
||||
ws_headers = {'User-Agent': 'MeshCentral API client', 'x-meshauth': login_string}
|
||||
ws_headers = {
|
||||
'User-Agent': 'MeshCentral API client',
|
||||
'x-meshauth': login_string
|
||||
}
|
||||
if not args.silent:
|
||||
print("Attempting WebSocket connection...")
|
||||
|
||||
@@ -286,6 +289,7 @@ async def main():
|
||||
processor_task = asyncio.create_task(processor.receive_processor(python_client))
|
||||
await MeshcallerActions.process_arguments(python_client, args.playbook)
|
||||
await asyncio.gather(websocket_task, processor_task)
|
||||
|
||||
except ScriptEndTrigger as e:
|
||||
if not args.silent:
|
||||
print(e)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
asyncio
|
||||
argparse
|
||||
configparser
|
||||
json
|
||||
pyyaml
|
||||
websockets
|
||||
Reference in New Issue
Block a user