Member-only story
Building A Pattern-based XSS Recon Tool
Even with excellent tools available, I often find myself enjoying the process of building my own (simplified) alternatives. There are several good reasons to consider creating your own tools:
- Knowledge: Exploring a subject, like XSS, learning how it works and detect it.
- Complete control: You know and control what a tool does by heart. This becomes very relevant when testing in a bug bounty program.
- Reduced dependency: With time, you can minimize or avoid using 3rd party packages.
- Good ol’ fun: I like building stuff.
When building tools for web testing, my language of choice is Python. Although I have a background in .NET, I love the syntax snd simplicity of the language.
In this article, I want to explore building a basic pattern-based XSS reconnaissance tool.
Just a quick heads-up, if you don’t like reading Python code, maybe skip this one!
Not a member? Read this article for free on my site.

Note that this article is written for educational purposes and is intended only for legal penetration testing and red teaming activities, where explicit permission has been granted. If you wish to test any of the scripts provided, please refer to the disclaimer at the end of this article.
First Things First — Cross-Site Scripting
For a quick refresher on XSS, lets just review Wikipedia:
Cross-site scripting (XSS) is a type of security vulnerability that can be found in some web applications. XSS attacks enable attackers to inject client-side scripts into web pages viewed by other users. A cross-site scripting vulnerability may be used by attackers to bypass access controls such as the same-origin policy.
Not So Passive, Not So Active
Just to be clear about the goal here, while this tool can’t be classified as passive, I want to avoid automated interaction with the target as much as possible. As stated before, when testing in a bug bounty program, I want to know and control my toolset. I want tools which give me information which I can act on myself, but avoid spraying payloads at the target.