10.09.2016 Views

Hacking_and_Penetration_Testing_with_Low_Power_Devices

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Starter set of tools<br />

91<br />

The company that produces Metasploit, Rapid7, provides Debian packages, but<br />

only for Intel architectures. To install Metasploit on an ARM system requires installing<br />

a compatible version of Ruby, downloading support libraries, <strong>and</strong> then retrieving<br />

the Metasploit code from github.com. Detailed instructions on how to install Metasploit<br />

can be found at https://github.com/rapid7/metasploit-framework/wiki/Setting-<br />

Up-a-Metasploit-Development-Environment. The following script will install<br />

Metasploit on an Ubuntu system regardless of architecture:<br />

#!/bin/bash<br />

# Script to install Metasploit<br />

#<br />

# Originally created by Dr. Phil Polstra<br />

# for the book<br />

# <strong>Hacking</strong> <strong>and</strong> <strong>Penetration</strong> <strong>Testing</strong> With <strong>Low</strong> <strong>Power</strong> <strong>Devices</strong><br />

# list of packages needed to install<br />

pkg_list¼"build-essential zlib1g zlib1g-dev libxml2 libxml2-dev\<br />

libxslt-dev locate libreadline6-dev libcurl4-openssl-dev git-core\<br />

libssl-dev libyaml-dev openssl autoconf libtool ncurses-dev bison\<br />

curl wget postgresql postgresql-contrib libpq-dev libapr1\<br />

libaprutil1 libsvn1 libpcap-dev"<br />

install_dpkg () {<br />

# Is it already installed?<br />

if (dpkg --list j awk '{print $2}' j egrep "^${pkg}\<br />

(:armhf)?$" 2>/dev/null) ;<br />

then<br />

echo "${pkg} already installed"<br />

else<br />

# try to install<br />

echo -n "Trying to install ${pkg} ..."<br />

if (apt-get -y install ${pkg} 2>/dev/null) ; then<br />

echo "succeeded"<br />

else<br />

echo "failed"<br />

fi<br />

fi<br />

}<br />

# first install support packages<br />

for pkg in $pkg_list<br />

do<br />

install_dpkg<br />

done

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!