Ethical-hacking-tutorial / utils /code_analysis.py
quotexhlp's picture
Create utils/code_analysis.py
2db1727 verified
Raw History Blame Contribute Delete
438 Bytes
def analyze_code(code):
findings = []
if "eval(" in code:
findings.append("⚠️ Usage of eval() – can lead to code injection.")
if "exec(" in code:
findings.append("⚠️ Usage of exec() – dangerous if input is not sanitized.")
if "password" in code:
findings.append("🔑 Found possible hardcoded password or credentials.")
return "\n".join(findings) or "✅ No critical issues found."