Skip to content
-
Learn Cybersecurity & Ethical Hacking in Nepal with CyberSamir — Start Learning →
Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
Close

Search

Subscribe
  • Facebook
  • Telegram
  • Instagram
  • Youtube
  • Linkedin
  • Whasapp
Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
Close

Search

Subscribe
  • Facebook
  • Telegram
  • Instagram
  • Youtube
  • Linkedin
  • Whasapp
Ethical HackingPenetration testing

How to Find XSS Vulnerabilities

By cybersamir
May 2, 2025 3 Min Read
Comments Off on How to Find XSS Vulnerabilities

How to Find XSS Vulnerabilities: The Ultimate Guide

⚠️ Ethical Disclaimer: This guide is for educational purposes only. Always obtain written permission before testing any system you do not own. Unauthorized testing is illegal.

Cross-Site Scripting (XSS) remains a critical vulnerability in the OWASP Top 10. It allows attackers to inject malicious scripts into web pages viewed by other users, leading to session hijacking, defacement, or redirection to malicious sites.

Understanding the Three Main Flavors

Before hunting, you must understand what you are looking for. XSS manifests in three primary forms:

Type Mechanism Persistence Typical Target
Reflected XSS Payload is part of the request (URL parameters) Non-persistent Search bars, error messages
Stored XSS Payload is saved in the database Persistent Comments, profiles, forums
DOM-Based XSS Payload executes via client-side JavaScript Context-dependent Fragments (#), JS variables

Phase 1: Reconnaissance & Discovery

You cannot hack what you cannot find. Start by mapping out every user input field in the application.

The Injection Checklist

  • URL Parameters (e.g., ?q=test, ?id=1)
  • URL Paths (e.g., /user/test/)
  • HTTP Headers (User-Agent, Referer, X-Forwarded-For)
  • Form Inputs (Search, Login, Contact, Registration)
  • Hidden Form Fields
  • File Upload Names

Phase 2: The Art of the Payload

Once you find an input, you need to test if it reflects your input back to the page un-sanitized.

1. The “Canary” Test

Before injecting scripts, inject a unique alphanumeric string (a “canary”) to see where it appears in the source code.

Canary Payload Recon
xyz123"<'>test

Search the source code for xyz123. If the < and > are not encoded (i.e., they don’t turn into &lt;), you likely have XSS.

2. Polyglot Payloads

Polyglots are strings designed to break out of multiple contexts (HTML attributes, script tags, etc.) simultaneously.

Ultimate Polyglot High Impact
jaVasCript:/*-/*`/*\`/*'/*"/**/(/* */oNcliCk=alert() )//%0D%0A%0d%0a//</stYle/</titLe/</teXtarEa/</scRipt/--!>\x3csVg/<sVg/oNloAd=alert()//>\x3e

3. Context-Specific Payloads

Where did your canary land? Use a specific payload for that context.

Inside HTML Tags

<script>alert(1)</script>
<svg/onload=alert(1)>
<img src=x onerror=alert(1)>

Inside Attributes

" onmouseover=alert(1) "
' onfocus=alert(1) autofocus '
"><script>alert(1)</script>

Inside JavaScript Variables

'; alert(1); //
"-alert(1)-"

Phase 3: Bypassing Filters (WAF Evasion)

Modern applications often use Web Application Firewalls (WAF) to block <script> tags. Use these techniques to bypass them.

Tip: Filters often look for specific keywords. Try breaking them up or using alternative tags.

Case Manipulation

<ScRiPt>alert(1)</sCrIpT>

Tag Injection (No Script Tags)

<body onpageshow=alert(1)>
<style/onload=alert(1)>
<iframe/onload=alert(1)>

Encoding

Browsers decode HTML entities before execution. This can hide your payload from the WAF.

&#60;img src=x onerror=alert(1)&#62;

Phase 4: Automated Tools

While manual testing is best for logic errors, tools help scale your efforts.

Tool Type Best For
Burp Suite Proxy/Scanner Manual interception and automated scanning (Pro)
Dalfox CLI Scanner Fast, parameter analysis and WAF evasion
XSStrike Fuzzer Context analysis and payload generation
XSS Hunter Blind XSS Finding XSS that executes on admin panels (Blind)

How to Write a Good Report

Finding the bug is half the battle. Reporting it effectively ensures it gets fixed (and you get paid).

  1. Title: Clear and concise (e.g., “Reflected XSS on Search Parameter”).
  2. Description: Brief overview of the vulnerability.
  3. Impact: What can an attacker do? (Steal cookies, phishing).
  4. Steps to Reproduce:
    • Go to URL…
    • Enter payload…
    • Observe alert box…
  5. Proof of Concept (PoC): Provide the full malicious URL or screenshot.

Remediation & Prevention

If you are a developer, here is how to stop XSS:

  • Output Encoding: Convert special characters into HTML entities (e.g., < becomes &lt;) before rendering data.
  • Input Sanitization: Remove dangerous tags using libraries like DOMPurify.
  • Content Security Policy (CSP): A browser header that restricts where scripts can load from.
  • HttpOnly Cookies: Prevents JavaScript from reading session cookies.
Practice Safely: Never test on live sites without permission. Use legal practice grounds like PortSwigger Web Security Academy or OWASP Juice Shop.
Author

cybersamir

Follow Me
Other Articles
Previous

Change Your IP Address Every Minute on Parrot OS

Next

5G vs. 4G: What’s the Difference and Why Does It Matter?

Your ad here

300 x 250 banner slot

Reach Nepali students, developers, and security learners reading about ethical hacking, CTFs, and cyber news.

Book on WhatsApp Or send an email

Sponsors: VPNs, courses, hosting, security tools

Recent Posts

  • How to Recover Money from Online Scam Nepal: 2026 Guide
  • How to Check If Your Data Was Leaked (Nepal 2026 Guide)
  • Is PHP Dead? A 2026 Reckoning
  • Nepal Cyber Shield CTF: Top 10 Teams Qualified for the Grand Finale
  • How to Report Cybercrime in Nepal: Step-by-Step Guide (2026)

Nepal Cyber Shield 2026

Been scammed or hacked?

Act fast: save screenshots, don't delete chats, and report it.

  • 100 Nepal Police emergency line
  • +9779851286770 Nepal Police Cyber Bureau
Report here (Nepal Police) Read the step-by-step reporting guide

Money lost? Call your bank first so they can try to freeze the transfer.

Categories

  • Awareness
  • Blog
  • Career & Learning
  • Cybersecurity
  • Ethical Hacking
  • Nepal Tech & Digital Safety
  • News
  • Penetration testing
  • Tools & Reviews

Latest security alerts

  • pCloud Password Manager Hit by Cyber Attack Involving Email Address Exposure and Login Attempts
  • Suspected Vietnam-Linked Hackers Target Southeast Asia in South China Sea Espionage Campaign
  • Microsoft Store App Found Delivering Vinci RAT Capable of Remote System Control
  • How to Keep Your Security Picture Current When Attackers Move at AI Speed
  • Hackers Trojanize Official Q-Dir and DesktopOK Downloads to Deliver Remote Access Malware
  • PHP Vulnerability And Global Cybersecurity - The Rising Nepal
  • Nepal's digital vulnerability goes beyond PHP - myRepublica
  • SEBON introduces IT policy to strengthen cybersecurity in Nepal’s capital market - OnlineKhabar English News
  • From heartbleed to PHP2Shell: Is Nepal ready for the next cyber crisis? - The Annapurna Express
  • SEBON steps up effort to prevent cyber attacks in stock exchange platform - myRepublica

You May Have Missed

how to recover money from online scam Nepal
Awareness

How to Recover Money from Online Scam Nepal: 2026 Guide

cybersamir
By cybersamir
November 28, 2026
data leak check nepal
Awareness

How to Check If Your Data Was Leaked (Nepal 2026 Guide)

cybersamir
By cybersamir
November 26, 2026
Cinematic PHP programming thumbnail with the headline “Is PHP Dead? 2026 Reckoning,” a glowing blue PHP elephant, and CyberSamir branding.
Awareness

Is PHP Dead? A 2026 Reckoning

cybersamir
By cybersamir
October 25, 2026
ctf top 10 selected teams
News

Nepal Cyber Shield CTF: Top 10 Teams Qualified for the Grand Finale

cybersamir
By cybersamir
October 4, 2026
How to report cybercrime in Nepal Cyber Bureau complaint guide
Awareness

How to Report Cybercrime in Nepal: Step-by-Step Guide (2026)

cybersamir
By cybersamir
September 27, 2026
Nepal Data Breach: 462,600 Citizens' IDs Allegedly Leaked," subtext "Dark web forum post claims mass PII theft from a .gov.np portal
News

Nepal Government Portal Allegedly Breached: 462,600 Citizens’ Data Reportedly Listed for Sale on Dark Web

cybersamir
By cybersamir
September 24, 2026
Cybersecurity

Top 10 Security Mistakes Nepali Websites Still Make in 2026

cybersamir
By cybersamir
September 23, 2026
News Cybersecurity

Nepal Data Hub Ransomware Attack: NEPSE Shutdown Explained

cybersamir
By cybersamir
September 23, 2026
News

Nepal Cyber Shield 2026: Everything You Need to Know About Nepal’s National CTF Championship

cybersamir
By cybersamir
September 19, 2026
CS

CYBERSAMIR

Explore. Hack. Secure. Learn.

About Us

CyberSamir provides cutting-edge insights into ethical hacking, penetration testing, and cybersecurity defense strategies for professionals and enthusiasts alike.

500+ Articles
15K+ Members
30+ Tools

Resources

  • Tutorials
  • Our Services
  • Tools
  • CTF Walkthroughs
  • Security News

Community

  • WhatsApp Group
  • Discord Server
  • Telegram Group
  • Upcoming Events
  • Certifications

Follow Us

Cyber Security Events Worldwide

© CyberSamir. All Rights Reserved.

Copyright 2026 — Cyber Samir. All rights reserved. Blogsy WordPress Theme