{"id":458,"date":"2025-07-14T04:04:33","date_gmt":"2025-07-14T11:04:33","guid":{"rendered":"https:\/\/shmalex.com\/?p=458"},"modified":"2025-07-31T22:43:41","modified_gmt":"2025-08-01T05:43:41","slug":"adventures-with-a-bus-pirate","status":"publish","type":"post","link":"https:\/\/electronsandxploits.com\/?p=458","title":{"rendered":"Beyond the Bootloader: Bus Pirate Root Adventures"},"content":{"rendered":"\n<p>The Bus Pirate is an amazing open-source tool for hardware debugging. It supports a wide range of protocols like <strong>SPI, I2C, UART, <\/strong>and<strong> JTAG<\/strong>, making it ideal for exploring routers, IoT devices, or any hardware utilizing these common protocols. Once a device is disassembled, several directions open up for hardware exploration. In this post, we&#8217;ll focus on assessing the router&#8217;s security and attempting to gain root access. Future posts will cover more advanced topics, such as pulling firmware or modifying the boot process.<\/p>\n\n\n\n<p>Before starting we need to make sure the Bus Pirate firmware is up to date. <\/p>\n\n\n\n<p><strong>Bus Pirate Setup<\/strong><\/p>\n\n\n\n<p>The boot loader and firmware can be downloaded from the <a href=\"https:\/\/github.com\/BusPirate\/Bus_Pirate\/tree\/master\/Bootloaders\">DangerousPrototypes<\/a> GitHub page.  Or run the git command<\/p>\n\n\n\n<p><code>$ sudo git clone https:\/\/github.com\/DangerousPrototypes\/Bus_Pirate\/<\/code><\/p>\n\n\n\n<p>Navigate to the Boot Loader file. (If using Linux)<\/p>\n\n\n\n<p>$  <code>~\/Bus_Pirate\/BPv4-bootloader\/pirate-loader<\/code><\/p>\n\n\n\n<p>Next connect the Bus Pirate via the USB cable and push the update. NOTE: The jumper that needs to be in place to update the firmware and replace the firmware version with preferred option. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"540\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/Bus0-1080x540.jpg\" alt=\"\" class=\"wp-image-461\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/Bus0-1080x540.jpg 1080w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/Bus0-300x150.jpg 300w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/Bus0-768x384.jpg 768w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/Bus0-1536x768.jpg 1536w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/Bus0-2048x1024.jpg 2048w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/Bus0-600x300.jpg 600w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/Bus0-945x473.jpg 945w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/figure>\n\n\n\n<p><code>$ sudo .\/pirate-loader_lnx  --dev-\/dev\/ttyUSB0  --hex-BPv3-firmware-v6.3-r2151.hex<\/code><\/p>\n\n\n\n<p>Next we need a terminal based serial communication program to run commands. Minicom is ideal for this. to install and configure minicom to run over USB<\/p>\n\n\n\n<p><code>$ sudo apt install minicom<\/code><\/p>\n\n\n\n<p><code>$ sudo minicom -s<\/code><\/p>\n\n\n\n<p>In the configuration settings setup USB as the serial usb \/dev\/tty\/USB0  and finally save as dfl.<\/p>\n\n\n\n<p>To run the program type minicom in the terminal, if configured correctly any keystroke will cause the led on the Bus Pirate to blink. typing ? in the minicom window will bring up the help menu.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"429\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate4.png\" alt=\"\" class=\"wp-image-460\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate4.png 660w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate4-300x195.png 300w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate4-600x390.png 600w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p><strong>The Fun Begins.<\/strong><\/p>\n\n\n\n<p>Locate the UART connector on the device. UART has 4 pins: <strong>Power,<\/strong> <strong>Ground,<\/strong> <strong>Tx <\/strong>and <strong>Rx<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"540\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus2-1080x540.jpg\" alt=\"\" class=\"wp-image-462\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus2-1080x540.jpg 1080w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus2-300x150.jpg 300w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus2-768x384.jpg 768w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus2-1536x768.jpg 1536w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus2-2048x1024.jpg 2048w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus2-600x300.jpg 600w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus2-945x473.jpg 945w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/figure>\n\n\n\n<p>Once located we need to identify the function of each pin using a multimeter.<\/p>\n\n\n\n<p><strong>Ground:<\/strong> The ground pin can be found by finding a known ground on the device and checking continuity between each of the 4 pins. Only one should have continuity with the motherboard ground.<\/p>\n\n\n\n<p><strong>Power:<\/strong> The power pin can be found by checking voltage between the ground point\/pin and one of the 3 other pins. The power pin should have a constant voltage typically between 3v-12v depending on the device.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"540\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus3-1080x540.jpg\" alt=\"\" class=\"wp-image-463\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus3-1080x540.jpg 1080w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus3-300x150.jpg 300w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus3-768x384.jpg 768w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus3-1536x768.jpg 1536w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus3-2048x1024.jpg 2048w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus3-600x300.jpg 600w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus3-945x473.jpg 945w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/figure>\n\n\n\n<p><strong>Tx:<\/strong> The transmit pin should have a small spike in voltage typically a very low voltage.  This is the data that the device is sending back to read.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"540\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus4-1080x540.jpg\" alt=\"\" class=\"wp-image-464\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus4-1080x540.jpg 1080w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus4-300x150.jpg 300w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus4-768x384.jpg 768w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus4-1536x768.jpg 1536w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus4-2048x1024.jpg 2048w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus4-600x300.jpg 600w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus4-945x473.jpg 945w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/figure>\n\n\n\n<p><strong>Rx:<\/strong> The receive pin will have no voltage spikes and can be found simply from process of elimination. This pins voltage only spikes when data is sent to the device.<\/p>\n\n\n\n<p>Final connection set up.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"540\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus5-1080x540.jpg\" alt=\"\" class=\"wp-image-465\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus5-1080x540.jpg 1080w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus5-300x150.jpg 300w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus5-768x384.jpg 768w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus5-1536x768.jpg 1536w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus5-2048x1024.jpg 2048w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus5-600x300.jpg 600w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus5-945x473.jpg 945w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/figure>\n\n\n\n<p><strong>Reading The Data<\/strong><\/p>\n\n\n\n<p>With the Bus Pirate powered and connected to the computer and the modem off we need to finalize our settings. Run minicom and bring up the menu by hitting &#8216;m&#8217; key.  There will be 6 options needed to be set for UART. (The settings are different for each protocol)<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Protocol    (3=UART)<\/li>\n\n\n\n<li>Serial Port Speed    (5=9600bps the communication speed can either be found with a little research or by some trial and error)<\/li>\n\n\n\n<li>Data Bits and Parity (4=None)<\/li>\n\n\n\n<li>Stop Bits    (1=Default)<\/li>\n\n\n\n<li>Receive polarity  (Idle 1= Default)<\/li>\n\n\n\n<li>Output type  (2=Normal)<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"419\" height=\"670\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate1.png\" alt=\"\" class=\"wp-image-466\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate1.png 419w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate1-188x300.png 188w\" sizes=\"auto, (max-width: 419px) 100vw, 419px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"248\" height=\"212\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate2.png\" alt=\"\" class=\"wp-image-467\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"536\" height=\"82\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate3.png\" alt=\"\" class=\"wp-image-468\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate3.png 536w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate3-300x46.png 300w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><\/figure>\n\n\n\n<p>Once settings are configured hit the &#8216;W&#8217; key to start the UART protocol connection<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"269\" height=\"112\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/buspirate5.png\" alt=\"\" class=\"wp-image-469\"\/><\/figure>\n\n\n\n<p>Using transparent bridge mode, live mode or bridge with flow control we can monitor the bios boot process. After the modem is powered a stream of data will start to flow across the screen, keep an eye out for Bios and Build versions as this can lead to finding manuals and default passwords for devices.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"691\" height=\"394\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus6.png\" alt=\"\" class=\"wp-image-470\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus6.png 691w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus6-300x171.png 300w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus6-600x342.png 600w\" sizes=\"auto, (max-width: 691px) 100vw, 691px\" \/><\/figure>\n\n\n\n<p>On many IoT devices or routers the user is often presented with a login screen. If that is the case finding root passwords is a simple Google search away since we now have build numbers and OS data. But on occasion after the boot screen loads we are left with no input on the terminal, in that case we need to dig a littler deeper.<\/p>\n\n\n\n<p><strong>Glitching SDRAM<\/strong><\/p>\n\n\n\n<p>The next step will be to introduce faults in the boot process by shorting I\/O pins to ground during the boot process. Note that the results vary but in this case we get just a little closer to root.  The first thing is to find the SDRAM chip on the board, from there we find the data sheet for the chip. Next we find the I\/O pins see picture below as example.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"452\" height=\"494\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus7.png\" alt=\"\" class=\"wp-image-471\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus7.png 452w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus7-274x300.png 274w\" sizes=\"auto, (max-width: 452px) 100vw, 452px\" \/><\/figure>\n\n\n\n<p>Once the I\/O pins are determined we connect one wire to the ground of the board and the other will probe each I\/O pin interrupting the boot process.  This takes time since the boot process window to interrupt the boot and create a fault can be a fraction of a second. It is easy to miss and there is more than one I\/O pin.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"540\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus8-1080x540.jpg\" alt=\"\" class=\"wp-image-472\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus8-1080x540.jpg 1080w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus8-300x150.jpg 300w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus8-768x384.jpg 768w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus8-1536x768.jpg 1536w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus8-2048x1024.jpg 2048w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus8-600x300.jpg 600w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus8-945x473.jpg 945w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/figure>\n\n\n\n<p>Good things come to those patient and determined.  Picture below shows the SDRAM glitch created a fault that jumped to a password screen that was previously blocked.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"677\" height=\"552\" src=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus9.png\" alt=\"\" class=\"wp-image-473\" style=\"width:840px;height:auto\" srcset=\"https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus9.png 677w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus9-300x245.png 300w, https:\/\/electronsandxploits.com\/wp-content\/uploads\/2025\/07\/bus9-600x489.png 600w\" sizes=\"auto, (max-width: 677px) 100vw, 677px\" \/><\/figure>\n\n\n\n<p>In the next post, we will attempt to pull the firmware directly from the chip and go further down the rabbit hole.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Bus Pirate is an amazing open-source tool for hardware debugging. It supports a wide range of protocols like SPI, I2C, UART, and JTAG, making it ideal for exploring routers, IoT devices, or any hardware utilizing these common protocols. Once a device is disassembled, several directions open up for hardware exploration. In this post, we&#8217;ll [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":465,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-458","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects"],"_links":{"self":[{"href":"https:\/\/electronsandxploits.com\/index.php?rest_route=\/wp\/v2\/posts\/458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/electronsandxploits.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/electronsandxploits.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/electronsandxploits.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/electronsandxploits.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=458"}],"version-history":[{"count":5,"href":"https:\/\/electronsandxploits.com\/index.php?rest_route=\/wp\/v2\/posts\/458\/revisions"}],"predecessor-version":[{"id":499,"href":"https:\/\/electronsandxploits.com\/index.php?rest_route=\/wp\/v2\/posts\/458\/revisions\/499"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/electronsandxploits.com\/index.php?rest_route=\/wp\/v2\/media\/465"}],"wp:attachment":[{"href":"https:\/\/electronsandxploits.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/electronsandxploits.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/electronsandxploits.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}