31 Aug 2023
Phishing mails based on XSS
Hey there, pals! :D Welcome back to my blog. In today's post, I'll be diving into a high-impact XSS technique that'll really open your eyes to just how far the rabbit hole goes with XSS. Let's jump right in! ๐
Sure thing, folks! ( อ โโฏอส อกโ) Just to clarify, we're not here to exchange XSS payloads. We've got something even more intriguing to explore together! Let's keep the excitement going! ๐ต๏ธโโ๏ธ๐
Ever stopped to think that phishing emails aren't just about fake web apps? What if I told you that you could fall for a phishing attack through a legitimate website that's vulnerable to XSS? Intriguing, right? Let's delve into this fascinating twist! ๐ฃ๐
But hold on, isn't it all about triggering an alert(1)
pop-up? Well, let me introduce you to something called FAKE LOGIN FORM INJECTION. This takes things to a whole new level! ๐ถ๏ธ๐
FORM INJECTION:
Absolutely wild, isn't it? ( อ โโฏแด อกโ) So, once we've got a working XSS payload in our arsenal, the next step is to launch the phishing attack. Imagine we inject a snippet of HTML code into the vulnerable page. This sneaky code then presents a seemingly harmless login form to the user. But here's the kicker: all the login details they enter get sent to a server that we're carefully listening on. Talk about a crafty way to grab those credentials, huh? It's a real eye-opener!๐๏ธ ๐๏ธ
Well, well, well! Hold onto your hats because this part is fascinating. Believe it or not, all these modifications can be accomplished using just a simple <script>XSS PAYLOAD</script>
.
It may jump in your minds that we are talking about stored XSS but, no! Actually its reflected! What does that mean? It means the web page gets infected solely through URL modification. There's no storing involved in this game! ๐ฉ๐ฎ
Now, let's shine a spotlight on our magical key player here: the JavaScript function document.write()
. You might have heard of it before, but have you ever thought about harnessing its power from an XSS perspective to pull off such an attack? Well, buckle up, because we're diving right into it! (๐ อ โโฏอส อกโ)๐
Alright, let's break down a typical HTML login form example:
document.write()
function to inject our crafty XSS attack! You're catching on quickly! ๐ Just like you'd normally inject an XSS payload, you can do the same with this crafty login form injection. Instead of the usual <script>alert(1)</script>
.
<!--
to filter out any remnants of the original HTML code after injecting the login form is a smart move. It ensures that there's no trace left behind to arouse suspicion. index.php
script in a directory, firing up the PHP server with php -S 0.0.0.0:80
, and then reaping the rewards by reading the creds.txt
file โ you've just brought your crafted magic trick to life. That captured username and password combo is like the final piece of a puzzle. cat creds.txt
Username: Jake_Richards | Password: J@kKkeEe2023!