You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Powershell payload do not work when using azure domain fronting but do work without the domain fronting or with Empire 2.5 with&&without domaine fronting
To Reproduce
Steps to reproduce the behavior:
Install Empire on a cloud VM (2vcpu 4gig)
Create your Azure CDN and test if the redirection properly work
Configure your listener and Stager
Generate a payload and execute it on the target and see if the agent connect back
Expected behavior
Victim get redirected to Empire and download the agent and execute it
Additional context
1.Protocol tested
80:HTTP and 443:HTTPS was tested
So the explanation seems to be that the python code responsible for setting the "$customHeaders" variable in Start-Negotiate (listeners/http.ps1) tries to do two things at once : enabling multiple headers to be added to the requests, each one separated by a comma, and splitting each header by the colon character (as in "host:something.azureedge.net").
Unfortunately, it seems when there is only one custom header, the key/value pair is added with a comma separating them : $customHeaders = "host, something.azureedge.net"
we first tried to change that comma back to a colon, and everything works. After digging deeper, it seems the fault lies in the code around line 597 in listeners/http.py:
if customHeaders != []:
for key in customHeaders:
value = key.split(":")
if 'cookie' in value[0].lower() and value[1]:
continue
remove += value
#new statement, works
headers = ':'.join(remove)
# headers = ','.join(customHeaders)
stager = stager.replace("$customHeaders = \"\";", "$customHeaders = \"" + headers + "\";")
Looks like our change is only a temporary one, as I think it breaks the multiple header option. But for now, we have a working Empire with domain fronting.
Empire Version
OS Information (Linux flavor, Python version)
Describe the bug
Powershell payload do not work when using azure domain fronting but do work without the domain fronting or with Empire 2.5 with&&without domaine fronting
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Victim get redirected to Empire and download the agent and execute it
Additional context
1.Protocol tested
80:HTTP and 443:HTTPS was tested
2.To create the CDN, I have followed Truneski tutorials
3.Test for the cdn redirection:
Serve a test file on the server and see if you can get to it
4.Listener Config
5.Stager Config
The text was updated successfully, but these errors were encountered: