How I found XSS by searching in shodan
A search field on an undeveloped WordPress page reflected user input back into the page without encoding, so a script payload executed in the browser. An attacker could use this to run JavaScript in a victim's session and potentially steal cookies or session tokens.
Published on blog.usejournal.com
Anyways I was pentesting for a private program, I started with information gathering and meanwhile started dirbuster in the backend. I started with google and shodan.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the search parameter was echoed into the HTML response without output encoding or input validation.
Impact
The reflected script could be used to steal session tokens and cookies, and because the page sat on the same server as the parent site, that exposure could extend to the main application.
What the attacker needed
Victim clicks a crafted link; target page reachable on the same server
The fix
The report recommends a defence-in-depth approach of whitelist input validation plus output encoding of user-controlled parameters; it does not say the issue was fixed.
How it was found
- Search for the company domain in Shodan and open the result showing an undeveloped WordPress page with a search bar.
- Visit the page's search URL with a test value in the search parameter.
- Enter a script payload in the search bar and see the alert pop up.
- Change the request method from POST to GET and the payload still executed.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A reflected cross-site scripting (XSS) bug means a website takes something you type, such as a search term, and puts it straight back into the page without cleaning it. If the text contains code instead of plain words, the browser runs that code as if the site itself had written it. Here the search box did exactly that, so a crafted link could make a visitor's browser run the attacker's script.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.