Move a small artifact through a text-only channel
Needs: Available Base64 encode/decode, adequate command length and a writable destination
Encode on Linux
# Encode on Linux
base64 -w 0 FILE
# Decode on Linux
printf '%s' 'BASE64_DATA' | base64 -d > /tmp/FILE
Decode in PowerShell
# Decode in PowerShell
[IO.File]::WriteAllBytes('C:\Windows\Temp\FILE',[Convert]::FromBase64String('BASE64_DATA'))
Verify → Require a complete matching hash; keep encoded secrets in private evidence rather than reusable notes.
If it fails → Truncation, wrapping and quoting often corrupt long values. Use a network transfer for larger files. More detail ↓
Explanation & examples
Move a small artifact through a text-only channel
- USE WHEN
- The existing command channel permits text but no convenient file-transfer connection
- STARTING ACCESS
- Verified command execution or authenticated remote access and a known network path
- RESULT
- A reconstructed small file with matching bytes
Recognize the clue
Inspect the existing channel's command-length/quoting limits and whether both sides can reconstruct a small encoded file.
command -v base64
wc -c FILE
/usr/bin/base64
SMALL_BYTE_COUNT FILEMeans: A small artifact and compatible decoder make text transport plausible, without assuming large encoded commands survive.
Confirm: Verify exact length/quoting and source/destination hash; use the Windows decoding variant when appropriate.
- After validation
- The complete decoded bytes match: use the text-transfer result.
- Ruled out in this context
- The channel truncates below the required encoded size: reject a one-command transfer of this artifact.
- Still inconclusive
- Unknown command limits require a harmless small round trip before relying on the channel.
Troubleshooting: Truncation, wrapping and quoting often corrupt long values. Use a network transfer for larger files.
Additional prerequisite checks
base64 -w 0 FILE
sha256sum FILE
Base64 — move a small file through a text-only channel
Encode on Linux
Decode on Linux
Decode in PowerShell
Use this for small files. Long encoded values are easy to truncate or corrupt; compare hashes.
Why it works
Base64 transports bytes through text; it does not encrypt them or guarantee that the command channel preserves length and quoting.
Worked example · hypothetical
Observation: a short configuration must cross a command-only channel. Test: encode, decode at the destination and compare hashes. Illustrative output: the hash matches. Interpretation: the byte transport succeeded; execution compatibility remains separate.
New identity, privilege, host or route? Re-enumerate → All topic tasks →