TokenTacticsV2 icon indicating copy to clipboard operation
TokenTacticsV2 copied to clipboard

Added MFA bypass via definition of a Custom User Agent

Open Pri3st opened this issue 9 months ago • 1 comments

Added a -CustomUserAgent parameter to all the (Get|Invoke)-*Token functions. This essentially allows the bypass of MFA enablement gaps related to Device Platforms, as shown in the image below. 414702088-db6fefad-98d8-4fca-af71-9d27599c1fee

Using an out-of-the-ordinary user agent, like Yahoo! Slurp (Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp) bypasses the interaction_required warning when combinations of the -Device & -Browser parameters fail. The MFA bypass happens because the current configuration that seems secure works as a blacklist, allowing every other User Agent that is not included in it.

Bypassed CAP Policy Example
Applies to Including: Users:
Applications Including: All applications
On platforms Including: Android, iOS, Windows, Windows_Phone, macOS, Linux
Using clients Including: Legacy Clients, Mobile and Desktop clients, Exchange ActiveSync, Browser
Controls Requirements (any): Mfa
Session controls SignInFrequency

Moreover, this argument could also contribute to OPSEC. If one knows the devices that a user utilizes to perform their everyday tasks (e.g. through OSINT), they can use the corresponding User Agent to avoid detection through out-of-the-ordinary User Agents in authentication logs.

The bypass has been successfully battle-tested. PoC can be provided if needed.

Pri3st avatar Mar 14 '25 18:03 Pri3st

@f-bader I have resolved the conflicts and tested the proper functionality of the tool to successfully include the new MFA bypass feature.

I have also closed the previous PR.

Pri3st avatar Mar 14 '25 18:03 Pri3st

Sorry @Pri3st that it me so long to test and approve the PR. Thank you for your contribution and your gentle reminder

f-bader avatar Jun 08 '25 13:06 f-bader