MuhammadShahmeerAmir Tutorial BreakingBarriers
MuhammadShahmeerAmir Tutorial BreakingBarriers
Generation
2FA & MFA
Implementation
Implementation of 2FA/MFA
Brute Force
Request
and it’s OAuth Bypass
method
bypasses
Broken session
Response code Random
management
manipulation Backup Codes
bypass
Input
Forced
CSRF parameter
Browsing
poisoning
• Client-side proxy
• Number wordlists
• Proxy servers list file
Brute Force and it’s bypasses
• This technique refers to a flaw in implementation where the 2FA code is being leaked
in the application responses or internal files
Bypassing App 2FA – Leaking in HTTP response
Bypassing 2FA – Secret key disclosure
• This secret value is disclosed to all Admin type users and lower privilege users cannot
see this page. When a user enables the 2FA feature, he needs to scan that QR code in
Authenticator app and if we decode that QR code we see this format:-
otpauth://totp/<your-email>?secret=<totp_secret_key>&issuer=Target
• Here `totp_secret_key` value is unique for all users and cannot be brute forced. I took
this secret key from team page of other admin user and replaced value in above format. I
generated a QR code from a website and scanned this in the Authenticator app. Then I
tried login in with another user's credentials and entering OTP on 2FA page and it
worked.
Bypassing 2FA – Secret key disclosure
• Login to your account.
• Go to https://app.target.com/dashboard/team/
• In Burpsuite, You will see a GET request with a /api/dashboard/team/ URL in it.
• Send it to repeater
• You can see the totp_secret_key value of other users in the response.
• Copy the value and email address of that user. Paste both the value in this
otpauth://totp/your%40email.com?secret=[your-totp-secret-key]&issuer=Target
• Go to https://www.the-qrcode-generator.com/ and paste the crafted text in it.
• Your QR code will be generated. Scan it in authenticator app (DUO mobile) and it will accept
that QR code.
• Now logout from the website and enter the correct credentials of the victim user.
• Enter the code from the authenticator app and it will log in to you successfully.
Bypassing 2FA – Secret key disclosure
Input parameter poisoning
• Input Parameter Pollution (IPP) is an attack evasion technique that allows an attacker to
craft a HTTP request in order to manipulate or retrieve information .This technique
allows an attacker to poison the input parameter by using multiple techniques,
Bypassing Glassdoor 2FA – Nullbytes
• In simple terms, the 2FA while logging was be bypassed by sending a blank code. This
could have been because of incorrect comparison of entered code with true code.
Bypassing Paypal 2FA – Challenge & Response
Attacker selects
Attacker logs into Attacker enters
alternative option to
account incorrect answers
login CIT
Attacker removes
Attacker intercepts
“challenge” and
request with Burp
“response” fields –
Suite
Access Granted
Response manipulation
• This technique allows a user to bypass 2FA by manipulating the response of a certain
request via request interception. An attacker can change the response of a certain
request which in turn forces the server to change the response as well
Bypassing Unknown Site 2FA – Response Body
• An account with the 2FA authorization would receive a response similar to
• Whereas, a 2FA authentication enabled account would recieve a response similar to the
below one.
Bypassing Unknown Site 2FA – Response Body
• Website uses an Authorization token in it’s request, and this token is provided only if the
2FA step gets completed. The hidden response.
Bypassing Unknown Site 2FA – Response Body
Attacker
changes
Attacker response code
intercepts and
response with corresponding
Attacker puts data to 200 OK
incorrect Burp suite
response code Proxy
Attacker logs
into account
Bypassing Shapeshift 2FA – Response Code –Evan Ricafort
Random Backup Codes
• Backup codes are way to recover your 2FA codes when you do not have access to your
2FA device. In some applications, client-side checks are not implemented properly
Bypassing Unknown Site 2FA – Backup Codes
DELETE /api/v2/mfa
• Replacing the POST method with DELETE disables 2FA on the 2FA login page
OAuth Bypass
• OAuth mechanisms are used to login users into accounts via social media integrations.
There implementations by default bypass 2FA allowing attackers to gain access to user
accounts
Bypassing SalesforceIQ 2FA – Universal Oauth
Attacker
Attacker clicks on
compromises
“Login via
user's facebook
Facebook”
account
Attacker is granted
access to the
victim’s account
Bypassing OpenID 2FA - Universal
• OpenID Connect (OIDC) is an open authentication protocol that works on top of the OAuth
2.0 framework. Targeted toward consumers, OIDC allows individuals to use single sign-on
(SSO) to access relying party sites using OpenID Providers (OPs), such as an email
provider or social network, to authenticate their identities.
• The first thing that stood out was the acr_values parameter. The first and obvious idea was
to try removing the otp value and only keeping the password value. While I was correctly
redirected to the Identity Provider's login page, upon logging in with correct credentials, I
was always facing a 401 if the otp value was removed.
Bypassing OpenID 2FA – Universal (Contd)
• Basically, the acr_values parameter would tell the Identity Provider what authentication
methods the client requests. Upon fulfilling the login flow, the callback to the client
website will contain a JWT, which if decoded, would contain the AMR value used like so:
{"alg":"HS256","typ":"JWT"}.{"state":"123456789","auth_time":1234,"amr":["pwd","otp"] ...
• OpenID configurations relying on AMR should make sure to only accept trusted and
validated authentication methods.
Bypassing OpenID 2FA – Universal (Contd)
• The website asked to enter the 2FA code and the url was like:
https://example.com/react-aspx/Authenticator.aspx
• An idea came to my mind to enter the url of the dashboard directly which was like:
https://example.com/home.aspx
• I was able to bypass 2FA and access the account.
Bypassing 2FA via forced browsing in POST
1. Attacker enrolls in multi-factor authentication using an authenticator app and stores the
device’s factor ID.
2. Attacker enters a user’s email address and password on account.box.com/login.
3. If the password is correct, the attacker’s browser is sent a new authentication cookie
and redirects to: /2fa/verification.
4. The attacker, however, does not follow the redirect to the SMS verification form. Instead,
they pass their own factor ID and code from the authenticator app to TOTP verification
endpoint: /mfa/verification.
5. The attacker is now logged in to the victim’s account and the victim does not receive an
SMS message.
Bypassing Box’s 2FA – Using forced browsing
Bypassing Box’s 2FA – Using forced
browsing
Bypassing MFA
• MFA is different from 2FA that because it allows options more than the codes and
iterations. MFA can be localize
Bypassing MFA
Wireless Guest
SIM Swapping MITM - Phishing
Network
Phishing kits
• expiryrequest-mailaccess[.]com
• expirationrequest-passwordreminder[.]com
• emailaccess-passwordnotice[.]com
• emailaccess-expirynotification[.]com
Bypassing Microsoft MFA Using Phishing - ZScaler
• The redirections occur via legitimate web
resources to help evade email and internet
security tools, with the threat actors
showing a preference for open redirects on
Google Ads, Snapchat, and DoubleClick.
Sadly, some platforms do not consider
open redirects a vulnerability, leaving them
available for abuse by threat actors.
Bypassing Microsoft MFA Using Phishing - ZScaler
Once the victim reaches the phishing page, they are fingerprinted by JavaScript, which
evaluates if the target is on a virtual machine or a normal device.
Legacy Protocols
• For a long time, the tool MailSniper was a go to for bypassing MFA. The tool’s
“Invoke-SelfSearch” functionality used Exchange Web Services (EWS) to
programmatically log in to a compromised account and extract information from an
employee’s inbox.
• A new tool was also released called MFASweep that tests various authentication
methods potentially bypassing MFA.
MFA Fatigue attacks
• When a user authenticates to an SP, they are redirected to the IdP to authenticate.
Upon successful authentication to the IdP, a cryptographically signed “SAML Assertion”
is given to the user to complete their authentication with the SP.
Bypassing MFA via Golden SAML
Impersonate either the
AD FS service account Extract the following The target cloud user's
Compromise an AD FS
or a local administrator data from the ObjectGUID and
server.
account on an AD FS environment: UserPrincipalName • An attacker had to perform the
server. following steps to conduct a
Golden SAML attack:
Decrypt the
Build the SAML token Use the decrypted
EncryptedPfx with the
using the target cloud token-signing certificate Pass the signed SAML
DKM master key to
user’s ObjectGUID and to cryptographically sign token to the cloud.
obtain the decrypted
UserPrincipalName. the SAML token.
token-signing certificate.
• Traditional phishing attacks will often clone a website or attempt to drop malware to
compromise and steal sensitive data from the phished victim. However, the use of multi-
factor authentication (MFA) can mitigate cases where sensitive data is stolen, as this
adds an extra layer of protection required to access the account or service.
Bypassing MFA using MITM and Phishing
• As you might imagine, there are multiple ways of bypassing the Android Biometric
Authentication. One requires the lack of usage of the crypto object, which means that
the authentication object is not stored in the Keystore, so it does not require a valid
fingerprint to unlock the application.
• Another method involves bypassing the insecure usage of the crypto object, which
means that if the key is not used to decrypt any data in the application, the
authentication can be bypassed.
Bypassing Android Biometrics Authentication – Crypto Object
• The authentication implementation relies on the callback onAuthenticationSucceded
being called. The researchers from F-Secure developed a Frida script that can be used
to bypass the NULL CryptoObject in onAuthenticationSucceeded(…). The script will
automatically bypass the fingerprint when the aforementioned method is called. Here is a
short example that shows the bypass for the Android Fingerprint. The complete
application can be downloaded from my GitHub.
Bypassing Android Biometrics Authentication – Crypto Object
Bypassing Android Biometrics Authentication – Exception Handling
• All the script needs to do is manually call the onAuthenticationSucceded with a non-
authorized (not unlocked by fingerprint) CryptoObject stored in the Keystore.
• The catch is if the application will attempt to use another cipher object, then an exception
will be thrown. This script will attempt to call onAuthenticationSucceded and catch the
exception javax.crypto.IllegalBlockSizeException in Cipher class. From now on, any objects
the application uses will be encrypted using this new key.
Bypassing Android Biometrics Authentication – Exception Handling
Bypassing iOS Biometrics Authentication
• During a local authentication, an app authenticates the user against credentials stored
locally on the device. In other words, the user “unlocks” the app or some inner layer of
functionality by providing a set of valid biometric characteristics such as face or
fingerprint, which is verified by referencing local data.
Bypassing iOS Biometrics Authentication
• Another valid method used to bypass the iOS Biometric Local Authentication is to use
objection and its pre-build script. Firstly, attach the object to the target application.
“Our tests showed that—on average—we achieved an ~80 percent success rate while
using the fake fingerprints, where the sensors were bypassed at least once," Cisco Talos
says. "Reaching this success rate was difficult and tedious work. We found several
obstacles and limitations related to scaling and material physical properties. Even so, this
level of success rate means that we have a very high probability of unlocking any of the
tested devices before it falls back into the pin unlocking.”
Bypassing Fingerprint Scan
Bypassing Whatsapp MFA
• In Android, WhatsApp “Screen Lock” feature
allows the user to lock the app using available
device biometric credentials (Fingerprint, Face ID,
PIN, and Pattern).
• The “Auto Lock” feature will lock the app
automatically after user-specified duration. If the
user opted for “1 minute”, then the app will be
locked after 1 minute of inactivity.
• The issue here is, if the user receives a
WhatsApp call from someone after 1 minute or
later, then the app FAILS to lock. So an attacker
can easily bypass the biometric lock just by
making a call and rejecting it to access the app
completely (read chats, send messages…).
Bypassing Whatsapp MFA
It fails to lock now because the {app closed time} is saved after the call is ended and the
“time difference” is < {user specified duration}.
Bypassing Google Pixel MFA – David Schutz