Persistance
Last updated
Last updated
When a Google Workspace account is configured to receive multi-factor authentication (MFA) codes via email, and the attacker already knows the password, gaining access to an authenticated session (via cookie theft, malware, phishing, or internal access like VDI sessions that bypass MFA) allows for persistence by configuring Google AppScript to automatically forward MFA codes to an external email address. This ensures sustained access even when the session expires or reauthentication is required. It also circumvents outbound email filter restrictions that block manual forwarding rules.
With an active session of the victim’s Google account, go to:
Paste the following code:
Go to:
Deploy > New Deployment > Select Type: Web App
Fill in the fields:
Description: Update 2.1
Execute as: Me
Who has access: Anyone within example.com
This URL is critical. It remotely triggers the forwarding of any MFA emails to the attacker's address.
Important: Ensure the copied URL is from the Web App, not the library.
Accessing the generated URL will execute the script and forward the latest relevant MFA email.