Files
BFR/tools/dns_probe2.sh
M1rsem 89d0adb27c Release VeilBox v1.11.0: switchable TrustTunnel/olcrtc profiles.
Rename display name to VeilBox, add box.profile + sbfr p switcher, and ship scrubbed sing-box profile templates for quick TT/olcrtc flips.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-12 20:34:21 +03:00

34 lines
1.8 KiB
Bash

#!/system/bin/sh
export PATH="/data/adb/magisk:/data/adb/box/bin:/system/bin:$PATH"
echo "=== raw udp53 from root (will be hijacked) ==="
# use busybox nslookup if available
busybox nslookup google.com 77.88.8.8 2>&1 | head -20 || true
echo "=== udp53 via sing-box owner? test with nc ==="
# Direct connect test: can we reach DNS/UDP and TT socks
echo | busybox nc -w 2 -u 77.88.8.8 53; echo "nc_udp_exit=$?"
echo "=== socks connect test ==="
curl -x socks5h://127.0.0.1:10800 -m 8 -sS -o /dev/null -w "socks_google %{http_code} %{time_total}\n" https://www.google.com/ || true
curl -x socks5://127.0.0.1:10800 -m 8 -sS -o /dev/null -w "socks_ipgoogle %{http_code} %{time_total}\n" https://142.251.150.119/ --resolve www.google.com:443:142.251.150.119 || true
echo "=== tt log ==="
tail -30 /data/adb/box/run/sidecar.log 2>/dev/null || tail -30 /data/adb/box/run/trusttunnel*.log 2>/dev/null || ls -la /data/adb/box/run/
echo "=== try dns detour=direct DoH ==="
CFG=/data/adb/box/sing-box/config.json
yq -i -o=json '(.dns.servers[] | select(.tag=="dns-remote") | .detour) = "direct"' "$CFG"
# also add pure tcp dns via sidecar as dns-tcp
yq -i -o=json '
.dns.servers += [{"type":"tcp","tag":"dns-tcp-socks","detour":"sidecar-proxy","server":"1.1.1.1"}] |
.dns.final = "dns-tcp-socks" |
.dns.strategy = "ipv4_only"
' "$CFG"
kill -HUP "$(pidof sing-box)" 2>/dev/null || true
sleep 1
# hard restart sing-box only (keep TT)
sh /data/adb/box/scripts/box.service restart
sleep 4
echo "=== dns cfg ==="
yq -o=json '.dns' "$CFG"
echo "=== test ==="
curl -m 15 -sS -o /dev/null -w "google %{http_code} %{time_total}\n" https://www.google.com/ || true
curl -m 12 -sS -o /dev/null -w "ya %{http_code} %{time_total}\n" https://ya.ru/ || true
grep 'dns: exchange failed' /data/adb/box/run/sing-box.log | tail -8