Skip to content
leg3ndProjects & tools
01Home02Projects03Tools04Notes
GMT+8
O/ OSCP exploitation reference
Workspace controls Memory only · 0 steps
Visualize path ↗
Command values 0 filled

Temporary connection values clear on reload. Passwords, hashes and tickets remain placeholders. Check address-family syntax in the selected command.

Reference index ↗ Search all procedures & variants ↗
01Discovery02Enumeration03Initial access04Usable access05Local privilege06Active Directory07Internal access08Evidence & reporting

QUICK REFERENCE

Discovery›Services›Web mapping›Web exploitation›Credentials›Public exploits›Sessions & transfers›Linux escalation›Windows escalation›AD enumeration›AD identity attacks›Lateral movement›Pivoting & tunnels›Execution troubleshooting›Integration & evidence›
174 methods · 15 topicsFull reference on GitHub ↗Commands · scripts · next steps
Tools/OSCP/Initial access/Web exploitation
← All web exploitation tasks

Validate unsafe YAML object construction

CommandsIf → thenExplanation & examples

Needs: The application uses an unsafe PyYAML loader that permits the selected Python object constructor

Commands

# Baseline
!!python/object/apply:os.system ["id"]

Verify → Require source/configuration evidence for the loader and an attributable effect; a .yml extension is insufficient.

If it fails → ConstructorError often indicates safe or restricted loading. Preserve that negative evidence instead of trying unrelated tags blindly. More detail ↓

If → then

  • A PoC, injected command or remote client reports execution → Verify command execution, host and represented identity

    Needs: A functioning execution primitive and an observable output or controlled side effect

  • A simple command works while a longer or nested payload fails → Repair quoting, encoding and command-length boundaries

    Needs: Known outer request/template/database parser and inner shell; correct character encoding and transport length

  • A product/version clue, advisory or component-specific public PoC → Match a public exploit to the actual component and configuration

    Needs: Exact vulnerable build/configuration, required access and endpoint behavior; reviewable source and a verifiable expected effect

No useful finding → another task in this topic. Failed check → resolve the failure before ruling out the path.

Explanation & examples

Validate unsafe YAML object construction

USE WHEN
Source or errors identify server-side Python YAML loading of controlled content
STARTING ACCESS
A reproducible application request and a controlled input or access-context comparison
RESULT
A verified command or object-construction effect in the loader process

Recognize the clue

Inspect source/errors for the actual Python YAML loader before placing a constructor in the application's required schema.

!!python/object/apply:os.system ["id"]
SYNTHETIC EXAMPLE OUTPUT
Loader evidence: unsafe loader
Effect: command-specific identity output

Means: The application constructed the selected Python object under an unsafe loader.

Confirm: Confirm loader/version and an attributable effect in the real import/request path.

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.
Still inconclusive
A .yml extension without loader evidence leaves the condition unknown.

Troubleshooting: ConstructorError often indicates safe or restricted loading. Preserve that negative evidence instead of trying unrelated tags blindly.

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.

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.

Why it works

YAML syntax is not itself dangerous; the selected loader and allowed constructors define the capability.

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.

New identity, privilege, host or route? Re-enumerate → All topic tasks →

Study guide ↗Full procedure ↗Cheatsheet ↗
HomeProjectsToolsNotes
Interactive toolsOSCP notes ↗Extended OSCP workspace ↗Attack-path visualizer ↗

© 2026 Armaan. Built with curiosity.

GitHub ↗GMT+8