-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Enabling mimicking the client's user agent #7726
Comments
This is a tough one to come up with a reasonable answer for. I have pondered this myself. The thing is that user agents not only vary from browser to browser, but they can also be butchered by third party apps. So knowing the "true" user agent for a given client would best be determined by looking at a request actually made by the client. That opens up a huge can of worms. Clearly it'd be possible to come up with something and implement it in Meterpreter itself, but there's no way that this can be worked into the stagers. I'll think on it a bit more, but yeah I'm not sure how we can build this in nicely without causing other issues. It scares me :) |
Bumping this thread again. Any chance for input? |
I think there is some traction in this area lately. We certainly found some tricky scenarios overriding this with Java payloads. |
This is now implemented via the |
Hooray! You are very welcome! |
This is in reference to closed PR #4984 and Issue #4933 that I'm now re-working after code churn in that area. Although a new common list of UAs has been added, it doesn't really address the issue. Disclaimer: this is the first time I'm adding a new feature (and hopefully the first PR I land!).
Bottom line:
User-agent monitoring can be used to detect unwanted egress connections from within a network, which can bugger your otherwise well planned red team engagement. The feature I want to add adds a new listener response that echos back to the client their user agent. There's no way to reliably determine the client's user agent on its local machine, so the approach I took was for the payload (which I've incorporated into Veil) to first launch a hidden IE window, browse to the /echoua URI, and receive back the user agent. Then, the use that UA to stage and setup the reverse shell. That way, the communication will look more in line with the network's baseline.
My problem/question
After the refractering ( ) that was done on the reverse HTTP/S payloads, it's unclear exactly how I can implement this. Now info[:mode] is used to determine how to handle the request. I don't want to muddy this new elegant solution, but the only way I can see add this feature is to:
OR
Other stuff
The rest of what needs to be changed is clear for me I believe (new/updated meterpreter options, sending the response back, getting the UA set in transport config...).
Your help / thoughts / expertise are greatly appreciated!
The text was updated successfully, but these errors were encountered: