Bus Pirate Firmware Update Made Easy

Recientemente me llegó el Bus Pirate (v3 de Sparkfun) considerado la navaja suiza de hardware hacking. Este dispositivo es un interfaz bus universal que permite comunicarse con la mayoría de chips desde el PC y que agiliza la creación de prototipos o para otros usos ;)

Recently I got a Bus Pirate (Sparkfun v3), considered the Swiss army knife of hardware hacking. This device is a universal bus interface that allows communication with the most chips from PC speeding up the creation of prototypes or other uses ;)

La mayoría de Bus Pirate no suelen tener la última versión de firmware por lo que en este post explicaré de forma detallada cómo actualizarlo (en mi caso he actualizado a la  5.10). Se recomienda actualizar el firmware ya que trae importantes mejoras como por ejemplo el “binary access mode”, que nos permite utilizar Python u otros lenguajes con el Bus Pirate.

Most Bus Pirate do not have the latest version of firmware, therefore in this post I will explain in detail how to update it (in my case I upgraded it to the 5.10 version). Upgrading the firmware is recommended because it brings significant improvements as for example the “binary access mode” that allows us to use Python or other languages to communicate with the Bus Pirate.

Antes de nada debemos leer las instrucciones sobre actualización de firmware en Dangerous Prototypes (la web oficial), ya que tendremos que hacer una serie de pasos allí descritos. Para  actualizar la versión firmware de 2 o 3 a la versión 4 hay que utilizar el método antiguo (uso de jumper). A partir de la versión 4 la actualización de firmware es mucho más sencilla como veremos en el post.

First of all we must read the documentation for update firmware on Dangerous Prototypes (the official website) since we have to do a series of steps described there in great length. To update version firmware 2 or 3 to version 4 we need to use the old method (use of a jumper). From version 4 firmware upgrade is much easier as we will see in the post.

Fig. 1 – Bus Pirate y dos Jumpers (Uno de ejemplo y otro en los pins PGC y PGD) / Bus Pirate and two Jumpers (one as a sample and another connected on GCP and PGD pins)

En la Fig. 1 vemos el Bus Pirate y dos jumper, uno a modo de ejemplo y otro conectado a los pins PGC y PGD para entrar en el modo actualización. Una vez que hayamos metido el jumper en los pins correspondientes debemos enchufar el Bus Pirate mediante USB.  

Es el momento de actualizar nuestro gadget :)

We see in the Fig. 1 the Bus Pirate and two jumpers, one as a sample and the other connected to the pins PGC and PGD to enter the update mode. Once you have gotten the jumper in the corresponding pins, plug the Bus Pirate to the USB.

Time to update our gadget :)

 

Fig. 2 – Selección de puerto y velocidad / Port and speed selection

Como en la Fig.2 ejecutamos el Tera Term Web (el programa recomendado para comunicarse con el Bus Pirate y es gratis :)  ) y debemos seleccionar el puerto COM (COM5 en mi caso) y la velocidad de transferencia a 115200.

As Fig.2 we run Tera Term Web (the recommended serial terminal to communicate with the Bus Pirate and is free :)  ) and we must select the COM port (COM5 in my case) and the set the transfer rate to 115200.

Fig. 3 – Bus Pirate en acción /  Bus Pirate in action

Si todo está correcto podemos comunicarnos con el Bus Pirate (Fig. 3). En la terminal he escrito el comando “i” para ver el status y podemos ver que la versión del firmware es la 3.

If everything is correct we can communicate with the Bus Pirate (Fig. 3). In the terminal I have typed the command “i” to see the status and we can see that the firmware version is 3.

Fig. 4 – Ejecutar P24QP.exe / Run P24QP.exe

Según las instrucciones de Dangerous Prototypes (que debemos leer antes de seguir este post) ahora debemos ejecutar el bootloader (P24QP.exe)  como vemos en la Fig. 4 y debemos seleccionar puertos y velocidad para comunicarse con el Bus Pirate. (Barra de estado)

