An advanced phishing tool that uses a technique combining the OAuth Device code authentication flow and QR codes

AVvXsEgttmELdITUTzXbOUGIkSlkLHY5zCtzi0UdrK9qCGGwrZUTAQYLFja6hoNtdwohNEiATcE62WZIcsP1 VbUEWT26Zn0yU5nRyPWPMGgDoDohnjWFs8fUcdlbuGuCkJstV18YEzPexF4XV62xaZAs3qkI2yY9DiyMgDAaZIcq0JJcfuxjFX2BnLRt8RRtw=w516 h640

SquarePhish is an advanced phishing tool that uses a technique combining the OAuth Device code authentication flow and QR codes.

See PhishInSuits for more details on using OAuth Device Code flow for phishing attacks.


_____ _____ _ _ _
/ ____| | __ \| | (_) | |
| (___ __ _ _ _ __ _ _ __ ___| |__) | |__ _ ___| |__
\___ \ / _` | | | |/ _` | '__/ _ \ ___/| '_ \| / __| '_ \
____) | (_| | |_| | (_| | | | __/ | | | | | \__ \ | | |
|_____/ \__, |\__,_|\__,_|_| \___|_| |_| |_|_|___/_| |_|
| |
|_|
_________
| | /(
| O |/ (
|> |\ ( v0.1.0
|_________| \(

usage: squish.py [-h] {email,server} ...

SquarePhish -- v0.1.0

optional arguments:
-h, --help show this help message and exit

modules:
{email,server}
email send a malicious QR Code ema il to a provided victim
server host a malicious server QR Codes generated via the 'email' module will
point to that will activate the malicious OAuth Device Code flow

Attack Steps

An attacker can use the email module of SquarePhish to send a malicious QR code email to a victim. The default pretext is that the victim is required to update their Microsoft MFA authentication to continue using mobile email. The current client ID in use is the Microsoft Authenticator App.

By sending a QR code first, the attacker can avoid prematurely starting the OAuth Device Code flow that lasts only 15 minutes.

AVvXsEgttmELdITUTzXbOUGIkSlkLHY5zCtzi0UdrK9qCGGwrZUTAQYLFja6hoNtdwohNEiATcE62WZIcsP1 VbUEWT26Zn0yU5nRyPWPMGgDoDohnjWFs8fUcdlbuGuCkJstV18YEzPexF4XV62xaZAs3qkI2yY9DiyMgDAaZIcq0JJcfuxjFX2BnLRt8RRtw=w516 h640

The victim will then scan the QR code found in the email body with their mobile device. The QR code will direct the victim to the attacker controlled server (running the server module of SquarePhish), with a URL paramater set to their email address.

AVvXsEisc9z0jSx7X P7u1J6BSB44M2ROK52tXgag6ApLECHeg4BowT1rhMCZX2KtsYvHbiZq P2yLChO W1RLYFiDe IVlnmfgtLBkMwVc4kSWkuNzyyrq20AUMQrt1Mp7yqO6uGbzjsDJGuplbddJOAWab3oNm6C gCQOhCG4 DIl2XmCGBNv0xnsyzmdfuw=w370 h640

When the victim visits the malicious SquarePhish server, a background process is triggered that will start the OAuth Device Code authentication flow and email the victim a generated Device Code they are then required to enter into the legitimate Microsoft Device Code website (this will start the OAuth Device Code flow 15 minute timer).

AVvXsEiH2Wm69 7ZH1OPOV8UAvFFQ7a1GoVc42kRpE1U9qG1L002JDjijFmfURPEMAPGVJnXG1FRxjLQu9TkvwG HPNcRdtwY5R4mR3ecyhiPHgn5I50IbZYzZwNhetxwO RSnXaAp3uj 7lIRbdYUN2Vs09peLqO9TDkF1snvhUS8ssU4b970kWW3 E6keHkg=w640 h412

The SquarePhish server will then continue to poll for authentication in the background.

The victim will then visit the Microsoft Device Code authentication site from either the link provided in the email or via a redirect from visiting the SquarePhish URL on their mobile device.

AVvXsEh1KvJizK OueapfwFqmFEf2vbmB2wM0Y hP0MdB9xPLFWZiAe6uyhrUG5cD U zWN 6Aqt8 K57f0yzkWaV3OZQmbQt7zPiXv6z6m74SOX1lt LJG9OYzaQyrdAJVTUSxGMaVxjZtSFiinUimP T6dvFfuGyTGbLAddW llc Iqe0NFpIN8aoXRBUemg=w640 h506

The victim will then enter the provided Device Code and will be prompted for consent.

AVvXsEj4sds3 J8eqoDw3YrbtTWx5TzHxkKfAkChXSDTKCqmndk5xlWmX1Q5UOAdZ5oDHjZ0kPX5M07daccDCtcZcTJlDA 0BQhg9yzwECm52Qe12t0LEK34us9vaxt1E5u4iSOF8po9e 8MNkphnEq8K6TpUeBEJ79iOww4NY3ak4EfPqbYKFn7N15iutzFXg=w640 h500

After the victim authenticates and consents, an authentication token is saved locally and will provide the attacker access via the defined scope of the requesting application.

The current scope definition:

"scope": ".default offline_access profile openid"

!IMPORTANT: Before using either module, update the required information in the settings.config file noted with Required.

Email Module

Send the target victim a generated QR code that will trigger the OAuth Device Code flow.

usage: squish.py email [-h] [-c CONFIG] [--debug] [-e EMAIL]

optional arguments:
-h, --help show this help message and exit

-c CONFIG, --config CONFIG
squarephish config file [Default: settings.config]

--debug enable server debugging

-e EMAIL, --email EMAIL
victim email address to send initial QR code email to

Server Module

Host a server that a generated QR code will be pointed to and when requested will trigger the OAuth Device Code flow.

usage: squish.py server [-h] [-c CONFIG] [--debug]

optional arguments:
-h, --help show this help message and exit

-c CONFIG, --config CONFIG
squarephish config file [Default: settings.config]

--debug enable server debugging

Configuration

All of the applicable settings for execution can be found and modified via the settings.config file. There are several pieces of required information that do not have a default value that must be filled out by the user: SMTP_EMAIL, SMTP_PASSWORD, and SQUAREPHISH_SERVER (only when executing the email module). All configuration options have been documented within the settings file via in-line comments.

Note: The SQUAREPHISH_ values present in the ‘EMAIL’ section of the configuration should match the values set when running the SquarePhish server.

Custom Pretexts

Currently, the pre-defined pretexts can be found in the pretexts folder.

To write custom pretexts, use the existing template via the pretexts/iphone/ folder. An email template is required for both the initial QR code email as well as the follow up device code email.

Important: When writing a custom pretext, note the existence of %s in both pretext templates. This exists to allow SquarePhish to populate the correct data when generating emails (QR code data and/or device code value).

OPSEC

There are several HTTP response headers defined in the utils.py file. These headers are defined to override any existing Flask response header values and to provide a more ‘legitimate’ response from the server. These header values can be modified, removed and/or additional headers can be included for better OPSEC.

{
"vary": "Accept-Encoding",
"server": "Microsoft-IIS/10.0",
"tls_version": "tls1.3",
"content-type": "text/html; charset=utf-8",
"x-appversion": "1.0.8125.42964",
"x-frame-options": "SAMEORIGIN",
"x-ua-compatible": "IE=Edge;chrome=1",
"x-xss-protection": "1; mode=block",
"x-content-type-options": "nosniff",
"strict-transport-security": "max-age=31536000",
}

administrator

Leave a Reply

Your email address will not be published. Required fields are marked *

fb logo
recover dogecoin from a scam
recover ethereum from a scammer
hire a hacker to hack iphone
hire a hacker to hack snapchat
hire a hacker to hack a windows computer
error: Content is protected !!