Skip to content

Commit dc21a46

Browse files
committed
Merge testing: revert server-side MITM patching, slim Docker image
2 parents 8f812e4 + cf4a06b commit dc21a46

8 files changed

Lines changed: 3 additions & 513 deletions

File tree

Dockerfile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
6464
git curl ca-certificates tini jq dnsutils libpcap0.8 \
6565
postgresql-client docker.io \
6666
python3 sqlmap nmap \
67-
default-jre-headless unzip zip \
67+
unzip zip \
6868
&& rm -rf /var/lib/apt/lists/*
6969

70-
# Install Apktool and Uber-APK-Signer for MITM patching
71-
RUN curl -L https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool -o /usr/local/bin/apktool && \
72-
chmod +x /usr/local/bin/apktool && \
73-
curl -L https://github.com/iBotPeaches/Apktool/releases/download/v2.10.0/apktool_2.10.0.jar -o /usr/local/bin/apktool.jar && \
74-
curl -L https://github.com/patrickfav/uber-apk-signer/releases/download/v1.3.0/uber-apk-signer-1.3.0.jar -o /usr/local/bin/uber-apk-signer.jar && \
75-
curl -L https://github.com/EFForg/apkeep/releases/download/0.18.0/apkeep-x86_64-unknown-linux-gnu -o /usr/local/bin/apkeep && \
76-
chmod +x /usr/local/bin/apkeep
77-
7870
# Copy minimal application configuration and assets (source not required at runtime)
7971
COPY regexes/ ./regexes/
8072
COPY templates/ ./templates/

README.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Results are automatically uploaded to **Cloudflare R2 storage** and linked direc
3434
| **JavaScript** | Extract secrets, API endpoints, auth tokens from JS files |
3535
| **GitHub Recon** | Org-level and repo-level scanning for secrets, dependency confusion |
3636
| **APK Auditor** | Browser-based Android analysis: DEX decompiler, manifest + cert parsing, tracker detection, MASVS mapping, and regex-driven findings with APX secret patterns. (Based on [apkauditor](https://github.com/thecybersandeep/apkauditor) by @thecybersandeep) |
37-
| **MITM Patch** | One-click **Patch for MITM** in the APK Auditor → server runs `apktool` + `uber-apk-signer` to trust user CAs, disable cert pinning, and re-sign → direct download of the patched APK |
3837
| **IPA Auditor** | Browser-based iOS IPA analysis: plist + Mach-O inspection, binary strings extraction, and findings tab powered by 200+ regex signatures plus MASVS-style rules. (Based on [ipaauditor](https://github.com/thecybersandeep/ipaauditor) by @thecybersandeep) |
3938
| **ADB Auditor** | Browser-based ADB security tool: USB device inspection, app enumeration, logcat tailing, file pull, activity launching. (Based on [adbauditor](https://github.com/thecybersandeep/adbauditor) by @thecybersandeep) |
4039
| **Misconfigs** | 100+ service misconfiguration checks |
@@ -43,7 +42,7 @@ Results are automatically uploaded to **Cloudflare R2 storage** and linked direc
4342
| **AI Agent** | Full AI hunt loop from the CLI (`autoar agent` / `autoar explain`) — defaults to **deepseek-v4-flash-free via OpenCode Zen** — free tier, no card required |
4443
| **R2 Storage** | Auto-upload every non-empty result file to Cloudflare R2 and print the public URL |
4544
| **Smart Alerts** | Rich webhook notifications for zero-findings scans — no more empty files or spam |
46-
| **Web dashboard** | **v4.1+** — Stats, scans, domains, monitors, R2 browser, Targets, APK/IPA/ADB Auditors, MITM remote scan, CF-1016 findings. Unified findings table with per-module columns, inline expandable detail panels, severity/chip/multi-field filters |
45+
| **Web dashboard** | **v4.1+** — Stats, scans, domains, monitors, R2 browser, Targets, APK/IPA/ADB Auditors, CF-1016 findings. Unified findings table with per-module columns, inline expandable detail panels, severity/chip/multi-field filters |
4746

4847

4948
---
@@ -215,19 +214,7 @@ The **APK Auditor** is a fully browser-based static analysis tool available at `
215214
- Regex presets and bulk pattern scans for secrets/tokens across code and resources
216215
- OWASP MASVS aligned reporting — one-click export
217216

218-
**MITM Patch (server-side, `apk-mitm` style):**
219-
220-
```bash
221-
# In the APK Auditor page, load a .apk, then click "Patch for MITM"
222-
```
223-
224-
What happens (runs `apktool` + `uber-apk-signer` on the server):
225-
1. Decodes the APK with `apktool`
226-
2. Injects a network security config that trusts user-installed CAs and disables certificate pinning, and sets `android:networkSecurityConfig` + `android:debuggable` on the manifest
227-
3. Rebuilds and re-signs the APK with a debug key (`uber-apk-signer`)
228-
4. Streams the patched, re-signed APK straight back as a **direct download** — uninstall the original, install this one on your test device, and you can intercept its HTTPS traffic with Burp/mitmproxy
229-
230-
> Requires the Docker image (it bundles `apktool` + `uber-apk-signer` + a JRE). The in-browser analysis above still runs entirely in the tab; only the MITM patch uploads the APK to the server.
217+
> **Want to MITM an app's HTTPS traffic?** The auditor is static-analysis only — kept deliberately lightweight (all in-browser, no heavy server-side Java toolchain). To prepare an APK for interception, patch it locally with [apk-mitm](https://github.com/niklashigi/apk-mitm) (`npx apk-mitm app.apk`), install the patched build on your test device, then drop it back into the auditor if you want to analyze it.
231218
232219
> **The APK Auditor never creates records in the main Scans dashboard** — it runs in its own context.
233220

internal/api/api.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,6 @@ func SetupAPI() *gin.Engine {
594594
apiGroup.GET("/nuclei/templates", apiListNucleiTemplates)
595595
// Security Lab — JWT HMAC secret brute-force (client-side analyzer calls this)
596596
apiGroup.POST("/jwt/brute", apiJWTBrute)
597-
// APK Auditor — patch an uploaded APK for MITM (trust user CAs + disable pinning)
598-
apiGroup.POST("/apk/mitm", apiAPKMitm)
599597
// Report Templates
600598
apiGroup.GET("/report-templates", apiListReportTemplates)
601599
apiGroup.GET("/report-templates/export", apiExportReportTemplates)

internal/api/apk_mitm.go

Lines changed: 0 additions & 62 deletions
This file was deleted.

internal/api/ui/apkauditor/index.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ <h2 id="appName">App Name</h2>
150150
<button class="export-item" data-export="sarif" role="menuitem" type="button"><span class="export-item-name">SARIF 2.1</span><span class="export-item-desc">GitHub Code Scanning</span></button>
151151
</div>
152152
</div>
153-
<button class="btn btn-ghost" id="mitmPatchBtn" type="button" title="Patch this APK to trust user CAs &amp; disable certificate pinning, then download the re-signed APK">
154-
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M12 2 4 5v6c0 5 3.5 8 8 11 4.5-3 8-6 8-11V5l-8-3z"/><path d="m9 12 2 2 4-4"/></svg>
155-
<span id="mitmPatchBtnLabel">Patch for MITM</span>
156-
</button>
157153
<button class="btn btn-primary" id="newScanBtn" type="button">
158154
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
159155
New Scan

internal/api/ui/apkauditor/src/main.js

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,65 +1462,6 @@ function setupPreviewRotator() {
14621462
}, 3600);
14631463
}
14641464

1465-
// The auditor is served in an iframe/tab where the dashboard sets a JS-readable
1466-
// autoar_token cookie; the /api auth middleware wants it as a Bearer header.
1467-
function getAuthTokenFromCookie() {
1468-
const m = document.cookie.match(/(?:^|;\s*)autoar_token=([^;]+)/);
1469-
return m ? decodeURIComponent(m[1]) : '';
1470-
}
1471-
1472-
// patchApkForMitm uploads the currently-loaded APK to the server, which patches
1473-
// it (trust user CAs + disable cert pinning) and re-signs it, then downloads the
1474-
// patched APK. The patching is server-side (apktool + uber-apk-signer) and can
1475-
// take a few minutes — this is the one action where the APK leaves the tab.
1476-
async function patchApkForMitm() {
1477-
const btn = $('#mitmPatchBtn');
1478-
const label = $('#mitmPatchBtnLabel');
1479-
if (!State.currentFile) {
1480-
toast('Load an .apk first, then patch it for MITM', 'error');
1481-
return;
1482-
}
1483-
if (!/\.apk$/i.test(State.currentFile.name)) {
1484-
toast('MITM patching only works on .apk files', 'error');
1485-
return;
1486-
}
1487-
const origLabel = label ? label.textContent : 'Patch for MITM';
1488-
if (btn) btn.disabled = true;
1489-
if (label) label.textContent = 'Patching…';
1490-
toast('Uploading & patching APK — apktool + re-signing runs on the server and can take a few minutes…', 'info');
1491-
try {
1492-
const fd = new FormData();
1493-
fd.append('apk', State.currentFile, State.currentFile.name);
1494-
const tok = getAuthTokenFromCookie();
1495-
const resp = await fetch('/api/apk/mitm', {
1496-
method: 'POST',
1497-
headers: tok ? { Authorization: 'Bearer ' + tok } : {},
1498-
body: fd,
1499-
});
1500-
if (!resp.ok) {
1501-
let msg = 'HTTP ' + resp.status;
1502-
try { const j = await resp.json(); if (j && j.error) msg = j.error; } catch (_) { /* non-JSON */ }
1503-
throw new Error(msg);
1504-
}
1505-
const blob = await resp.blob();
1506-
const base = State.currentFile.name.replace(/\.apk$/i, '');
1507-
const url = URL.createObjectURL(blob);
1508-
const a = document.createElement('a');
1509-
a.href = url;
1510-
a.download = base + '-patched.apk';
1511-
document.body.appendChild(a);
1512-
a.click();
1513-
a.remove();
1514-
setTimeout(() => URL.revokeObjectURL(url), 4000);
1515-
toast('Patched APK downloaded — uninstall the original, then install this one on your test device.', 'success');
1516-
} catch (e) {
1517-
toast('MITM patch failed: ' + e.message, 'error');
1518-
} finally {
1519-
if (btn) btn.disabled = false;
1520-
if (label) label.textContent = origLabel;
1521-
}
1522-
}
1523-
15241465
function init() {
15251466
setupGlobalErrors();
15261467
if ('serviceWorker' in navigator) {
@@ -1535,7 +1476,6 @@ function init() {
15351476
setupCursorSpot();
15361477
setupPreviewRotator();
15371478
$('#newScanBtn') && $('#newScanBtn').addEventListener('click', () => $('#fileInput').click());
1538-
$('#mitmPatchBtn') && $('#mitmPatchBtn').addEventListener('click', patchApkForMitm);
15391479
$('#heroCta') && $('#heroCta').addEventListener('click', () => $('#fileInput').click());
15401480
$('#downloadFileBtn') && $('#downloadFileBtn').addEventListener('click', downloadCurrentFile);
15411481
document.querySelectorAll('a.logo, .logo[href]').forEach(el => {

0 commit comments

Comments
 (0)