@echo off REM Comprehensive traffic capture and analysis script REM This script starts mitmproxy, runs the app with Frida, and captures traffic echo. echo ==================================================== echo CANADA POST - TRAFFIC CAPTURE & ANALYSIS echo ==================================================== echo. cd /d "%~dp0" REM Check if mitmproxy is running echo [*] Checking mitmproxy setup... netstat -ano | find ":8080" >nul 2>&1 if errorlevel 1 ( echo [!] mitmproxy is not running on port 8080 echo [*] Starting mitmproxy... start cmd /k "title mitmproxy & mitmproxy -p 8080 -w canadapost_traffic.mitm" timeout /t 3 ) else ( echo [✓] mitmproxy already running on port 8080 ) echo. echo [*] Starting Canada Post app with Frida bypass... echo [*] App will connect to mitmproxy for traffic capture echo. echo IMPORTANT: Perform these actions in the app: echo 1. Wait for login screen to appear echo 2. Log in with test credentials (if available) echo 3. Navigate to tracking echo 4. Enter a package number (valid format) echo 5. Watch for API calls in mitmproxy echo. echo [*] Monitoring for credentials... echo. REM Start the app with combined scripts (SSL bypass + credential capture) frida -U -f com.canadapost.android -l frida_simple_bypass.js -l extract_live_credentials.js echo. echo [*] App session ended echo. echo ==================================================== echo ANALYZING CAPTURED TRAFFIC echo ==================================================== echo. if exist "canadapost_traffic.mitm" ( echo [✓] Found traffic file: canadapost_traffic.mitm echo [*] Extracting credentials... python extract_creds.py canadapost_traffic.mitm ) else ( echo [!] No traffic file found echo [*] Make sure mitmproxy was running during app session ) echo. echo ==================================================== echo NEXT STEPS echo ==================================================== echo. echo 1. Review extracted credentials above echo 2. Copy any Bearer tokens found echo 3. Test APIs with token: echo python test_apis.py --track 1234567890 --token "your_token" echo 4. View full traffic in mitmproxy: echo mitmproxy -r canadapost_traffic.mitm echo. echo ==================================================== echo. pause