Skip to content
项目

关于

Remote Wireless Android Debugging, over the internet.

系统与基础设施

这些数字如何统计

可以做什么

  • Remote support: help a colleague or relative with their phone without asking them to touch router settings.
  • Development and QA: debug an app on a device you do not physically hold.
  • Field devices: reach phones and tablets deployed behind NAT or carrier networks.
  • Mobile forensics: run a consensual remote acquisition, ready for WARD or MVT.

实测星标增长

24小时
0
7天
+5
15天
+54
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文
MESHadb

Documentation Public Beta Status License Latest Release

Get it on Google Play Get it on F-Droid

DOCS  |  MESHnet  |  BARGHEST

MESHadb

Peer-to-peer ADB over the internet. Reach an Android device's wireless debugging from anywhere, with no port forwarding, no accounts and no server to run.

ADB wireless debugging only works when your computer and the phone share a Wi-Fi network. MESHadb removes that limit. The phone runs a small app, your computer runs a CLI, and the two join an encrypted tunnel using an address and a one-time PIN. From then on, adb talks to the phone as if it were on your desk.

  • Peer-to-peer first. Your computer and the phone connect directly to each other over WireGuard-encrypted UDP, punching through NAT on both sides. There is no VPN hub in the middle.
  • HTTPS relay when direct fails. On networks that block UDP or defeat hole punching, traffic falls back to a relay over HTTPS (TCP port 443), which looks like ordinary web traffic. The relay only forwards packets that are already end-to-end encrypted, so it cannot read them.

Sessions are ephemeral. Nothing is persisted, every start gets a new address, and when the session ends the tunnel is gone.

What you can do with it

  • Remote support: help a colleague or relative with their phone without asking them to touch router settings.
  • Development and QA: debug an app on a device you do not physically hold.
  • Field devices: reach phones and tablets deployed behind NAT or carrier networks.
  • Mobile forensics: run a consensual remote acquisition, ready for WARD or MVT.
  • Exit node: send a device's internet traffic out through your machine, to capture and inspect it or to get around a censored network.

Quick start

You need:

1. Start the CLI

git clone https://github.com/BARGHEST-ngo/MESHadb.git
cd MESHadb
task analyst

It prints a QR code and a MESH address, then drops you at the meshcli> prompt.

2. Create a PIN

meshcli> pin
PIN: 123456

3. Join from the phone

Open the MESHadb app, scan the QR code and enter the PIN.

4. Pair ADB

meshcli> adbpair

On the phone, turn on Wireless debugging and tap Pair device with pairing code. Type the code and the two ports into the prompt when asked.

5. Use ADB

Open a second terminal:

task shell
adb devices
adb shell

When you are done, run adbclean to clear the logs the session left on the device, then adbdisable to turn developer mode off. Run them in that order and only after the acquisition, since adbclean needs ADB and destroys the device's logs, including those of MESHadb usage, if run early.

Then run disconnect in the CLI, or task down to stop everything.

Commands

Command What it does
pin Create a one-time PIN so a device can join
adbpair Pair and connect to a device's wireless debugging
adb <args> Run any adb command against the paired device, e.g. adb shell
status Show the session and its connected devices
forward on|off Send a device's internet traffic through your machine
capture start|stop Record a device's forwarded traffic to a pcap file
disconnect End a device's session
qr Show the address QR code again, or save it as a PNG with -o
adbcollect Run a forensic acquisition (see Forensics)
adbdisable Turn off developer mode on the device
adbclean Clear shell-accessible logs left by a session

Run help at the prompt for flags.

How it works

MESHadb is built on MESHnet, our small Go library for connecting a server to its clients over an encrypted, peer-to-peer tunnel.

  your computer                                           the phone
┌────────────────┐   1. direct: WireGuard over UDP     ┌────────────────┐
│ adb ─► meshcli │ ◄═════════════════════════════════► │  MESHadb app   │
│        bridge  │                                     │  ─► adbd       │
└───────┬────────┘                                     └────────┬───────┘
        │         2. fallback: HTTPS relay (TCP 443)            │
        └──────────────────►  relay  ◄──────────────────────────┘
                     (sees encrypted packets only)

Peer-to-peer by default

MESHadb has no central server that carries your traffic. Both ends first reach each other through a relay, use it to exchange their network endpoints, and then punch through NAT to a direct UDP path. Once that path is up, ADB traffic flows straight between your computer and the phone.

