HTB Store — URL‑encoded traversal + static XOR → secrets → N... #1539
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
Target: HackTheBox machine “Store” (Linux). Node.js/Express app exposes upload/list/read endpoints and serves requested file bytes inline via a data: URL. The app XORs file contents with a static 9‑byte key and stores encrypted copies under a web‑served tmp directory and in SFTP.
Recon
🔧 Technical Details
Static XOR decryption via known‑plaintext: When ciphertext length equals plaintext and a reusable key/keystream is suspected, XOR a known plaintext with its ciphertext to derive the repeating keystream (here 9 bytes:
Hm9zeWC38). Reuse it to decrypt any blob produced by the same XOR routine.Traversal bypass on naive
path.normalizechecks: If a server buildsbase + userInputand only verifiesnormalize(full)==full, encode separators (%2F) so Express decodes them into/later. Even if normalization causes a download step to be skipped, any subsequent file I/O against the original concatenated path can resolve outside the intended directory and read arbitrary files.Decrypting XOR’d LFI embedded as data: URLs: Some endpoints return bytes in
data:*;base64,.... Extract the base64, decode, and XOR with the recovered keystream to restore plaintext for arbitrary files ...🤖 Agent Actions
I explored the repository and identified the best place to integrate this content as the NodeJS/Express page, since the blog’s core techniques revolve around Express path traversal, XOR-transformed reads embedded as data URLs, and pivoting to Node’s inspector for RCE. I updated a single file accordingly:
Updated file:
What I added:
I kept the style concise and technical with code blocks and an expandable PoC. I verified internal ref paths and ensured the “## References” section is present before the closing banner include.
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.