A command-line Python utility for scanning source code directories and identifying potentially vulnerable function calls. The script checks for a wide range of security pitfalls, such as SQL Injection and Path Traversal, across multiple languages (Python, Java, C#, PHP, Node.js). It helps developers and testers rapidly isolate and inspect high-risk code segments.
-
Multi-Language Support
Automatically parses source code for five popular programming languages:- Python
- Java
- C#
- PHP
- Node.js
-
Vulnerability Detection
Flags common security risks, including:- SQL Injection
- Path Traversal
- Server-Side Request Forgery (SSRF)
- Command Injection
- Insecure Deserialization
- XML External Entity (XXE)
- Server-Side Template Injection (SSTI)
- Open Redirect
-
Interactive CLI
Guides you through each step to choose a language, select specific vulnerabilities, inspect files, and jump directly to flagged code lines in Visual Studio Code. -
Rich Console Output
Uses Rich for enhanced terminal visuals—making file trees, vulnerabilities, and menu options easier to navigate. -
IDE Integration
Integrates with Visual Studio Code via command-line calls, so you can open entire projects or specific lines of flagged code instantly.
- Python 3.7+
- Rich
- Colorama
Install Rich and Colorama manually:
pip install rich coloramaAfter that, simply clone the repository (or place the script in a directory of your choice) and run it.
-
Basic Command
python whitehouse_scanner.py <directory>
<directory>: The root folder you want to scan for vulnerable code.
-
Language Menu
You’ll see a list of available programming languages. Enter the corresponding number to pick one, or0to exit. -
Vulnerability Menu
After choosing a language, select a specific vulnerability you want to scan for (e.g., SQL Injection, Path Traversal). Enter its number or0to go back. -
File Inspection
Once the script identifies files that contain suspicious function calls, you can:- Enter the file’s number to inspect occurrences in detail.
- Press
0to move back to the vulnerabilities menu.
-
Occurrences & Visual Studio Code
For each flagged file, the script displays:- Line number
- Code snippet
You can choose a specific occurrence by number to see more context or select
vto open the file at the highlighted line in Visual Studio Code.
- Scan Your
srcFolder for Vulnerabilitiespython whitehouse_scanner.py src
- Pick
1for Python (or whichever language your code is in). - Pick
1for SQL Injection (or any other vulnerability). - Review Flagged Files in the console.
- Select the File and a specific line occurrence to see surrounding code.
- Press
vto open the suspicious line in VSCode.
whitehouse-scanner/
│
├─ utils.py
├─ vulnerable_functions.py
├─ whitehouse_scanner.py # Main script
└─ README.md # You are here!
-
Language-Specific Variations
While the script covers general function calls (e.g.,exec()in Python), more advanced or framework-specific vulnerability patterns may not be included. -
False Positives
The tool flags suspicious function usage but cannot guarantee that user input truly flows into those functions unsanitized. -
Limited Code Parsing
Dynamic code constructs or custom templating engines might be missed, especially if they rely on advanced meta-programming.
- Fork this repo and create a new feature branch.
- Enhance detection logic in
vulnerable_functions.pyor improve CLI flows in the main script. - Submit a Pull Request describing your changes in detail.
This project is licensed under the MIT License. Feel free to use, modify, and distribute this tool under the terms specified.
For questions, issues, or suggestions, please open an Issue or reach out to the project maintainer:
- Author: Malachias Theodoros
- GitHub: github.com/teorepo
Disclaimer: This tool is intended for educational and testing purposes only. Always ensure you have explicit permission before scanning a system’s source code. The maintainers assume no responsibility for misuse.