
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.
- 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}”
- Reload BASH
. ~/.bashrc
- Update the system repos first:
sudo apt-get install update
- 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
- 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
- Build and install libplist
cd ~/usr/src/libplist./autogen.sh –prefix=”$HOME/usr”make && make install
- Build libusbmuxd
cd ~/usr/src/libusbmuxd./autogen.sh –prefix=”$HOME/usr”make && make install
- Build libimobiledevice
cd ~/usr/src/libimobiledevice./autogen.sh –prefix=”$HOME/usr”make && make install
- 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’.
- 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
- Start USB daemon.
~/usr/sbin/usbmuxd
- Connect the iPhone to the computer.
- Now attempt to mount using ifuse.
idevicepair pairifuse ~/usr/mnt/
- Check to see if you can see the filesystem on the iPhone.
cd ~/usr/mnt/ls -l
- Unmount and unpair when finished
fusermount -u ~/usr/mnt idevicepair unpair
Step 7 – Manual Test for Samsung Android
- Connect the Android device to the computer.
- Now attempt to mount the device.
jmtpfs ${HOME}/usr/sbin/usbmuxd
- Check if you can see the files on the device.
ls ~/usr/mnt
- 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.