HTTPS relay as the fallback

Direct UDP is not always possible. Carrier-grade NAT, hotel and corporate Wi-Fi, and censored networks often block or degrade it. A plain WireGuard VPN simply stops working there. MESHadb keeps the session alive by sending the same encrypted packets through a DERP relay over HTTPS on TCP port 443.

  • The relay is a fallback and a meeting point. It is not a hub, and the connection moves to a direct path whenever one becomes available.
  • Traffic is WireGuard-encrypted end to end between the CLI and the phone. The relay cannot decrypt it.
  • To the network in between, a relayed session is an HTTPS connection.
  • The current release uses tailcat's default relays, which are free, rate-limited relays run by Tailscale. They cannot read your traffic, but they can see IP addresses, timing and data volume.

A session, step by step

  1. meshcli starts a MESHnet server and prints its address. Each start gets a new key and a new address.
  2. pin creates a 6-digit PIN that admits exactly one device.
  3. The app joins with the address and the PIN. A device with only the address cannot connect.
  4. The two ends connect directly, or through the relay if they cannot.
  5. adbpair opens a local port and bridges it, through the tunnel, to the phone's wireless debugging port. adb connects to that local port.

Forensics, Censorship Circumvention and Security Research

MESHadb is developed primarily for remote logical acquisition of forensic artifacts and for network monitoring, in support of forensics, censorship circumvention and security research. We built it to make spyware forensics and security research possible on devices in other countries.

Examples of research it supports:

  • Spyware forensics: consensual acquisition from the device of a person at risk, wherever they are
  • Censorship monitoring: observe blocking and interference from inside the affected network
  • Censorship circumvention: give a device on a restricted network a way out through a machine you trust
  • Carrier services research: study operator behaviour, preinstalled apps and network configuration on real devices in-country
  • App and traffic analysis: capture what an app sends from a device on its real network

Acquisition

meshcli> adbcollect
meshcli> adbcollect --module BackupTar
meshcli> adbcollect --output /home/mesh/acquisitions/case-01

adbcollect runs an ADB acquisition using AndroidQF and WARD. The output is in the format WARD and MVT expect. Acquisitions are written to ~/mesh-acquisitions on your computer; set ACQUISITION_DIR in .env to change that.

Exit node

meshcli> forward on

forward on makes your machine the device's exit node: its TCP and UDP traffic travels through the encrypted tunnel and reaches the internet from your network. forward off returns it to its own connection. This gives you two things:

  • Capture: the device's traffic passes through your machine, where you can record and inspect it. tcpdump and Suricata ship in the image; open task shell to run them.
    Alternatively run capture start to save pcap data to the device's acquisition directory
  • Circumvention: a device on a censored or hostile network reaches the internet from your location. The local network sees only the tunnel, which falls back to HTTPS when UDP is blocked.

After the session

  • adbdisable turns developer mode off, so the device is not left open to non-consensual extraction.
  • adbclean clears logcat buffers and shell-accessible telemetry. Run it only after the acquisition, or you will destroy evidence. It is best effort: the paired ADB key and root-only logs remain on the device.

Security model

  • The address is a secret. Share the address and the PIN over separate channels, at least one of them end-to-end encrypted, such as Signal.
  • PINs are single-use. One PIN admits one device and expires after 10 minutes. Three wrong guesses cancel the pairing.
  • Not an anonymity tool. Relays can see both ends' IP addresses, and once connected each end can learn the other's.
  • Nothing persists. A lost connection is a finished session. The device must rejoin with a new PIN.
  • Consent. The person holding the phone installs the app, enters the PIN and enables Wireless debugging themselves. Only use MESHadb on devices whose owner has agreed.

Repository structure

  • analyst: the meshcli command-line client
  • android-client: the Android app
  • docs: documentation source

To build the Android app from source, run make -C android-client apk.

Supported by

Open Technology Fund

MESHadb is supported by the Open Technology Fund to support the consensual remote forensics of spyware and surveillance targeting Human Rights Defenders.

License

MESHadb is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). All modifications and additions by BARGHEST are Copyright (c) BARGHEST.

Portions are derived from AndroidQF under the MVT License 1.1. Third-party components keep their own copyrights and licenses.

探索相关项目

加载中…