JuiceJacking Demo Tech

This step by step guide sets up a Linux demo environment to show the value of using a DataBlock device when connecting your phone to an unknown or public USB port. This version of the build only caters for Apple iPhones.

Step 1 – Install Linux

Install your flavour of Linux. The guide was developed using an Ubuntu Desktop installation.

Step 2 – Set the environment variables

Set up your environment before building the modules required. This will build and install packages in the local user’s home directory at $HOME/usr.

  1. Add the following lines to the $HOME/.bashrc file:

[ ! -d “$HOME/usr/src” ] && mkdir -p “$HOME/usr/src”

export PKG_CONFIG_PATH=”${HOME}/usr/lib/pkgconfig:${PKG_CONFIG_PATH}”

export CPATH=”${HOME}/usr/include:${CPATH}”

 

export MANPATH=”${HOME}/usr/share/man:${MANPATH}”

 

export PATH=”${HOME}/usr/bin:${PATH}”

export LD_LIBRARY_PATH=”${HOME}/usr/lib:${LD_LIBRARY_PATH}”

  1. Reload BASH

. ~/.bashrc

  1. Update the system repos first:

sudo apt-get install update

  1. Get the GIT tools:

sudo apt-get install build-essential git

 

Step 3 – Install the required Linux Libraries

The following is one command, that runs over three lines, but must be run as one.

sudo apt-get install automake libtool pkg-config libplist-dev libplist++-dev python-dev libssl-dev libusb-1.0-0-dev libfuse-dev libmtp-common libmtp-runtime libmtp9 jmtpfs libimobiledevice-utils

Step 4 – Clone, build and install packages

  1. Clone the sources

mkdir -p ~/usr/srccd ~/usr/srcfor x in libplist libusbmuxd usbmuxd libimobiledevice ifuse; do git clone https://github.com/libimobiledevice/${x}.git; done

  1. Build and install libplist

cd ~/usr/src/libplist./autogen.sh –prefix=”$HOME/usr”make && make install

  1. Build libusbmuxd

cd ~/usr/src/libusbmuxd./autogen.sh –prefix=”$HOME/usr”make && make install

  1. Build libimobiledevice

cd ~/usr/src/libimobiledevice./autogen.sh –prefix=”$HOME/usr”make && make install

  1. Build usbmuxd

cd ~/usr/src/usbmuxd./autogen.sh –prefix=”$HOME/usr”make && sudo make install

 

NOTE: ‘sudo make install’ is required because it needs to write to ‘/lib/udev/rules.d’ and ‘/lib/systemd/system’.

  1. Build ifuse

cd ~/usr/src/ifuse./autogen.sh –prefix=”$HOME/usr”make && make install

Step 5 – Create a mount point.

mkdir -p ~/usr/mnt

Step 6 – Manual Test for iPhone

  1. Start USB daemon.

~/usr/sbin/usbmuxd

  1. Connect the iPhone to the computer.
  2. Now attempt to mount using ifuse.

idevicepair pairifuse ~/usr/mnt/

  1. Check to see if you can see the filesystem on the iPhone.

cd ~/usr/mnt/ls -l

  1. Unmount and unpair when finished

fusermount -u ~/usr/mnt        idevicepair unpair

Step 7 – Manual Test for Samsung Android

  1. Connect the Android device to the computer.
  2. Now attempt to mount the device.

jmtpfs ${HOME}/usr/sbin/usbmuxd

  1. Check if you can see the files on the device.

ls ~/usr/mnt

  1. Unmount the device

fuser ~/usr/mnt

Bash Shell Scripts

Demo Script

This is the demo script. If it is an iPhone, it copies the first 5 picture from the device to a directory called pics on the Desktop. If it is an Android device, it copies the DataBlock logo to the Gallery on the device.

Leave a Reply

Your email address will not be published. Required fields are marked *