Progressive Web Apps or PWAs are applications that are built using web technologies (i.e. HTML, CSS, JavaScript) that can be installed and behave similarly to native applications. PWAs integrate with the OS better (i.e. they have their own app icon, can push notifications) and therefore they can lead to higher engagement for websites. The issue with PWAs is that manipulating the UI for phishing purposes is possible as we’ll explore in this blog.
Before showing an attack scenario using a PWA, we’ll need to understand how to create one. Feel free to skip this section as I provide a working template on my GitHub for testing at the end of this post. At a basic level, a PWA requires the following files:
Manifest File - The manifest is a JSON file that provides metadata about the web application. It allows the app to be installed on the user’s home screen.
Service Worker - A script that the browser runs in the background. This is used for enabling offline capabilities, push notifications, and background sync.
Styles and Scripts - Any additional CSS and JavaScript files for the PWA to function correctly.
Attack Scenario
Now that we understand how a PWA file is created, we can start weaponizing it for phishing. We will perform the following attack scenario:
Victim accesses an attacker-controlled website.
Victim clicks an “Install Microsoft Application” button.
A browser pop-up appears asking the user to install the application. We can name our application anything such as “Microsoft Login” or “login.microsoftonline.com”. Keep in mind that our real domain name will show in smaller font underneath.
Victim installs application.
Upon successful installation, redirect the PWA window to a phishing page with a fake URL bar attached to the top of the page.
Needless to say, this scenario can be tailored to any other company besides Microsoft.
Step 1 - Setting Up Landing Page
We start by creating our landing page with the “Install Microsoft Application” button.
The demo below performs the previously mentioned steps but instead redirects users to a fake Microsoft phishing page that captures credentials. For higher quality Для просмотра ссылки ВойдиилиЗарегистрируйся.
Application Icon
Notice how the application’s icon is set to the Microsoft Logo, making it more realistic.
I’ve included the demonstration PoC on my GitHub. You can find the files Для просмотра ссылки ВойдиилиЗарегистрируйся.
Conclusion
As we saw, PWAs open up the path for UI manipulation that can trick users into believing they’re on a different website. This technique clearly has some disadvantages such as the requirement of the target user to install the application. Additionally, the PWA window briefly displays the actual domain name in the top right corner. However, I believe people’s habits of checking the URL bar will lead them to disregard that domain name (security awareness is required for this).
It may also be worth mentioning that prior to posting this blog I did find someone raising a Для просмотра ссылки ВойдиилиЗарегистрируйся regarding the abuse of PWA for phishing back in 2018.