If you would prefer to execute capture and discovery from a Raspberry Pi, read the next section instead.
The machine running idt
should be connected to the same Wi-Fi network used for testing.
Follow the steps below to execute capture and discovery without a Raspberry Pi:
idt
, run source idt/scripts/alias.sh
.source idt/scripts/setup_shell.sh
to install aliases permanently.idt
aliases are available in your environment, calling any idt
command will automatically create a new virtual environment and install python dependencies.idt
is run, e.g. terminal emulator or IDE permission to access bluetooth in macOS settings.abort
message and no further output in the terminal.The execution environment of IDT when using Raspberry Pi is shown in the figure below.
[TODO] add figure.
The Raspberry Pi is where “discovery” and “capture” are executed.
The “admin” computer is the machine used to connect to and control the RPi, and to fetch artifacts which were created during capture from the RPi.
This directory contains tools for use on both the admin computer and the RPi.
idt
will be used on both the admin computer and the RPi.scripts
only points to one installation location at a time. It is ideal to maintain a single idt
directory on each (admin and RPi) system accordingly.idt/scripts/vars.sh
, which will be generated by running a script in the next section.zsh
and bash
(Linux and macOS).PowerShell
, MobaXterm
and FileZilla
.alias
script from the parent directory of idt
to get idt
commands in your current shell.source idt/scripts/alias.sh
idt
commands will be globally and automatically available. If you need to remove the installation, edit the .rc
files mentioned in setup_shell
.source idt/scripts/setup_shell.sh
idt_create_vars
and follow the prompts to set IDs for the target RPi.idt
to the RPi:idt_push
ssh
to the RPi:ssh
server to be available on the RPi. Retry if needed!idt_connect
PowerShell
, cd to the directory containing idt
and send idt
to the RPi:scp -r ./idt/* $PIUSER@$PIHOST:/home/$PIUSER/idt
ssh
to the RPi, e.g. with MobaXterm
ssh
server to be available on the RPi. Retry if needed!$PIUSER@$PIHOST
or $PIUSER@$ip
where $ip
is the RPi's IP found in your router admin panel.idt
:cd ~ # Go to idt parent dir source idt/scripts/setup_shell.sh # Setup atuo aliases source idt/scripts/alias.sh # Get aliases now idt_bootstrap # Initial configuration idt_build # Build the container image
SCP may not overwrite all files. To clear the idt
dir off of the RPi safely between pushes, exit the container and:
idt_clean
NOTE the idt artifacts directory is contained in idt, so running this will delete any artifacts.
Then from the admin computer:
idt_push
IMPORTANT
idt_
commands are shell aliases helpful for administrative commands.idt
invokes theidt
python package.
Output fromidt
will generally be colorized while output from sub processes is generally not.
RPi users, as needed:
MobaXterm
ssh
to the RPi (from your admin computer):idt_connect
idt
container (from the RPi):idt_activate
IMPORTANT
Ensure you've made it to the log line “Starting real time analysis, press enter to stop!” before launching the app under test.
idt capture -h usage: idt capture [-h] [--platform {Android}] [--ecosystem {PlayServicesUser,PlayServices,ALL}] [--pcap {t,f}] [--interface {wlp0s20f3,lo,docker0,any}] options: -h, --help show this help message and exit --platform {Android}, -p {Android} Run capture for a particular platform (default Android) --ecosystem {PlayServicesUser,PlayServices,ALL}, -e {PlayServicesUser,PlayServices,ALL} Run capture for a particular ecosystem or ALL ecosystems (default ALL) --pcap {t,f}, -c {t,f} Run packet capture (default t) --interface {wlp0s20f3,lo,docker0,any}, -i {wlp0s20f3,lo,docker0,any} Specify packet capture interface (default any)
For packet capture interface (-i
/--interface
:
any
.idt
checks available interfaces from /sys/class/net/
as well as allowing any
.Each ecosystem and platform involved in the capture will have their own subdirectory in the root artifact dir.
idt discover -h usage: idt discover [-h] --type {ble,b,dnssd,d} options: -h, --help show this help message and exit --type {ble,b,dnssd,d}, -t {ble,b,dnssd,d} Specify the type of discovery to execute
idt discover -t b
idt discover -t d
There is a per device log in ble
and dnssd
subdirectory of the root artifact dir.
usage: idt probe [-h] options: -h, --help show this help message and exit
Collect contextually relevant networking info from the local environment and provide artifacts.
adb
may fail to connect indefinitely depending on network configuration. Use a wired connection if wireless fails repeatedly.INFO
to DEBUG
in root config.py
for additional logging.tcpdump
for android may require additional dependencies.idt_go && source idt/scripts/compilers.sh
.enable_color
in config.py
to False
.idt_clean_child
will kill any stray tcpdump
and adb
commands.idt_check_child
will look for leftover processes.idt.py
which contains simple CLI parsing with argparse
.capture
base
contains the base classes for ecosystems and platforms.controller
contains the ecosystem and platform producer and controllerloader
is a generic class loader that dynamically imports classes matching a given super class from a given directory./platform
and /ecosystem
contain one package for each platform and ecosystem, which should each contain one implementation of the respective base class.discovery
matter_ble
provides a simple ble scanner that shows matter devices being discovered and lost, as well as their VID/PID, RSSI, etc.matter_dnssd
provides a simple DNS-SD browser that searches for matter devices and thread border routers.probe
probe
contains the base class for (idt
's) host platform specific implementation.linux
and mac
contain probe
implementations for each host platform.utils
log
contains logging utilities used by everything in the project.artifact
contains helper functions for managing artifacts.shell
contains a simple helper class for background and foreground Bash commands.host_platform
contains helper functions for the interacting with the host running idt
.config.py
should be used to hold development configs within the directory where they are needed.config.py
should not be used for everyday operation.BUILD
within the source tree.idt_clean_all
deletes all BUILD
dirs and BUILD
is in .gitignore
.Ecosystem and Platform implementations are dynamically loaded.
For each package in capture/ecosystem
, the ecosystem loader expects a module name matching the package name.
This module must contain a single class which is a subclass of capture.base.EcosystemCapture
.
/capture/ecosystem/play_services_user
contains a minimal example implementation.
As another example, link /res/plugin_demo/ecosystem/demo_ext_ecosystem
.
$ idt_go && ln -s $PWD/idt/res/plugin_demo/ecosystem/demo_ext_ecosystem/ idt/capture/ecosystem $ idt capture -h usage: idt capture [-h] [--platform {Android}] [--ecosystem {DemoExtEcosystem...
IMPORTANT: Note the following runtime expectations of ecosystems:
analyze_capture()
must not block the async event loop excessively and must not interact with standard in
The platform loader functions the same as capture/ecosystem
.
For each package in capture/platform
, the platform loader expects a module name matching the package name.
This module must contain a single class which is a subclass of capture.base.PlatformLogStreamer
.