ood evening, so finally i got db_autopwn working on my iphone 4S, and to make it easy for you, i made some updates to my script which it will install metasploit and mysql for you in few easy steps, first you need to install
from cydia, after that connect to your idevice via SSH, and start downloading script:
wget http://khalil_ounis.byethost4.com/msf_installer_v4.sh
Make it executable by:
chmod +x msf_installer_v4.sh
Executing the script
./msf_installer_v4.sh
and that's it, just reboot your idevice, and enjoy db_autopwn. and you can install mobileterminal from this tutorial.
NOTE:
* Do not update metasploit(svn update), because the new metasploit doesn't support mysql.

and this is script source:
#/bin/bash
# Author: Khalil Ounis
# Description: iDevice Metasploit Auto Installer Script Version 4
# Web Site: www.89geek.com
ROOT_UID=0
VARDIR=/private/var/
CURRDIR=`pwd`
E_NOERR=0
E_NODIR=1
E_CANTRESOLVE=4
E_NOTROOT=67
E_CMDNOTFOUND=127
clear
[ "$UID" != "$ROOT_UID" ] && {
echo "This script must be run as root";
exit $E_NOTROOT;
}
echo "Metasploit Installer Script V4 - By Khalil Ounis"
echo "For iDevices - www.89geek.com"
echo "Press any key to continue..."
read
echo -n "Removing some packages... "
aptitude -y remove ruby rubygems iconv mysql mysqltoggle &>/dev/null
[ $? -eq $E_CMDNOTFOUND ] && {
echo "aptitude not installed, use cydia to install it.";
echo "installation aborted.";
exit $E_CMDNOTFOUND;
}
echo "Done"
cd $VARDIR &> /dev/null
[ $? -eq $E_NODIR ] && {
echo "Can't access to $VARDIR, check your folder.";
exit $E_NODIR;
}
wget &>/dev/null
[ $? -eq $E_CMDNOTFOUND ] && {
echo "wget not installed. Installing wget";
aptitude -y wget &>/dev/null;
}
echo -n "Download lua_5.1.4-1_iphoneos-arm.deb... "
[ -f lua_5.1.4-1_iphoneos-arm.deb ] && rm lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download libpcap_1.1.1-4-1_iphoneos-arm.deb... "
[ -f libpcap_1.1.1-4-1_iphoneos-arm.deb ] && rm libpcap_1.1.1-4-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/libpcap_1.1.1-4-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download nmap_5.51-2-1_iphoneos-arm.deb... "
[ -f nmap_5.51-2-1_iphoneos-arm.deb ] && rm nmap_5.51-2-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/nmap_5.51-2-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download iconv_1.14-1_iphoneos-arm.deb... "
[ -f iconv_1.14-1_iphoneos-arm.deb ] && rm iconv_1.14-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/iconv_1.14-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download zlib_1.2.3-1_iphoneos-arm.deb... "
[ -f zlib_1.2.3-1_iphoneos-arm.deb ] && rm zlib_1.2.3-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/zlib_1.2.3-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download ruby_1.9.2-p180-1-1_iphoneos-arm.deb... "
[ -f ruby_1.9.2-p180-1-1_iphoneos-arm.deb ] && rm ruby_1.9.2-p180-1-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/ruby_1.9.2-p180-1-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download mysql_5.0.83-4-1_iphoneos-arm.deb... "
[ -f mysql_5.0.83-4-1_iphoneos-arm.deb ] && rm mysql_5.0.83-4-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/mysql_5.0.83-4-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download mysqltoggle_1.0-1-1_iphoneos-arm.deb... "
[ -f mysqltoggle_1.0-1-1_iphoneos-arm.deb ] && rm mysqltoggle_1.0-1-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/mysqltoggle_1.0-1-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download framework-3.5.2.tar.bz2... "
[ -f framework-3.5.2.tar.bz2 ] && rm framework-3.5.2.tar.bz2 &>/dev/null
wget http://downloads.metasploit.com/data/releases/archive/framework-3.5.2.tar.bz2 &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access metasploit server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Installing inetutils... "
aptitude -y install inetutils &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occured";
echo "installation aborted.";
exit $?;
}
echo "Done"
echo -n "Installing lua_5.1.4-1_iphoneos-arm.deb... "
dpkg -i lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Installing libpcap_1.1.1-4-1_iphoneos-arm.deb... "
dpkg -i libpcap_1.1.1-4-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Installing nmap_5.51-2-1_iphoneos-arm.deb... "
dpkg -i nmap_5.51-2-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Installing iconv_1.14-1_iphoneos-arm.deb... "
dpkg -i iconv_1.14-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Installing zlib_1.2.3-1_iphoneos-arm.deb... "
dpkg -i zlib_1.2.3-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Installing ruby_1.9.2-p180-1-1_iphoneos-arm.deb... "
dpkg -i ruby_1.9.2-p180-1-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Installing mysql_5.0.83-4-1_iphoneos-arm.deb and mysqltoggle_1.0-1-1_iphoneos-arm.deb... "
dpkg -i mysql* &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Decompressing framework-3.5.2.tar.bz2... "
tar -jxf framework-3.5.2.tar.bz2
[ $? -ne $E_NOERR ] && {
echo "Problem occurred while decompressing archive.";
echo "installation aborted";
exit 1;
}
echo "Done"
echo -n "Removing downlaoded files... "
rm framework-3.5.2.tar.bz2 ruby_1.9.2-p180-1-1_iphoneos-arm.deb iconv_1.14-1_iphoneos-arm.deb mysql_5.0.83-4-1_iphoneos-arm.deb mysqltoggle_1.0-1-1_iphoneos-arm.deb zlib_1.2.3-1_iphoneos-arm.deb libpcap_1.1.1-4-1_iphoneos-arm.deb nmap_5.51-2-1_iphoneos-arm.deb lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && echo "Can't remove downloaded files, step skipped!"
echo "Done"
echo -n "Creating Links... "
cd /bin
[ $? -eq $E_NODIR ] && {
echo "Can't access to bin directory";
echo "Failed";
} || {
ln -s /private/var/msf3/msfconsole ./msfconsole
ln -s /private/var/msf3/msfcli ./msfcli
echo "Done"
}
echo "Done... Metasploit Installed"
echo "Restart your iDevice."
cd $CURRDIR
exit 0
Good luck :)
UPDATE #1
Thanks to /root for making some updates to our script, you can use his script by downloading it from the above link:
wget http://khalil_ounis.byethost4.com/metasploit_installer_v4.2.sh
and this is the source code for this script:
# /bin/bash
# Author: Khalil Ounis
# Description: iDevice Metasploit Auto Installer Script Version 4.2
# Web Site: www.89geek.com / ihax4u.com
# For Kalil : I've realised why the framework didn't download, the link was broken... So I fixed that
# If I were you, I would add all the different framework versions for the users to choose from...
# Check out https://github.com/rapid7/metasploit-framework/wiki/Downloads-by-Version for links
# If you wanna contact me email @ andr920jhckrs@gmail.com
ROOT_UID=0
VARDIR=/private/var/
CURRDIR=`pwd`
E_NOERR=0
E_NODIR=1
E_CANTRESOLVE=4
E_NOTROOT=67
E_CMDNOTFOUND=127
E_NOTHING_CHOOSED=48
FW_V=0
MYSQL_DL=0
clear
[ "$UID" != "$ROOT_UID" ] && {
echo "This script must be run as root";
exit $E_NOTROOT;
}
echo "Metasploit Installer Script V4.2 - By Khalil Ounis and A.R"
echo "For iDevices - www.89geek.com"
echo "v4.2 -> updated by /root from ihax4u.com"
echo "Current version provides new choices to users : "
echo "2 versions of the Framework and MySQL is now an addon"
echo "I will be working on adding SET to this installer :)"
echo "As well as adding more frameworks to the list..."
echo "Press any key to continue..."
read
echo -n "Removing some packages... "
aptitude -y remove ruby rubygems iconv mysql mysqltoggle &>/dev/null
[ $? -eq $E_CMDNOTFOUND ] && {
echo "aptitude not installed, use cydia to install it.";
echo "installation aborted.";
exit $E_CMDNOTFOUND;
}
echo "Done"
cd $VARDIR &> /dev/null
[ $? -eq $E_NODIR ] && {
echo "Can't access to $VARDIR, check your folder.";
exit $E_NODIR;
}
wget &>/dev/null
[ $? -eq $E_CMDNOTFOUND ] && {
echo "wget not installed. Installing wget";
aptitude -y wget &>/dev/null;
}
echo -n "Download lua_5.1.4-1_iphoneos-arm.deb... "
[ -f lua_5.1.4-1_iphoneos-arm.deb ] && rm lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download libpcap_1.1.1-4-1_iphoneos-arm.deb... "
[ -f libpcap_1.1.1-4-1_iphoneos-arm.deb ] && rm libpcap_1.1.1-4-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/libpcap_1.1.1-4-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download nmap_5.51-2-1_iphoneos-arm.deb... "
[ -f nmap_5.51-2-1_iphoneos-arm.deb ] && rm nmap_5.51-2-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/nmap_5.51-2-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download iconv_1.14-1_iphoneos-arm.deb... "
[ -f iconv_1.14-1_iphoneos-arm.deb ] && rm iconv_1.14-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/iconv_1.14-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download zlib_1.2.3-1_iphoneos-arm.deb... "
[ -f zlib_1.2.3-1_iphoneos-arm.deb ] && rm zlib_1.2.3-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/zlib_1.2.3-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download ruby_1.9.2-p180-1-1_iphoneos-arm.deb... "
[ -f ruby_1.9.2-p180-1-1_iphoneos-arm.deb ] && rm ruby_1.9.2-p180-1-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/ruby_1.9.2-p180-1-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
if (("$FW_V" != "1")) || (("$FW_V" != "2")); then
echo -n "Download framework-X.X.X.tar.bz2... which one -> 3.5.2 (1)"
echo " or"
echo " latest but no mySQL support 4.3.0 (2)"
read FW_V
if [ $FW_V == "1" ]; then
[ -f framework-3.5.2.tar.bz2 ] && rm framework-3.5.2.tar.bz2 &>/dev/null
wget http://downloads.metasploit.com/data/releases/archive/framework-3.5.2.tar.bz2 &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
elif [ $FW_V == "2" ]; then
[ -f framework-4.3.0.tar.bz2 ] && rm framework-4.3.0.tar.bz2 &>/dev/null
wget http://downloads.metasploit.com/data/releases/archive/framework-4.3.0.tar.bz2 &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
else
echo "ERROR 48, nothing usable has been chosen by user"
echo "installation aborted"
exit $E_NOTHING_CHOOSED
fi
fi
echo "Done"
echo -n "Installing inetutils... "
aptitude -y install inetutils &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occured";
echo "installation aborted.";
exit $?;
}
echo "Done"
echo -n "Istalling lua_5.1.4-1_iphoneos-arm.deb... "
dpkg -i lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Istalling libpcap_1.1.1-4-1_iphoneos-arm.deb... "
dpkg -i libpcap_1.1.1-4-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Istalling nmap_5.51-2-1_iphoneos-arm.deb... "
dpkg -i nmap_5.51-2-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Istalling iconv_1.14-1_iphoneos-arm.deb... "
dpkg -i iconv_1.14-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Istalling zlib_1.2.3-1_iphoneos-arm.deb... "
dpkg -i zlib_1.2.3-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Istalling ruby_1.9.2-p180-1-1_iphoneos-arm.deb... "
dpkg -i ruby_1.9.2-p180-1-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
if (("$MYSQL_DL" != "1")) || (("$MYSQL_DL" != "2")); then
echo -n "DO YOU WANT TO INSTALL MySQL WITH IT'S SBStoogle?"
echo " YES (1) *if you have SBS and want v3.5.2* "
echo " NO (2) *IF no SBS or don't want it "
read MYSQL_DL
if [ $MYSQL_DL == "1" ]; then
echo -n "Download mysql_5.0.83-4-1_iphoneos-arm.deb... "
[ -f mysql_5.0.83-4-1_iphoneos-arm.deb ] && rm mysql_5.0.83-4-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/mysql_5.0.83-4-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download mysqltoggle_1.0-1-1_iphoneos-arm.deb... "
[ -f mysqltoggle_1.0-1-1_iphoneos-arm.deb ] && rm mysqltoggle_1.0-1-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/mysqltoggle_1.0-1-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Istalling mysql_5.0.83-4-1_iphoneos-arm.deb and mysqltoggle_1.0-1-1_iphoneos-arm.deb... "
dpkg -i mysql* &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
elif [ $MYSQL_DL == "2" ]; then
echo "You've decided not to install MySQL and it's SBStoogle"
else
echo "ERROR 48, nothing usable has been chosen by user"
echo "installation aborted"
exit $E_NOTHING_CHOOSED
fi
fi
if [ $FW_V == "1" ]; then
echo -n "Decompressing framework-3.5.2.tar.bz2... "
tar -jxf framework-3.5.2.tar.bz2
elif [ $FW_V == "2" ]; then
echo -n "Decompressing framework-4.3.0.tar.bz2... "
tar -jxf framework-4.3.0.tar.bz2
else
echo "ERROR"
fi
fi
[ $? -ne $E_NOERR ] && {
echo "Problem occurred while decompressing archive.";
echo "installation aborted";
exit 1;
}
echo "Done"
echo -n "Removing downloded files..."
cd $VARDIR &> /dev/null
rm framework-3.5.2.tar.bz2 framework-4.3.0.tar.bz2 ruby_1.9.2-p180-1-1_iphoneos-arm.deb iconv_1.14-1_iphoneos-arm.deb mysql_5.0.83-4-1_iphoneos-arm.deb mysqltoggle_1.0-1-1_iphoneos-arm.deb zlib_1.2.3-1_iphoneos-arm.deb libpcap_1.1.1-4-1_iphoneos-arm.deb nmap_5.51-2-1_iphoneos-arm.deb lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && echo "Can't remove downloaded files, step skipped!"
echo "Use iFile to manually delete the install packages in /private/var"
echo "Done"
echo -n "Creating Links... "
cd /bin
[ $? -eq $E_NODIR ] && {
echo "Can't access to bin directory";
echo "Failed";
} || {
ln -s /private/var/msf3/msfconsole ./msfconsole
ln -s /private/var/msf3/msfcli ./msfcli
echo "Done"
}
echo "Done... Metasploit Installed"
echo "Restart your iDevice."
echo -n " "
echo -n " "
echo -n " "
echo -n "If you had any errors with this custom updated script"
echo -n "contact me (/root). at andr920jhckrs@gmail.com"
echo -n " Or add my twitter -> root920 "
echo -n "Reboot your iDevice no now"
cd $CURRDIR
exit 0
UPDATE #2
A new version 4.4 by A.R (/root), Change Log:
*New MSF download link
*Choice between MSF v3.5.2 and v4.3.0
*MySQL is now an add-on
*Social Engineering Kit AutoInstaller v1.1
wget http://khalil_ounis.byethost4.com/metasploit_installer_v4.4.sh
and this is the source code for this script:
#/bin/bash
# Author: Khalil Ounis
# Description: iDevice Metasploit Auto Installer Script Version 4.4
# Web Site: www.89geek.com / ihax4u.com
# For Kalil : I've realised why the framework didn't download, the link was broken... So I fixed that
#If I were you, I would add all the different framework versions for the users to choose from...
#Check out https://github.com/rapid7/metasploit-framework/wiki/Downloads-by-Version for links
#If you wanna contact me email @ andr920jhckrs@gmail.com
ROOT_UID=0
VARDIR=/private/var/
CURRDIR=`pwd`
E_NOERR=0
E_NODIR=1
E_CANTRESOLVE=4
E_NOTROOT=67
E_CMDNOTFOUND=127
E_NOTHING_CHOOSED=48
FW_V=0
MYSQL_DL=0
SET_DL=0
clear
[ "$UID" != "$ROOT_UID" ] && {
echo "This script must be run as root";
exit $E_NOTROOT;
}
echo "Metasploit Installer Script V4.4 - By Khalil Ounis and A.R (/root)"
echo "For iDevices - www.89geek.com"
echo "v4.4 -> updated by /root from ihax4u.com"
echo " "
echo "By using this installer you agreed that I cannot be held responsible for any damage you cause to yourself"\
"or other while using the program that will be installed. Have Fun!"
echo "Press any key to continue..."
read
echo " "
echo "Change Log"
echo "v4.1 *FIX* New MSF download link"
echo " *NEW* Choice between MSF v3.5.2 and v4.3.0"
echo "v4.2 *NEW* MySQL is now an add-on"
echo "v4.3 *FIX* Cleaned up some of my stupid echo errors (-n)"
echo "v4.4 *NEW* Social Engineering Kit AutoInstaller v1.1"
echo "Press any key to continue..."
read
clear
echo -n "Removing some packages... "
aptitude -y remove ruby rubygems iconv mysql mysqltoggle subversion pyobjc &>/dev/null
[ $? -eq $E_CMDNOTFOUND ] && {
echo "aptitude not installed, use cydia to install it.";
echo "installation aborted.";
exit $E_CMDNOTFOUND;
}
echo "Done"
cd $VARDIR &> /dev/null
[ $? -eq $E_NODIR ] && {
echo "Can't access to $VARDIR, check your folder.";
exit $E_NODIR;
}
wget &>/dev/null
[ $? -eq $E_CMDNOTFOUND ] && {
echo "wget not installed. Installing wget";
aptitude -y wget &>/dev/null;
}
echo -n "Download lua_5.1.4-1_iphoneos-arm.deb... "
[ -f lua_5.1.4-1_iphoneos-arm.deb ] && rm lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download libpcap_1.1.1-4-1_iphoneos-arm.deb... "
[ -f libpcap_1.1.1-4-1_iphoneos-arm.deb ] && rm libpcap_1.1.1-4-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/libpcap_1.1.1-4-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download nmap_5.51-2-1_iphoneos-arm.deb... "
[ -f nmap_5.51-2-1_iphoneos-arm.deb ] && rm nmap_5.51-2-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/nmap_5.51-2-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download iconv_1.14-1_iphoneos-arm.deb... "
[ -f iconv_1.14-1_iphoneos-arm.deb ] && rm iconv_1.14-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/iconv_1.14-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download zlib_1.2.3-1_iphoneos-arm.deb... "
[ -f zlib_1.2.3-1_iphoneos-arm.deb ] && rm zlib_1.2.3-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/zlib_1.2.3-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download ruby_1.9.2-p180-1-1_iphoneos-arm.deb... "
[ -f ruby_1.9.2-p180-1-1_iphoneos-arm.deb ] && rm ruby_1.9.2-p180-1-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/ruby_1.9.2-p180-1-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
if (("$FW_V" != "1")) || (("$FW_V" != "2")); then
echo -n "Download framework-X.X.X.tar.bz2... which one -> 3.5.2 (1)"
echo " or"
echo " latest but no mySQL support 4.3.0 (2)"
read FW_V
if [ $FW_V == "1" ]; then
[ -f framework-3.5.2.tar.bz2 ] && rm framework-3.5.2.tar.bz2 &>/dev/null
wget http://downloads.metasploit.com/data/releases/archive/framework-3.5.2.tar.bz2 &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
elif [ $FW_V == "2" ]; then
[ -f framework-4.3.0.tar.bz2 ] && rm framework-4.3.0.tar.bz2 &>/dev/null
wget http://downloads.metasploit.com/data/releases/archive/framework-4.3.0.tar.bz2 &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
else
echo "ERROR 48, nothing usable has been chosen by user"
echo "installation aborted"
exit $E_NOTHING_CHOOSED
fi
fi
echo "Done"
echo -n "Installing inetutils... "
aptitude -y install inetutils &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occured";
echo "installation aborted.";
exit $?;
}
echo "Done"
echo -n "Istalling lua_5.1.4-1_iphoneos-arm.deb... "
dpkg -i lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Istalling libpcap_1.1.1-4-1_iphoneos-arm.deb... "
dpkg -i libpcap_1.1.1-4-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Istalling nmap_5.51-2-1_iphoneos-arm.deb... "
dpkg -i nmap_5.51-2-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Istalling iconv_1.14-1_iphoneos-arm.deb... "
dpkg -i iconv_1.14-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Istalling zlib_1.2.3-1_iphoneos-arm.deb... "
dpkg -i zlib_1.2.3-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
echo -n "Istalling ruby_1.9.2-p180-1-1_iphoneos-arm.deb... "
dpkg -i ruby_1.9.2-p180-1-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
if (("$MYSQL_DL" != "1")) || (("$MYSQL_DL" != "2")); then
echo "DO YOU WANT TO INSTALL MySQL WITH IT'S SBStoogle?"
echo " YES (1) *if you have SBS and want v3.5.2* "
echo " NO (2) *IF no SBS or don't want it "
read MYSQL_DL
if [ $MYSQL_DL == "1" ]; then
echo -n "Download mysql_5.0.83-4-1_iphoneos-arm.deb... "
[ -f mysql_5.0.83-4-1_iphoneos-arm.deb ] && rm mysql_5.0.83-4-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/mysql_5.0.83-4-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Download mysqltoggle_1.0-1-1_iphoneos-arm.deb... "
[ -f mysqltoggle_1.0-1-1_iphoneos-arm.deb ] && rm mysqltoggle_1.0-1-1_iphoneos-arm.deb &>/dev/null
wget http://ininjas.com/repo/debs/mysqltoggle_1.0-1-1_iphoneos-arm.deb &>/dev/null
[ $? -eq $E_CANTRESOLVE ] && {
echo "Can't access ininjas server, check your connection.";
echo "installation aborted";
exit $E_CANTRESOLVE;
}
echo "Done"
echo -n "Istalling mysql_5.0.83-4-1_iphoneos-arm.deb and mysqltoggle_1.0-1-1_iphoneos-arm.deb... "
dpkg -i mysql* &>/dev/null
[ $? -ne $E_NOERR ] && {
echo "Problem occurred, installation aborted";
exit $?;
}
echo "Done"
elif [ $MYSQL_DL == "2" ]; then
echo "You've decided not to install MySQL and it's SBStoogle"
else
echo "ERROR 48, nothing usable has been chosen by user"
echo "installation aborted"
exit $E_NOTHING_CHOOSED
fi
fi
if [ $FW_V == "1" ]; then
echo -n "Decompressing framework-3.5.2.tar.bz2... "
tar -jxf framework-3.5.2.tar.bz2
elif [ $FW_V == "2" ]; then
echo -n "Decompressing framework-4.3.0.tar.bz2... "
tar -jxf framework-4.3.0.tar.bz2
else
echo "ERROR, none of the packages exist"
echo "installation aborted";
exit 1;
fi
[ $? -ne $E_NOERR ] && {
echo "Problem occurred while decompressing archive.";
echo "installation aborted";
exit 1;
}
echo "Done"
echo -n "Removing downloded files..."
cd $VARDIR &> /dev/null
rm framework-3.5.2.tar.bz2 framework-4.3.0.tar.bz2 ruby_1.9.2-p180-1-1_iphoneos-arm.deb iconv_1.14-1_iphoneos-arm.deb mysql_5.0.83-4-1_iphoneos-arm.deb mysqltoggle_1.0-1-1_iphoneos-arm.deb zlib_1.2.3-1_iphoneos-arm.deb libpcap_1.1.1-4-1_iphoneos-arm.deb nmap_5.51-2-1_iphoneos-arm.deb lua_5.1.4-1_iphoneos-arm.deb &>/dev/null
[ $? -ne $E_NOERR ] && echo "Can't remove downloaded files, step skipped!"
echo "Use iFile to manually delete the install packages in /private/var"
echo "Done"
echo -n "Creating Links... "
cd /bin
[ $? -eq $E_NODIR ] && {
echo "Can't access to bin directory";
echo "Failed";
} || {
ln -s /private/var/msf3/msfconsole ./msfconsole
ln -s /private/var/msf3/msfcli ./msfcli
echo "Done"
}
echo "Done... Metasploit Installed"
echo " "
echo " "
echo " "
if (("$SET_DL" != "1")) || (("$SET_DL" != "2")); then
echo "Would you like to install Social Engineering Kit?"
echo " [yes(1)/no(2)] "
read SET_DL
if [ $SET_DL == "1" ]; then
echo "Social Engineering Toolkit AutoInstaller v1.1"
echo "Made by /root from ihax4u.com"
echo "Change Log"
echo "v1.1 *FIX* Fixed my echo mistakes..."
echo " *NEW* Failsafe added"
echo -n "Press any key to continue...".
read
clear
echo "Checking Dependencies....."
echo " "
echo -n "Installing PyObjC..."
aptitude install PyObjC &>/dev/null
echo " Done"
echo -n "Installing Subversion..."
aptitude install subversion &>/dev/null
echo " Done"
cd $VARDIR &> /dev/null
echo -n "installing Social Engineering Kit..."
svn co http://svn.secmaniac.com/social_engineering_toolkit set/ &>/dev/null
echo " Done"
echo "You must open set_config and change the path to metasploit to /private/var/msf3"
elif [ $SET_DL == "2" ]; then
echo "You've decided not to download SET"
else
echo "ERROR 48, nothing usable has been chosen by user"
echo "installation aborted"
exit $E_NOTHING_CHOOSED
fi
fi
echo "If you had any errors with this custom updated script"
echo "contact me (/root). at andr920jhckrs@gmail.com"
echo " Or add my twitter -> root920 "
echo "Metasploit successfully installed!"
echo "Reboot your iDevice now"
cd $CURRDIR
exit 0