Repository: mhaskar/RCEScanner
Branch: master
Commit: ce5c9ecbbccb
Files: 3
Total size: 3.2 KB
Directory structure:
gitextract_ltbkicvj/
├── .gitignore
├── RCEScanner.py
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv
venv/
ENV/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
================================================
FILE: RCEScanner.py
================================================
#!/usr/bin/python
'''
author : Mohammad Askar | @mohammadaskar2
Description : This script will help you to find unsafe functions on any
php script and give you information about it
Requiremnets : termcolor, tabulate
'''
import os
import sys
import time
import re
from termcolor import cprint
from tabulate import tabulate
if len(sys.argv) != 3:
cprint("[+] Usage : ./{0} path extension".format(sys.argv[0]), "red")
cprint("[+] Example : ./{0} /var/www/plugin php".format(sys.argv[0]), "red")
sys.exit(0)
path = sys.argv[1]
extension = sys.argv[2]
final_files = []
reg = '''\((.*)\);'''
unsafe = ["system", "shell_exec", "exec", "passthru", "eval"]
def spider(script_path):
if os.path.exists(path) is False:
cprint("[-]Directory not exist", "red")
sys.exit(0)
cprint("[+] Scanning started for the script ..", "green")
for root, dirs, files in os.walk(script_path, topdown=False):
for fi in files:
dfile = os.path.join(root, fi)
if dfile.endswith(".php"):
final_files.append(dfile)
cprint("[+] {0} php files found".format(len(final_files)), "green")
def scanner(files_list):
results = []
for fi in files_list:
f = open(fi, "r")
data = f.readlines()
for line in data:
linen = data.index(line) + 1
for unsafe_function in unsafe:
line_no = line.strip("\n")
final_reg = unsafe_function + reg
if bool(re.search(final_reg, line_no)):
file_result = [fi, unsafe_function, linen]
results.append(file_result)
print tabulate(results,
headers=['File Name', 'Function Name', "Line Number"],
tablefmt='psql', numalign="center", stralign="center")
spider(path)
scanner(final_files)
================================================
FILE: README.md
================================================
# RCEScanner
This script will help you to perform a quick source code review for php web applications
and try to extract any unsafe functions on the project and print them out to you
## Usage :
python RCEScanner.py path/to/project extension
* current supported extensions is php
gitextract_ltbkicvj/ ├── .gitignore ├── RCEScanner.py └── README.md
SYMBOL INDEX (2 symbols across 1 files) FILE: RCEScanner.py function spider (line 31) | def spider(script_path): function scanner (line 44) | def scanner(files_list):
Condensed preview — 3 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4K chars).
[
{
"path": ".gitignore",
"chars": 1157,
"preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packagi"
},
{
"path": "RCEScanner.py",
"chars": 1844,
"preview": "#!/usr/bin/python\n\n'''\nauthor : Mohammad Askar | @mohammadaskar2\n\nDescription : This script will help you to find unsafe"
},
{
"path": "README.md",
"chars": 284,
"preview": "# RCEScanner\n\nThis script will help you to perform a quick source code review for php web applications\nand try to extrac"
}
]
About this extraction
This page contains the full source code of the mhaskar/RCEScanner GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 3 files (3.2 KB), approximately 941 tokens, and a symbol index with 2 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.