As from Dangerous Prototypes documentation (which we should read before continuing with this post) we now run the bootloader (P24QP.exe) as we see in Fig. 4 and we must select ports and speed to communicate with the Bus Pirate. (Status bar)

Fig. 5 – Seleccionar el fichero hex / Select the hex file

En la Fig. 5 seleccionamos el fichero BPv3-v2blupdaterva3-v4.1.hex

As Fig. 5 we now select file fichero BPv3-v2blupdaterva3-v4.1.hex

Fig. 6 – Elegimos opción Erase para borrar el viejo firmware / Select Erase option to delete old firmware

En la Fig. 6 le damos al botón de Erase Device para borrar el viejo firmware. Si no hacemos esto el nuevo firmware no funcionara correctamente.

As Fig. 6 we click on the Erase Device button to delete the old firmware. If we don’t do this the new firmware would not work correctly.

Fig. 7 – Escribimos el nuevo firmware / Now write the new firmware

En la Fig. 7 ya comenzamos a escribir el nuevo firmware en el Bus Pirate. Primero le daremos a “Write Device” y cuando termine pulsamos en “Normal Execution Mode”.

As show in Fig. 7 we already begin to write the new firmware in the Bus Pirate. First we will click on “Write Device” button and when is finished click on “Normal Execution Mode” to write the firmware.

Fig. 8 – mensaje de advertencia / Warning message

Al terminar el proceso de escritura nos saldrá una ventana de advertencia (Fig. 8 ), le decimos que “yes”. Podemos desconectar el Bus Pirate ya que debemos quitar el jumper para el siguiente paso, aunque después volveremos a meter en jumper.

At the end of the process of writing a warning window will pop up (Fig. 8 )  so just click “yes”. We now disconnect the Bus Pirate as we have to remove the jumper for the next step, though later we will insert the jumper again.

Fig. 9 – Ejecutamos la actualización / Execute update

Ahora quitamos el jumper de los pins (PGD Y PGC) y conectamos el Bus Pìrate, abrimos la terminal y nos debería salir la Fig. 9. Escribimos “yes” y el firmware se actualizará.

Now remove the jumper from the pins (PGD and GCP) and connect the Bus Pìrate back, open a terminal and write “yes” for the firmware update process to begin. (Fig. 9)

Fig. 10 – Ejecutamos Ds30 / Run Ds30

Para el siguiente paso ejecutamos el Ds30 Loader (antes tenemos que desconectar el Bus Pirate, volver a poner el jumper en los pins PGC y PGD y volver a conectar), debemos configurar la comunicación con el Bus Pirate (puerto COM) y le damos a “Hex-file” para seleccionar el fichero hex.

For the next step we need to execute the Ds30 Loader (before we must disconnect the Bus Pirate, put the jumper on pins PGC and PGD and connect again), we must configure the communication with the Bus Pirate (COM port) and we must click on “Hex-file” to select the hex file.

Fig. 11 – Seleccionamos el fichero hex / Select hex file

Seleccionamos el fichero BPv3-Firmware-v4.1.hex como vemos en la Fig. 11.

Select the file BPv3-firmware-v4.1.hex as you can see on Fig. 11.

Fig. 12 – Escribimos firmware v4 / Firmware writing

Ahora ya podemos actualizar el firmware a la versión 4, para ello seleccionamos “Download” como vemos en la Fig. 12.

Now we are ready to update the firmware to version 4, so just click “Download” as you can see on Fig. 12.

Fig. 13 – Actualización firmware v4.1 / Firmware v4.1 upgrade

Si todo está bien ya tenemos actualizado el Bus Pirate al firmware 4.1 y que a partir de ahora será más fácil de actualizar (no hará falta el jumper) ya que se podrá hacer desde la terminal. Como existe una versión más nueva del firmware (v5) vamos a seguir actualizando pero es necesario pasar por la v4 antes de la v5 si tenemos las v2 o v3 del firmware.

