3.5 KiB
3.5 KiB
# 🌐 Mitmproxy Usage Guide
* (By Kitano Sakura)*
* (By Kitano Sakura)*
🛠️ Prerequisites
- Download and install Mitmproxy.
- Basic knowledge of WireGuard and Python scripting.
- Required devices:
- A host machine to run Mitmproxy.
- A client device (e.g., Android emulator or smartphone).
📥 Step 1: Install Mitmproxy
📂 Installation
Linux / macOS
# Ubuntu/Debian
sudo apt update
sudo apt install mitmproxy
# macOS
brew install mitmproxy
Windows
Download the .exe
installer from mitmproxy.org and follow the setup instructions.
✅ Verify Installation
Run the following command to confirm successful installation:
mitmproxy --version
🔑 Step 2: Install the CA Certificate
📜 Steps
- Start
mitmproxy
to generate the CA certificate:mitmdump
- Locate the generated certificate:
- Certificate path:
C:\Users\<Username>\.mitmproxy\mitmproxy-ca-cert.crt
(Windows)~/.mitmproxy/
(Linux / macOS)
- Certificate path:
- Rename
mitmproxy-ca-cert.crt
toc8750f0d.0
. - Move the certificate to the system CA directory and set permissions:
adb root adb remount adb shell mv /sdcard/c8750f0d.0 /system/etc/security/cacerts/ adb shell chmod 644 /system/etc/security/cacerts/c8750f0d.0 adb reboot
🔧 Step 3: Configure the Redirect Script
Download redirect_server.py
from the repository and modify the SERVER_HOST
field:
import gzip
import json
from mitmproxy import http
SERVER_HOST = 'Update here' # Replace with your server IP
SERVER_PORT = 80
REWRITE_HOST_LIST = [
'ba-jp-sdk.bluearchive.jp',
'prod-gateway.bluearchiveyostar.com',
'prod-game.bluearchiveyostar.com',
]
🚀 Step 4: Start Mitmproxy
Run the following command to launch Mitmproxy with the redirect script:
mitmweb -m wireguard --no-http2 -s redirect_server.py --set termlog_verbosity=warn --ignore <your IP address>
📝 Parameter Explanation:
-m wireguard
: Use WireGuard as the network layer.--no-http2
: Disable HTTP/2 for better compatibility.-s redirect_server.py
: Load the redirect script.--set termlog_verbosity=warn
: Show warnings only in logs.
Access the Mitmproxy web interface at http://localhost:8081
to monitor traffic.
🔄 Step 5: Install WireGuard
📥 Installation
- Android: Download from Google Play.
- Other Platforms: Refer to the official WireGuard installation guide.
⚙️ Configuration
- Open the WireGuard client and scan the QR code provided by Mitmproxy.
- Apply the configuration to route all traffic through Mitmproxy.
🛠️ Troubleshooting
❌ Error: Client TLS handshake failed
- Ensure the same CA certificate is installed on both the host and client devices.
- Verify that the CA certificate is installed as a system certificate.
❌ Certificate disappears on Android
- Use MT Manager to grant SU permissions.
- Manually navigate to
/system/etc/security/cacerts/
and reset permissions to644
.
🎉 Done!