This project is archived due to no longer having an environment in which it is relevant or thus testable. No reason why it won't work for a good while though given sufficient tweaks.
- The MitM is checked to be running and to have at least one outbound connection to the upstream websocket.
- If those fail, the MitM is restarted.
- That's it, and that's all you really need.
- The script is intended to be installed from a Unix/Linux like environment and depends on having
bash&adbavailable. - All arguments to
nanny.share interpreted as adb reachable addresses. nanny.shhandles the connection & installation for you and embeds the nanny script itself:./nanny.sh host1 host2 host3 192.168.1.21- If you have a range of devices, you can use a bash/zsh range expansion:
./nanny.sh atv0{1..99} - Once pushed to devices, reboot them to activate nanny.
- Monitor
/sdcard/nanny.logto see what's going on.
If you don't want to customize anything and can't run nanny.sh due to not having a bash environment to run it in, you could use manual_nanny.sh instead. It's a pre-rendered default settings nanny script.
- Edit
manual_nanny.shtowards the top to set your MitM package name. - Somehow
adb pushthe file onto a device. For exampleadb push manual_nanny.sh /sdcard - With root permissions, place it into
/data/adb/service.d/. For examplesu -c "mv /sdcard/manual_nanny.sh /data/adb/service.d/" - Make sure the script is executable:
su -c "chmod +x /data/adb/service.d/manual_nanny.sh"
Just repeat the installation steps & reboot!
- Remove the script, for example
adb -s $host shell 'su -c "rm /data/adb/service.d/nanny.sh"' - Reboot the device to stop the running copy, or see the top of
/sdcard/nanny.logfor the pid number and kill that one.
- Action is taken by default only if there are zero upstream connections. This could be autodetected to control connection + worker connections, but doesn't seem to be necessary right now and could cause useless churn.
The script has a handful of variables set at the top you could customize, but the defaults work well.
interval=30# check every interval secondsreporting=30# interval x reporting = reporting intervalinitial_cooldown=30# wait initial_cooldown seconds on boot before actioncooldown=240# wait cooldown seconds for mitm before checking after an actionlog="/sdcard/nanny.log"# log for all output, cleared for every run of nanny.connection_min=1# Number of upsteam ws connections to require. Not all mitms will support a value over 1.mitm="com.gocheats.launcher"# package name of mitm. You can also set the env variableNANNY_MITMto override at runtime.
/data/adb/service.d/nanny.sh: Enabling logging to /sdcard/nanny.log
Nanny starting at 2023-12-16T18:49:23, expected rotom conn: 192.186.1.10:80
Checking every 10s but reporting success only every ~900s.
First check in 60s to give the mitm a bit of space.
FINE at 2023-12-16T18:50:24 (check #0)
FINE at 2023-12-16T19:06:02 (check #90)
FINE at 2023-12-16T19:21:38 (check #180)
FINE at 2023-12-16T19:37:13 (check #270)
*snip*
FINE at 2023-12-17T02:06:14 (check #2520)
DISCONNECT at 2023-12-17T02:18:31
TAKING_ACTION at 2023-12-17T02:18:31 (check #2591)
bash arg: -p
bash arg: com.gocheats.launcher
bash arg: 1
Events injected: 1
## Network stats: elapsed time=65ms (0ms mobile, 0ms wifi, 65ms not connected)
PAUSE_CHECKS at 2023-12-17T02:18:33
RESUME_CHECKS at 2023-12-17T02:19:33
FINE at 2023-12-17T02:19:34 (check #0)
FINE at 2023-12-17T02:35:07 (check #90)
FINE at 2023-12-17T02:50:41 (check #180)