If everything is OK we have updated the Bus Pirate to firmware 4.1 and from now on it will be easier to upgrade (no need for the jumper anymore) as the upgrade can be done from the terminal directly. As there is a newer firmware version (v5) we will continue to update but it is necessary to pass through the v4 upgrade before the v5 if we have the v2 or v3 firmware.

Fig. 14 – Ejecutamos “$” en la terminal / Type “$” on the terminal

Como mencione anteriormente las actualizaciones son más sencillas, basta que ejecutemos en la terminal el comando “$” para activar el modo de actualización. Ver Fig. 14.

As previously mentioned the updates are simpler, just run the “$” command in the terminal to activate the update mode. See Fig. 14.

Fig. 15 – Seleccionamos el hex v5 / Select v5 hex

Volvemos a ejecutar el Ds30 Loader (sin necesidad de los jumpers) y seleccionamos la última versión del firmware. En mi caso he actualizado a la versión 5.10 disponible desde el 19 de noviembre.

Again run the Ds30 Loader (without the jumpers) and select the latest version of firmware. In my case I have updated to version 5.10 available since November 19.

Fig. 16 – Último firmware disponible (v5.10) / Latest firmware available (v5.10)

Ahora ya tenemos el último firmware disponible para el Bus Pirate. Momento de hackear :)

Realmente actualizar el Bus Pirate no es complicado pero requiere seguir los pasos y tener un jumper a mano o por lo menos otro material conductor. Y ahora para actualizar ya sabemos que sólo debemos seguir los pasos a partir de la Fig. 14 siempre y cuando tengamos como mínimo la versión 4 del firmware.

¿Tienes algún proyecto chulo con Bus Pirate?

Now we have the latest firmware available for the Bus Pirate. Time to hack :)

Actually updating the Bus Pirate is not complicated, but requires some steps and having a jumper at hand or at least another conductive material. And from now on to update we just follow the steps from Fig. 14 provided we have at least firmware version 4 or later installed.

Do you have some cool projects with Bus Pirate?

Enlaces / Links:

— Simon Roses Femerling

Posted in Hacking, Technology | Tagged , , | 7 Comments

Book Review: Getting Started With Arduino

Este libro corto y de fácil comprensión (se lee en menos de una hora) es una magnÍfica entrada al mundo de la electrónica, Arduino y Physical Computing. “Getting Started with Arduino” (IBSN 978-0-596-15551-3) está escrito por uno de los cofundadores de Arduino, Massimo Banzi, que nos introduce en el mundo de la electrónica con simples ejemplos.

This short and easy to understand book (read in less than an hour) is a magnificent introduction to the world of electronics, Arduino and Physical Computing. “Getting Started with Arduino” (IBSN 978-0-596-15551-3) is written by one of the co-founders of Arduino, Massimo Banzi, who introduces us into the world of electronics with simple examples.

Personalmente había leído otros libros sobre el tema antes que éste, pero desde luego para una persona que quiere empezar con Arduino éste es su libro. A lo largo de los 7 capítulos el autor nos lleva desde la instalación de Arduino (Windows y MacOS), la forma de pensar, detalla la plataforma Arduino y realiza diversos ejemplos utilizando LED, Pushbutton, Breadboard entre otros componentes.

I personally had read other books on the subject before but for someone who wants to get started with Arduino this is the book. Along the 7 chapters the author leads us from Arduino installation (Windows and MacOS), how to think about it, detailing the Arduino platform and performed several examples using LED, Pushbutton, Breadboard among other components.

Recomiendo este libro por varias razones:

  • Es fácil de leer ya que este pensado para personas sin conocimientos técnicos.
  • El autor es todo un experto.
  • Los ejemplos son prácticos y fáciles de seguir y en poco tiempo estarás creando gadgets que se conectan a Internet.

I recommend this book for several reasons:

  • It is easy to read because is designed for non-technical people.
  • The author is an expert.
  • Examples are practical and easy to follow and soon you’ll be creating gadgets that are connecting to the Internet.

Definitivamente una obra de obligatoria lectura para cualquier persona que quiera entender sobre Physical Computing, Arduino o de electrónica en general.

Puntación (1 rosa, muy malo / 5 rosas, muy bueno): 5 Rosas (Lectura Obligatoria)

Definitely a mandatory reading for any people who wants to understand Physical Computing, Arduino or electronics in general.

Score (1 pink, very bad / 5 roses, very good): 5 Roses (Mandatory Reading)

— Simon Roses Femerling

Posted in Books, Hacking, Technology | Tagged , , , | Leave a comment

Nessus Report Tricks

El escáner de vulnerabilidades Nessus es una potente herramienta para auditar sistemas aunque flojea en la generación de informes. En este post comentaré algunos trucos que utilizo para generar informes de forma rápida con la ayuda de Microsoft Excel 2007 o 2010 (Importante: esto sólo funciona con la versión Excel 2007 o superior).

Nessus vulnerability scanner is a powerful tool for auditing systems although is weak in reporting generation. In this post I will comment on some tricks I use to generate reports quickly with the help of Microsoft Excel 2007 or 2010 (Important: this only works with Excel 2007 or higher).

Una vez realizamos un escaneo mediante Nessus debemos guardar los resultados en formato XML para que podamos abrirlo con Excel.  Estos son los pasos:

Once we make a scan using Nessus we must save the results in XML format so that we can open it with Excel.  These are the steps:

1-     Abrimos Excel -> Fichero -> Abrir y seleccionar  el fichero XML.

1-     Open Excel -> File-> Open and select the XML file. 

2- Al seleccionar el fichero, Excel nos mostrará una ventana para preguntarnos en qué formato debe abrir el fichero, en nuestro caso seleccionamos la primera opción “como una tabla XML”.

2 – Select the file, Excel will show us a window to ask in which format should open the file and in our case we select the first option “As an XML table”.

 

3-Nos dará un error pero no pasa nada, le damos OK :)

3 – Excel will give us an error but no worries, just click OK :)

 

4- Ahora toca hacer limpieza de la tabla generada y esto va en función del gusto de cada uno. Yo suelo quitar las columnas (borrar) desde PolicyName hasta name5 (18 columnas, A-R) ya que no tiene nada de interés.

4- Now it is turn to make some cleaning in the generated table. I usually remove columns (delete) from PolicyName to name5 (18 columns, A-R) because it has nothing of interest to me at least.  

 

5- A  continuación le toca el turno a las filas, por lo que borro desde la fila 2 hasta la fila 250. Lo que sucede es que todas estas filas se quedan vacías al realizar el paso 4. A partir de la fila  251 viene el resultado de los sistemas escaneados.

5 – Then it is the turn to clean rows for which I delete rows from row 2 to row 250. What happens is that all these rows are empty when you perform step 4. At row 251 starts the result of the scan.

 

6- Al realizar los pasos 4 y 5 la información del escaneo queda a partir de la columna A, línea 2 y podemos empezar a trabajar en el informe :)

6 – Due to perform steps 4 and 5 now the scan information starts at from column A, row 2 and we can start working on the report :)

 

Este procedimiento tan simple nos salvara un montón de horas y agilizará la creación de los informes. Excel es una fantástica herramienta para analizar y filtrar información que podemos utilizar para nuestras auditorías.

This simple procedure saves us a lot of hours and speeds up the creation of reports. Excel is a fantastic tool to analyze and filter information that we can use for our audits.

Como he mencionado antes pueden existir otras columnas y filas que seguramente debamos borrar ya que no tienen datos de interés pero eso lo veremos con la práctica. Yo personalmente realizo más pasos que no detallo ;)

Tienes algún truco o herramienta para los informes de nessus?

As I mentioned earlier there may be other columns and rows that we should probably delete because it has no data of interest but we will decide that with practice. I personally do more steps that I’m not detailing ;)

Do you have other tricks or tools for nessus reports?

— Simon Roses Femerling

Posted in Pentest, Security | Tagged , | Leave a comment