Skip to content

Commit 9a2a64a

Browse files
authored
Merge pull request #5 from m10x/main
Proper JSON Encoding
2 parents f2f15e9 + 809ca44 commit 9a2a64a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
Heavily based on an excellent writeup from Rayhan Ahmed: [Automating Blind SQL injection over WebSocket](https://rayhan0x01.github.io/ctf/2021/04/02/blind-sqli-over-websocket-automation.html)
55

6+
## Fork Changes
7+
- Proper JSON Encoding
8+
- before: " was replaced with ', leading to problems with payloads
9+
- now: using json.dumps to escape "
10+
611
## Example
712
```
813
sqlmap-websocket-proxy -u ws://sketcy.lol:1337 -p '{"id": "%param%"}'

src/sqlmap_websocket_proxy/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def send_inject(
7070
params = [x for _, x in parse_qsl(path)]
7171

7272
if json_encode:
73-
params = [unquote(x).replace('"',"'") for x in params]
73+
params = [json.dumps(unquote(x))[1:-1] for x in params]
7474

7575
for x in params:
7676
data = data.replace("%param%", x, 1)

0 commit comments

Comments
 (0)