Skip to content

Update hstshijack #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Update hstshijack #78

wants to merge 30 commits into from

Conversation

buffermet
Copy link
Member

@buffermet buffermet commented May 11, 2025

Depends on bettercap/bettercap#1195

Changes:

  • Implemented cookie domain spoofing.
  • Implemented cookie downgrade attack (for downgrading HTTPS).
  • Implemented req/res body regex replacement JSON config file.
  • Implemented req/res header regex replacement JSON config file.
  • Implemented req URL regex replacement JSON config file.
  • DOM spoofing is done with MutationObserver instead of a loop.
  • hijack.js payload now hijacks document.cookie getter and setter.
  • hijack.js payload now hijacks Element.innerHTML setter.
  • hijack.js payload now hijacks Element.outerHTML setter.
  • hijack.js payload now hijacks HTMLLinkElement.href setter.
  • hijack.js payload now hijacks HTMLScriptElement.nonce setter.
  • hijack.js payload now hijacks HTMLScriptElement.src setter.
  • HTTP proxy module now spoofs preflight response headers.
  • HTTP proxy module no longer hardcodes CSP headers, only removes them.
  • DNS proxy module drops AAAA queries by default.
  • Fixed bug in HTTP proxy module where HTTPS scheme was not properly restored in request headers for the requested hostname.
  • Fixed bug where spaces were removed from file paths in environment variables.
  • Fixed bug where Access-Control-Allow-Origin response header was incorrectly spoofed.
  • Reduced a great deal of overhead in the HTTP proxy module by precompiling regex selectors where possible.
  • Changed indentation from spaces to tabs.
  • Cleaned up caplet folder structure.

To do:

  • Improve res/req header & body spoofing by assembling string slices using match length and indices.
  • Refactor res body spoofing so we can target every mimetype/extension/... from the res.Body.json config.
  • Implement configurable sync/async SSL discovery mechanism for requested hostnames that we don't know yet.
  • Complete optionality of cookie downgrade attack in the DOM (hijack.js payload).
  • Extend whitelisting to also stop sending spoofed DNS responses to whitelisted clients for whitelisted hostnames in DNS proxy module. Don't do this because it blocks the HTTPS redirect.
  • Allow the option to set global variable names across multiple JS payloads that get obfuscated by the HTTP proxy module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant