#!/bin/bash
# Phase 2 — Web Application Testing
source "$(dirname "$0")/lib.sh"

phase_header "PHASE 2 — Web Application Testing"

section "Injection"
chk "sqlmap"            sqlmap
chk "ghauri"            ghauri
chk "tplmap"            tplmap

section "XSS"
chk "dalfox"            dalfox
chk "kxss"              kxss

section "SSRF / OOB"
chk "interactsh-client" interactsh-client

section "JWT"
chk "jwt_tool"          jwt_tool
chk_py "PyJWT"          jwt

section "GraphQL"
chk "graphql-cop"       graphql-cop
chk "graphw00f"         graphw00f
chk "InQL"              inql

section "XXE"
chk_dir "XXEinjector"   /opt/XXEinjector

section "HTTP Smuggling"
chk "smuggler"          smuggler

section "Parameter Discovery"
chk "arjun"             arjun
chk "x8"                x8

section "Request Tampering"
chk "mitmproxy"         mitmproxy

section "Web Crawling"
chk "katana"            katana
chk "hakrawler"         hakrawler
chk "linkfinder"        linkfinder

section "Source Code Analysis"
chk "semgrep"           semgrep
chk_py "jsbeautifier"   jsbeautifier

section "Web Frameworks"
chk "wpscan"            wpscan
# Caido — proprietary commercial tool, not open source, skipped

section "gRPC / WebSockets"
chk "grpcurl"           grpcurl

section "CORS"
chk_dir "CORScanner"    /opt/CORScanner

section "Protocol Tools"
chk "testssl"           testssl

section "Deserialization"
chk_file "ysoserial"    /opt/ysoserial/ysoserial.jar
chk "phpggc"            phpggc
chk_py "blackboxprotobuf" blackboxprotobuf

section "IaC / DevSecOps"
chk "checkov"           checkov
chk "syft"              syft
chk "grype"             grype

section "Secret Scanning"
chk "gitleaks"          gitleaks
chk "trufflehog"        trufflehog   # binary not Python module
chk "git-dumper"        git-dumper

phase_summary
