Skip to content

Support for custom headers in powershell stager for http listeners - #832

Closed
ruvolof wants to merge 1 commit into
BC-SECURITY:mainfrom
ruvolof:support_custom_headers_for_http_listener
Closed

ruvolof wants to merge 1 commit into
BC-SECURITY:mainfrom
ruvolof:support_custom_headers_for_http_listener

Conversation

@ruvolof

@ruvolof ruvolof commented Jul 25, 2026 •

Copy link
Copy Markdown

Describe your changes

  • Populating a dict in comms.ps1 with custom headers so that stagers maintain the custom headers set by the operator.

Issue ticket number and link (if there is one)

#831

Checklist before requesting a review

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests.
  • I have added an entry to CHANGELOG.md
  • [-] I have updated the documentation in docs/ (if applicable)

@ruvolof
ruvolof force-pushed the support_custom_headers_for_http_listener branch from f39d78a to af71f9d Compare August 5, 2026 20:26
The powershell stager/comms for the http, http_hop and port_forward_pivot
listeners did not send the profile's custom headers. This wires them
through properly:

- Add parse_custom_headers() and pass a custom_headers dict into the
  powershell templates, replacing the old brittle string-replacement
  patch on the rendered stager.
- Populate $Script:Headers in comms.ps1.j2 and apply the headers during
  staging in http.ps1.j2 (with host-header domain-fronting handling).
- The header loop tolerates a missing custom_headers so render paths that
  do not supply it (e.g. http_foreign) are unaffected.
- Add tests covering header parsing and stager/comms injection.
@ruvolof
ruvolof force-pushed the support_custom_headers_for_http_listener branch from af71f9d to f31bc58 Compare October 11, 2026 08:11
@Cx01N

Cx01N commented Oct 12, 2026

Copy link
Copy Markdown
Member

Thanks @ruvolof! This was hand-ported onto the 7.0 listener layout (listeners moved to listeners/<name>/listener.py + .j2 templates, so it no longer applied cleanly) with you credited via Co-authored-by. It will ship here with the next release. Closing as superseded.

@Cx01N Cx01N closed this Oct 12, 2026
@ruvolof
ruvolof deleted the support_custom_headers_for_http_listener branch October 27, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants