nccgroup / depthcharge

A U-Boot hacking toolkit for security researchers and tinkerers
https://depthcharge.readthedocs.io
BSD 3-Clause "New" or "Revised" License
257 stars 14 forks source link

python: Remove target reboot attempt upon seeing '$' or '#' prompt #34

Closed jynik closed 4 years ago

jynik commented 4 years ago

As outlined in issue #32, this behavior is more harmful than helpful to new users. It has been changed to an opt-in for now. If one wishes to trigger a reboot upon Depthcharge encountering a prompt matching 'root@[a-z]+\s?#' when seeking to identify the U-Boot prompt, one can define their console as follows:

depthcharge-inspect -c my_dev.cfg -i '/dev/ttyUSB0:reboot_re=root@[a-z]+\s?#'

By default, a command 'reboot || shutdown -h' will be used. This can be overridden by appending ,reboot_cmd=my_cmd

This all still needs to be documented as being a supported feature (i.e. making an API promise). (For the time being this should be treated as a "hidden" feature subject to change.)

However, this should at least prevent a feature from getting in the way of an unsuspecting user.