π‘οΈ Deep Wire Inspection via Man-in-the-Middle (MITM) Interception
While browser DevTools excel at analyzing traffic within a single browser tab, enterprise systems frequently span native desktop apps, mobile operating systems (iOS and Android), background daemons, and microservice runners that bypass browser devtools. Web Debugging Proxies such as Fiddler Everywhere, Charles Proxy, and Mitmproxy operate as local intermediate HTTP/HTTPS forward proxies. By generating and installing dynamic root Certificate Authority (CA) certificates on client devices, these tools decrypt secure TLS sessions, enabling engineers to pause requests in flight, modify request parameters, mock server failure responses, simulate flaky network environments, and inspect raw API transactions across physical mobile hardware and desktop applications.
MAN-IN-THE-MIDDLE (MITM) SSL PROXY DECRYPTION LIFECYCLE:
ββββββββββββββββββββββββββ ββββββββββββββββββββββββββ
β CLIENT DEVICE β β REMOTE API SERVER β
β * Native Mobile App β β * api.nikita-infotech β
β * Automated Test Suiteβ β * Production Cluster β
β * Browser / Desktop β β * Payment Gateway β
ββββββββββββββββββββββββββ ββββββββββββββββββββββββββ
β β²
β 1. HTTP CONNECT tunnel request β
β Host: api.nikita-infotech.com:443 β
βΌ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β DEBUGGING PROXY (Charles / Fiddler running on localhost:8888 or :8866) β β
β β β
β [ Step A: Intercept CONNECT Request ] β β
β [ Step B: Connects to Remote Server via Standard TLS 1.3 Handshake ] ββββββββββββββββββ β
β - Validates Remote Server CA Certificate β
β β
β [ Step C: Dynamically Generates Fake Certificate for api.nikita-infotech.com ] β
β - Signed by Local Root Certificate Authority (e.g., Charles Proxy CA) β
β β
β [ Step D: Completes TLS Handshake with Client using Local CA ] ββββββββββββββββββββββββββ
β β
β [ Resulting Two-Way Plaintext Bridge ]: β
β Client ββ(TLS A: Trusted Local Root)βββΊ [ PROXY: READ / EDIT / MOCK ] ββ(TLS B)βββΊ Serverβ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
FIDDLER EVERYWHERE CONFIGURATION:
1. Open Settings -> Advanced Settings -> System Proxy -> Verify Listening Port: 8866.
2. Navigate to Settings -> HTTPS -> Check "Capture HTTPS traffic".
3. Check "Trust root certificate" -> Follow OS prompts to install the Fiddler CA certificate.
4. Verify "Ignore server certificate errors" remains UNCHECKED to preserve valid upstream checks.
5. In the capture panel, toggle [Live Traffic: Capturing] to actively route OS traffic.
CHARLES PROXY CONFIGURATION:
1. Open Proxy -> Proxy Settings -> Set HTTP Proxy Port: 8888 -> Check "Enable transparent HTTP proxying".
2. Open Proxy -> SSL Proxying Settings -> Check "Enable SSL Proxying".
3. Under Include list, click [Add]:
- Host: * (or specific domain: api.nikita-infotech.com)
- Port: 443 (or *)
4. Open Help -> SSL Proxying -> Click "Install Charles Root Certificate".
5. In Windows Certificate Manager (or macOS Keychain Access):
- Locate "Charles Proxy Custom Root Certificate"
- Move to "Trusted Root Certification Authorities"
- On macOS: Set Trust status to "Always Trust".
PREREQUISITE: Workstation and Mobile Device must be connected to the SAME Wi-Fi network.
Identify Workstation Local IP:
Windows : ipconfig -> e.g., 192.168.1.50
macOS : ifconfig -> e.g., 192.168.1.50
STEP 1: CONFIGURE MOBILE WI-FI PROXY
- Open Mobile Settings -> Wi-Fi -> Select active network -> Configure Proxy -> Manual
- Server / Hostname : 192.168.1.50
- Port : 8888 (Charles) or 8866 (Fiddler)
- Tap Save. A connection prompt will appear on Charles/Fiddler; tap [Allow].
STEP 2: INSTALL PROXY CA ON MOBILE DEVICE
- Open mobile browser (Safari / Chrome) and visit:
Charles : http://chls.pro/ssl
Fiddler : http://ipv4.fiddler:8866
- Download and install the displayed configuration profile.
STEP 3: TRUST ROOT CERTIFICATE
- iOS:
Settings -> General -> About -> Certificate Trust Settings
-> Under "Enable Full Trust For Root Certificates", toggle ON "Charles Proxy CA".
- Android (Android 7.0+ Network Security Config):
Settings -> Security -> Encryption & Credentials -> Install a Certificate -> CA Certificate.
*Note: Production Android apps restrict user CAs by default; debug builds require:
<network-security-config>
<debug-overrides>
<trust-anchors>
<certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>
SCENARIO: Manually testing how the client UI handles a simulated "VIP Account" state.
STEP 1: CONFIGURE BREAKPOINT RULE
- In Charles: Right-click endpoint /api/v1/user/profile -> Select [Breakpoints].
- Open Proxy -> Breakpoint Settings -> Double click rule -> Check [Response] only.
STEP 2: TRIGGER TRANSACTION
- In client application, navigate to User Profile screen.
- The request fires; the remote server replies; Charles pauses execution before rendering!
STEP 3: EDIT RESPONSE PAYLOAD IN MEMORY
Original Server Response:
{
"userId": "USR-1029",
"name": "Nikita Sharma",
"membershipTier": "FREE_TIER",
"walletBalance": 0.00
}
Modify directly inside the Breakpoint Editor:
{
"userId": "USR-1029",
"name": "Nikita Sharma",
"membershipTier": "ENTERPRISE_VIP",
"walletBalance": 99999.00
}
STEP 4: EXECUTE RESUME
- Click [Execute] button in Charles/Fiddler.
- The modified payload flows to the client application.
- Verify whether the UI unlocks premium features or if backend server validation blocks unauthorized actions.
MAPPING MODES:
1. MAP LOCAL:
Redirects remote endpoint calls to static files stored on your local disk.
Incoming Call: GET https://api.nikita-infotech.com/api/v1/courses/catalog
Mapped Target: C:\mock_data\empty_catalog_response.json
CHARLES SETUP:
- Tools -> Map Local... -> Check [Enable Map Local] -> Click [Add]
- Map From:
Protocol: https | Host: api.nikita-infotech.com | Path: /api/v1/courses/catalog
- Map To:
Local Path: /Users/qa/mocks/error_500_maintenance.json
Status Code: 503 Service Unavailable
2. MAP REMOTE:
Seamlessly forwards production traffic to staging or localhost development containers.
Incoming Call: https://api.nikita-infotech.com/api/v1/checkout
Mapped Target: http://localhost:8080/api/v1/checkout
FIDDLER AUTO-RESPONDER / RULES ENGINE:
- Rule Definition:
IF: EXACT:https://api.nikita-infotech.com/api/v1/pricing
THEN: 403_AccessDenied.dat (or raw JSON file)
USE CASE 1: INJECTING MISSING HEADERS FOR AUTHENTICATION
- Target: Host: api.nikita-infotech.com
- Rule Type: Add Header
- Name: X-Internal-Automation-Key
- Value: qa-bypass-token-2026
USE CASE 2: REWRITING RESPONSE STATUS CODES TO TEST RETRY LOGIC
- Rule Type: Response Status
- Match Status: 200 OK
- Replace With: 502 Bad Gateway
- Result: Forces client application to trigger exponential backoff retry algorithms!
USE CASE 3: REGEX STRING REPLACEMENT IN RESPONSE BODIES
- Rule Type: Body
- Match Pattern: "hasActiveSubscription": false
- Replace Value: "hasActiveSubscription": true
FIDDLER RULES SCRIPT (CustomRules.js snippet):
static function OnBeforeResponse(oSession: Session) {
if (oSession.PathAndQuery.Contains("/api/v1/payment/verify")) {
// Force simulation of transaction timeout
oSession.responseCode = 504;
oSession.utilSetResponseBody('{"error":"Gateway Timeout during bank settlement"}');
}
}
CHARLES THROTTLING ENGINE SETTINGS:
- Open Proxy -> Throttle Settings -> Check [Enable Throttling]
- Select "Only for selected hosts" -> Add api.nikita-infotech.com
NETWORK DEGRADATION PROFILES:
βββββββββββββββββββββββββββββ¬βββββββββββββββ¬βββββββββββββββ¬βββββββββββββββ¬βββββββββββββββββββββββββββββββ
β PROFILE β DOWNLOAD β UPLOAD β LATENCY (MS) β PACKET LOSS DROP RATE β
βββββββββββββββββββββββββββββΌβββββββββββββββΌβββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββ€
β 2G (GPRS Rural) β 56 kbps β 24 kbps β 850 ms β 2.0% Dropped Packets β
β 3G (Sub-optimal Cellular) β 768 kbps β 256 kbps β 320 ms β 0.5% Dropped Packets β
β Flaky Train Wi-Fi Profile β 1.5 Mbps β 512 kbps β 1500 ms β 5.0% Dropped Packets β
β DNS Latency Injection β - β - β +400 ms β 0% β
βββββββββββββββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄βββββββββββββββββββββββββββββββ
DIAGNOSTIC TEST SCENARIO:
1. Enable the "Flaky Train Wi-Fi" throttle preset.
2. Submit a high-volume POST payment transaction.
3. Verify whether the mobile app displays an idempotent spinner and handles socket timeout exceptions cleanly without double-submitting records.
# 1. Install mitmproxy via pip or package manager
pip install mitmproxy
# 2. Launch interactive curses interface on default port 8080
mitmproxy -p 8080
# 3. Launch headless mitmdump streaming raw traffic logs
mitmdump -p 8080 --view-filter "~m POST & ~u enrollments"
# 4. Automate response modification with an inline Python script:
# File: inject_failure_scenario.py
from mitmproxy import http
class FailureInjector:
def response(self, flow: http.HTTPFlow) -> None:
if "/api/v1/checkout" in flow.request.pretty_url:
flow.response.status_code = 503
flow.response.headers["Content-Type"] = "application/json"
flow.response.set_text('{"error": "Simulated Gateway Failure by Mitmproxy"}')
addons = [FailureInjector()]
# 5. Run mitmdump executing the Python script
mitmdump -p 8080 -s inject_failure_scenario.py
# 1. PYTHON REQUESTS UPSTREAM PROXY CONFIGURATION
import requests
PROXIES = {
"http": "http://127.0.0.1:8888",
"https": "http://127.0.0.1:8888"
}
# Provide Charles/Fiddler root CA cert path, or disable verification during test debugging
response = requests.get(
"https://api.nikita-infotech.com/api/v1/students/STU-102",
proxies=PROXIES,
verify=False # Required if local proxy CA is not installed in certifi bundle
)
print("Response Status:", response.status_code)
# 2. PLAYWRIGHT PYTHON TEST RUNNER THROUGH PROXY
# In test configuration or fixture:
browser = playwright.chromium.launch(
proxy={
"server": "http://127.0.0.1:8888",
"bypass": "localhost,127.0.0.1"
}
)
# 3. JAVA RESTASSURED UPSTREAM PROXY ROUTING
// RestAssured Configuration
RestAssured.proxy("127.0.0.1", 8888);
RestAssured.useRelaxedHTTPSValidation(); // Trusts proxy generated certificates
given().get("/api/v1/students/STU-102").then().statusCode(200);
PROXY TOOLING SELECTION & COMPARISON MATRIX:
βββββββββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββββββββ
β TOOL β PLATFORMS β PRIMARY STRENGTH β SCRIPTING ENGINE β BEST APPLIED SCENARIO β
βββββββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββββββββ€
β Charles Proxy β macOS, Windows, β Visual clarity, β Basic Rewrite, β Native iOS/Android β
β β Linux β Map Local, SSL β XML/JSON mapping β app traffic validation β
β Fiddler Everywhere β Windows, macOS, β Cross-platform, β FiddlerScript β Enterprise teams, team β
β β Linux β collaboration β Rules Engine β rule sharing & clouds β
β Mitmproxy β Linux, macOS, β Headless, CLI, β Full Python API β CI/CD pipelines, Dockerβ
β β Windows β low resource use β (mitmproxy.http) β automated fault inj. β
β Proxyman β macOS, Windows, β Native UI, fast β JavaScript β macOS native workflows,β
β β iOS β Apple Silicon β (Modern V8) β GraphQL & gRPC decode β
βββββββββββββββββββββββ΄βββββββββββββββββββ΄βββββββββββββββββββ΄βββββββββββββββββββ΄βββββββββββββββββββββββββ€
β TOP 5 PROXY DEBUGGING BEST PRACTICES: β
β 1. Set explicit include lists: Never decrypt *:* on corporate networks to avoid logging passwords. β
β 2. Close proxy apps cleanly: Forcibly killing Charles/Fiddler can leave OS proxy settings active, β
β causing internet connection drops until manually disabled. β
β 3. Maintain mock files under version control: Store Map Local JSON mocks alongside test suites. β
β 4. Bypass pinning in debug builds: Include network-security-config in Android debug builds for QA. β
β 5. Use upstream proxying for CI triage: Route headless runners through a proxy to capture traces. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