{"id":17925205,"url":"https://github.com/swisskyrepo/vulny-code-static-analysis","last_synced_at":"2025-05-15T19:04:38.839Z","repository":{"id":65982353,"uuid":"91270982","full_name":"swisskyrepo/Vulny-Code-Static-Analysis","owner":"swisskyrepo","description":"Python script to detect vulnerabilities inside PHP source code using static analysis, based on regex","archived":false,"fork":false,"pushed_at":"2025-02-27T16:11:07.000Z","size":126,"stargazers_count":404,"open_issues_count":0,"forks_count":139,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-05-15T19:04:01.120Z","etag":null,"topics":["audit","detect-vulnerabilities","hacktoberfest","php","php-source","security-scanner","security-tools","static-analysis","statical-analysis","vulnerabilities"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swisskyrepo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"swisskyrepo","ko_fi":"swissky","custom":"https://www.buymeacoffee.com/swissky"}},"created_at":"2017-05-14T20:56:38.000Z","updated_at":"2025-04-20T12:58:20.000Z","dependencies_parsed_at":"2025-04-11T22:33:48.540Z","dependency_job_id":"df1ff314-7553-4eed-9258-8b022c34d3f3","html_url":"https://github.com/swisskyrepo/Vulny-Code-Static-Analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swisskyrepo%2FVulny-Code-Static-Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swisskyrepo%2FVulny-Code-Static-Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swisskyrepo%2FVulny-Code-Static-Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swisskyrepo%2FVulny-Code-Static-Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swisskyrepo","download_url":"https://codeload.github.com/swisskyrepo/Vulny-Code-Static-Analysis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254404357,"owners_count":22065641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audit","detect-vulnerabilities","hacktoberfest","php","php-source","security-scanner","security-tools","static-analysis","statical-analysis","vulnerabilities"],"created_at":"2024-10-28T20:53:04.616Z","updated_at":"2025-05-15T19:04:38.790Z","avatar_url":"https://github.com/swisskyrepo.png","language":"PHP","funding_links":["https://github.com/sponsors/swisskyrepo","https://ko-fi.com/swissky","https://www.buymeacoffee.com/swissky"],"categories":[],"sub_categories":[],"readme":"# VulnyCode - PHP Code Static Analysis [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=VulnyCode%20-%20PHP%20Code%20Static%20Analysis\u0026url=https://github.com/swisskyrepo/Vulny-Code-Static-Analysis) - Deprecated\n\n![1.0.0](https://img.shields.io/badge/Version-1.0.0%20Beta-RED) ![Python](https://img.shields.io/badge/Python-3.4+-GREEN) ![Platform](https://img.shields.io/badge/Platforms-Linux%20x64-yellowgreen) \n\n\n:warning: **Deprecated**, you should use semgrep rules instead of this script: `semgrep --config=./semgrep/ vulns/*.php`\nMost of the semgrep rules provided in this repository are from https://github.com/returntocorp/semgrep-rules\n\n\nBasic script to detect vulnerabilities into a PHP source code, it is using Regular Expression to find sinkholes.\n\n```bash\n# HELP\n╭─ 👻 swissky@crashlab: ~/Github/PHP_Code_Static_Analysis  ‹master*›\n╰─$ python3 index.py           \nusage: index.py [-h] [--dir DIR] [--plain]\n\noptional arguments:\n  -h, --help  show this help message and exit\n  --dir DIR   Directory to analyse\n  --plain     No color in output\n\n# Example\n╭─ 👻 swissky@crashlab: ~/Github/PHP_Code_Static_Analysis  ‹master*›\n╰─$ python3 index.py --dir vulns    \n------------------------------------------------------------\nAnalyzing 'vulns' source code\n------------------------------------------------------------\nPotential vulnerability found : File Inclusion\nLine 19 in vulns/include.php\nCode : include($_GET['patisserie'])\n------------------------------------------------------------\nPotential vulnerability found : Insecure E-mail\nLine 2 in vulns/mail.php\nCode : mail($dest, \"subject\", \"message\", \"\", \"-f\" . $_GET['from'])\nDeclared at line 1 : $dest = $_GET['who'];\n```\n\nCurrently detecting :\n- Arbitrary Cookie\n- Arbitrary File Deletion\n- Arbitrary Variable Overwrite\n- Cross Site Scripting\n- File Inclusion\n- File Inclusion / Path Traversal\n- File Upload\n- Header Injection\n- Information Leak\n- Insecure E-mail\n- Insecure Weak Random\n- LDAP Injection\n- PHP Object Injection\n- Remote Code Execution\n- Remote Command Execution\n- Server Side Request Forgery\n- Server Side Template Injection\n- SQL Injection\n- URL Redirection\n- Weak Cryptographic Hash\n- XML external entity\n- XPATH Injection\n- Hardcoded credentials\n- High Entropy string\n\n\u003e if you want to export each vulnerabilities type into a folder use the \"export.sh\"\n\nDon't forget to read the [license](/LICENSE) ;)\n\n\n## Alternatives\n\n* [RIPS - A static source code analyser for vulnerabilities in PHP scripts](https://blog.ripstech.com/2016/introducing-the-rips-analysis-engine/)\n* [Cobra - Source Code Security Audit](https://github.com/WhaleShark-Team/cobra)\n* [PHP parser written in Python using PLY](https://github.com/viraptor/phply)\n* [Psalm - A static analysis tool for finding errors in PHP applications](https://psalm.dev/docs/security_analysis/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswisskyrepo%2Fvulny-code-static-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswisskyrepo%2Fvulny-code-static-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswisskyrepo%2Fvulny-code-static-analysis/lists"}