Skip to content

Commit 9bccc67

Browse files
committed
Update the --help listing and plugin docs
1 parent f314267 commit 9bccc67

File tree

2 files changed

+43
-17
lines changed

2 files changed

+43
-17
lines changed

README.md

+43-17
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66

77
## Features
88

9-
- Interactively send and receive websocket messages.
10-
- Customize headers, ping/pong messages, and other parameters.
11-
- Handle SSL verification and reconnections.
12-
- Plug-in support for automating complex interaction scenarios.
13-
- Full logging and message history.
9+
- Interactively send and receive websocket messages
10+
- Customize headers, ping/pong messages, and other parameters
11+
- Handle SSL verification and reconnections
12+
- Plug-in support for automating complex interaction scenarios
13+
- Full logging and message history
14+
- Supports curl command line arguments for easy onboarding from Developer Tools or Burp Suite (use 'Copy as Curl' menu and replace `curl` with `wsrepl`)
1415

1516
## Installation
1617

@@ -20,6 +21,14 @@ You can download and install wsrepl using pip:
2021
pip install wsrepl
2122
```
2223

24+
Alternatively, you can clone this repository and install it from source:
25+
26+
```
27+
git clone https://github.com/doyensec/wsrepl
28+
cd wsrepl
29+
pip install .
30+
```
31+
2332
## Usage
2433

2534
The basic command for starting wsrepl is as follows:
@@ -31,28 +40,42 @@ wsrepl -u URL
3140
Replace URL with your target websocket URL, e.g. `wss://echo.websocket.org`. For more options and settings, you can use the -h or --help option:
3241

3342
```
34-
usage: wsrepl [-h] -u URL [-s] [-A USER_AGENT] [-O ORIGIN] [-H HEADER]
43+
usage: wsrepl [-h] [-u URL] [-i] [-s] [-k] [-X REQUEST] [-H HEADER]
44+
[-b COOKIE] [--compressed] [-S] [-A USER_AGENT] [-O ORIGIN]
3545
[-F HEADERS_FILE] [--no-native-ping]
3646
[--ping-interval PING_INTERVAL] [--hide-ping-pong]
3747
[--ping-0x1-interval PING_0X1_INTERVAL]
3848
[--ping-0x1-payload PING_0X1_PAYLOAD]
3949
[--pong-0x1-payload PONG_0X1_PAYLOAD] [--hide-0x1-ping-pong]
40-
[-t TTL] [-p HTTP_PROXY] [-k] [-r RECONNECT_INTERVAL]
41-
[-i INITIAL_MESSAGES] [-P PLUGIN] [-v VERBOSE]
50+
[-t TTL] [-p HTTP_PROXY] [-r RECONNECT_INTERVAL]
51+
[-I INITIAL_MESSAGES] [-P PLUGIN] [-v VERBOSE]
52+
[url_positional]
4253
4354
Websocket Client
4455
56+
positional arguments:
57+
url_positional Websocket URL (e.g. wss://echo.websocket.org)
58+
4559
options:
4660
-h, --help show this help message and exit
4761
-u URL, --url URL Websocket URL (e.g. wss://echo.websocket.org)
48-
-s, --small Smaller UI
62+
-i, --include No effect, just for curl compatibility
63+
-s, --silent No effect, just for curl compatibility
64+
-k, --insecure Disable SSL verification
65+
-X REQUEST, --request REQUEST
66+
No effect, just for curl compatibility
67+
-H HEADER, --header HEADER
68+
Additional header (e.g. "X-Header: value"), can be
69+
used multiple times
70+
-b COOKIE, --cookie COOKIE
71+
Cookie header (e.g. "name=value"), can be used
72+
multiple times
73+
--compressed No effect, just for curl compatibility
74+
-S, --small Smaller UI
4975
-A USER_AGENT, --user-agent USER_AGENT
5076
User-Agent header
5177
-O ORIGIN, --origin ORIGIN
5278
Origin header
53-
-H HEADER, --header HEADER
54-
Additional header (e.g. "X-Header: value"), can be
55-
used multiple times
5679
-F HEADERS_FILE, --headers-file HEADERS_FILE
5780
Additional headers file (e.g. "headers.txt")
5881
--no-native-ping Disable native ping/pong messages
@@ -69,10 +92,9 @@ options:
6992
-t TTL, --ttl TTL Heartbeet interval (seconds)
7093
-p HTTP_PROXY, --http-proxy HTTP_PROXY
7194
HTTP Proxy Address (e.g. 127.0.0.1:8080)
72-
-k, --insecure Disable SSL verification
7395
-r RECONNECT_INTERVAL, --reconnect-interval RECONNECT_INTERVAL
7496
Reconnect interval (seconds, default: 2)
75-
-i INITIAL_MESSAGES, --initial-messages INITIAL_MESSAGES
97+
-I INITIAL_MESSAGES, --initial-messages INITIAL_MESSAGES
7698
Send the messages from this file on connect
7799
-P PLUGIN, --plugin PLUGIN
78100
Plugin file to load
@@ -108,7 +130,9 @@ class MyPlugin(Plugin):
108130
# ... Other hooks can be defined here.
109131
```
110132

111-
Refer to the source of [Plugin class](wsrepl/Plugin.py) for the full list of hooks you can use and what they do.
133+
Refer to the source of [Plugin class](wsrepl/Plugin.py) for the full list of hooks you can use and what they do:
134+
135+
![Plugin Hooks](docs/hooks-mermaid.png)
112136

113137
### Example Plugin
114138

@@ -138,13 +162,15 @@ wsrepl -u URL -P auth_plugin.py
138162

139163
Replace URL with your target websocket URL and auth_plugin.py with the path to the Python file containing your plugin.
140164

165+
[docs/](./docs/) directory contains a few more example plugins.
166+
141167
## Contributing
142168

143-
Contributions to wsrepl are welcome!
169+
Contributions to wsrepl are welcome! Please, [create an issue](https://github.com/doyensec/wsrepl/issues) or submit a pull request if you have any ideas or suggestions. In particular, adding more plugin examples would be very helpful.
144170

145171
## Credits
146172

147173
This project has been sponsored by [Doyensec LLC](https://www.doyensec.com/).
148174

149-
![Doyensec Research](https://github.com/doyensec/inql/blob/master/docs/doyensec_logo.svg "Doyensec Logo")
175+
![Doyensec Research](https://raw.githubusercontent.com/doyensec/inql/master/docs/doyensec_logo.svg "Doyensec Logo")
150176

docs/hooks-mermaid.png

301 KB
Loading

0 commit comments

Comments
 (0)