Add ITVX module, transparent mitm_hosts, and DM Telegram announces.
All checks were successful
release / build-and-upload (push) Successful in 6m21s
All checks were successful
release / build-and-upload (push) Successful in 6m21s
Wire module mitm_hosts into StartTransparent for ITVX capture, ship the itv provider stub with Live-list autoplay, refresh the README, and send Forgejo release announces to private chat 7314901602.
This commit is contained in:
parent
3cb259c9b6
commit
2e43e6c3fa
23 changed files with 996 additions and 84 deletions
|
|
@ -478,7 +478,9 @@ const (
|
|||
|
||||
// StartTransparent pushes appproxy in -transparent mode (no Wi‑Fi http_proxy),
|
||||
// installs iptables UID REDIRECT for pkg, and writes captures under remoteDir.
|
||||
func StartTransparent(c *adb.Client, localBin, pkg, port, remoteDir string, reinject bool) error {
|
||||
// mitmHosts are passed as repeatable -mitm-host flags (suffix match); transparent
|
||||
// mode otherwise only MITMs open.live.bbc.co.uk.
|
||||
func StartTransparent(c *adb.Client, localBin, pkg, port, remoteDir string, reinject bool, mitmHosts ...string) error {
|
||||
if port == "" {
|
||||
port = "8080"
|
||||
}
|
||||
|
|
@ -518,6 +520,20 @@ func StartTransparent(c *adb.Client, localBin, pkg, port, remoteDir string, rein
|
|||
_, _ = c.Shell("mkdir", "-p", remoteDir)
|
||||
_, _ = c.Shell("rm", "-f", remoteDir+"/cap.json", remoteDir+"/traffic.jsonl", remoteDir+"/appproxy.log")
|
||||
|
||||
mitmFlags := ""
|
||||
seen := map[string]bool{}
|
||||
for _, h := range mitmHosts {
|
||||
h = strings.TrimSpace(strings.ToLower(h))
|
||||
if h == "" || seen[h] || !safeMitmHost(h) {
|
||||
continue
|
||||
}
|
||||
seen[h] = true
|
||||
mitmFlags += " -mitm-host " + h
|
||||
}
|
||||
if mitmFlags != "" {
|
||||
fmt.Printf("[*] Force MITM hosts:%s\n", mitmFlags)
|
||||
}
|
||||
|
||||
starter := "#!/system/bin/sh\n" +
|
||||
"mkdir -p '" + remoteDir + "'\n" +
|
||||
"exec " + RemoteBin +
|
||||
|
|
@ -529,6 +545,7 @@ func StartTransparent(c *adb.Client, localBin, pkg, port, remoteDir string, rein
|
|||
" -dns 1.1.1.1,1.0.0.1,8.8.8.8" +
|
||||
" -log-all" +
|
||||
" -v" +
|
||||
mitmFlags +
|
||||
"\n"
|
||||
tmp := filepath.Join(os.TempDir(), "start_appproxy_tproxy.sh")
|
||||
if err := os.WriteFile(tmp, []byte(starter), 0o755); err != nil {
|
||||
|
|
@ -597,6 +614,20 @@ func StopTransparent(c *adb.Client) {
|
|||
fmt.Println("[*] transparent capture stopped")
|
||||
}
|
||||
|
||||
// safeMitmHost allows only hostname characters so flags stay shell-safe.
|
||||
func safeMitmHost(h string) bool {
|
||||
if h == "" || len(h) > 253 {
|
||||
return false
|
||||
}
|
||||
for _, r := range h {
|
||||
if (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '.' || r == '-' {
|
||||
continue
|
||||
}
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// ResetOptions controls drm proxy reset.
|
||||
type ResetOptions struct {
|
||||
KeepCaptures bool // leave /data/local/tmp/capture/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue