Saturday, July 6, 2013

Djaweb DB120-WL Default Wireless Passphrase


It's really weird with 'Algerie Telecom' company, they supply their clients with a new wireless modem called SITEL model DB120-WL, the problem with this modem is the wireless passphrase by default is the MAC address, and the biggest problem is that most of people won't change the passphrase and some don't even know how to change it.


For who does not know what MAC address means, MAC(Hardware address) is short for Media Access Control, it's 48-bits(in our case) address associated with a network adapter and it's looks like 94:D7:23:67:89:FF, the first three 8bits(24bits) are OUI (Organizational Unique Identifier) it shows the company that manufactured the device which is in our case Shanghai DareGlobal Technologies Co., Ltd. Yes that the manufacture for our DJAWEB SITEL wireless modem, and this manufacture has many OUI, so far i found only two OUI(in my location), the first one 94:D7:23, and the second one is 80:A1:D7. And the last three 8bits(24bits) are specific to the device as sort of serial number.

So, what's wrong with the MAC address? can someone get your MAC address? absolutely and it doesn't require skills, for example, i have on my iphone a tweak that shows AP with their MAC address, and this is a picture of it:


What we have to do(passphrase of those modems are in capital letter) is we get the MAC address and then we remove colons from it, for example:

94:D7:23:1C:6B:1C passphrase: 94D7231C6B1C

And those modems SSIDs are begins with DJAWEB_ and the last 4 characters are the last 16bits of MAC address which are in our example 6B1C, the full SSID is DJAWEB_6B1C. Those are some SSIDs with their passphrase: 

DJAWEB_6B1C 94:D7:23:1C:6B:1C Passphrase: 94D7231C6B1C
DJAWEB_4F9C 94:D7:23:1C:4F:9C Passphrase: 94D7231C4F9C
DJAWEB_D9FC 94:D7:23:1C:D9:FC Passphrase: 94D7231CD9FC
DJAWEB_8E90 94:D7:23:1C:8E:90 Passphrase: 94D7231C8E90
DJAWEB_A90C 80:A1:D7:D8:A9:0C Passphrase: 80A1D7D8A90C
DJAWEB_44F8 80:A1:D7:D8:44:F8 Passphrase: 80A1D7D844F8
DJAWEB_81B8 80:A1:D7:D8:81:B8 Passphrase: 80A1D7D881B8
DJAWEB_B248 80:A1:D7:D8:B2:48 Passphrase: 80A1D7D8B248
DJAWEB_7158 80:A1:D7:E2:71:58 Passphrase: 80A1D7E27158
DJAWEB_5CC8 80:A1:D7:E2:5C:C8 Passphrase: 80A1D7E25CC8

Got it? the MAC address is divided into 3 parts, the first(red) part is the vendor id which is as we said before "Shanghai DareGlobal Technologies" for both 94:D7:23 and 80:A1:D7,  you may need to remember this if you don't want to use tools to get the MAC address. as you can see that we can get that last 16bits of the MAC address from the SSID(blue parts) so you only need to guess the second part(green) which is 255 odds (from 00 to FF), you can try them all if you have time :) SALAM
Read More ->>

Thursday, February 16, 2012

Mac OS X SL from OEM to RETAIL [GUIDE]


Yesterday, My friend wanted me to do a clean install of Snow Leopard on his iMac(he lost his SL DL-DVD), i was trying to get Snow Leopard(i downloaded it) boot from USB thumb drive with no success, tried verbose mode, and it stuck on loading Extensions.mkext(tried to do some changes to this file, still nothing), and i don't have time to download another image of Snow Leopard, so i decided to use my DL-DVD OEM Snow Leopard of my Macbook Pro, which it works only on my Macbook Pro because OEM are single license-only(if you tried it on another machine you will get "Mac OS X Snow Leopard cannot be installed on this copmuter"), i just need to do some changes to make it work.

It takes time to make modification work on DL-DVD, so i used 8GB USB thumb drive, restored Snow Leopard DL-DVD to USB thumb drive with Disk Utility.

After you get SL on your USB thumb drive, you need to modify OSInstall.mpkg file (which is located on Packages folder) with Flat Package Editor, and to get FPE you have to install XCODE, after that go to

/Developer/Applications/Utilities/PackageMaker.app/Contents

open Flat Package Editor, choose File->Open and open OSInstall.mpkg, you will see Distribution file, drag it to your Desktop(do not close Flat Package Editor, we still need it), and open it with your favorite text editor, Look for the Following:


<installation-check script="installCheckScript()"/>
<volume-check script="volCheckScript()"/>


they are on the line 50052 and 50053, remove installCheckScript() and volCheckScript(), and this is how they should be:


<installation-check script=""/>
<volume-check script=""/>


Save modification, and re-drag Distribution file to Flat Package Editor and go to File->Save, that's it, now you should have a working OEM Snow Leopard on any iMachine.
Read More ->>

Tuesday, February 7, 2012

Metasploit and MySQL on iDevice [MSF Installer Script][db_autopwn]

Good 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 aptitude and wget 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

Read More ->>

Saturday, January 21, 2012

Install C Compiler on iPhone 4S [GCC Installer Script]

Like MSF Installer Script, i made little update to GCC Installer Script, i tested it and it works well. And it works the same as MSF Installer Script, we need to download the script via wget, make it executable and execute it. So before you start, make sure you have wget and aptitude installed(install them from Cydia), and we need ssh connection to install the script(or if you have MobileTerminal, you can install it directly from there).

To use script, connect to your device via SSH, and download the script by the following:

wget http://khalil_ounis.byethost4.com/gcc_installer_v3.sh


Make it executable by:

chmod +x gcc_installer_v3.sh


Executing the script

./gcc_installer_v3.sh


And that's it, all you have to do now is compile your c program, and use the following command before you execute it:

ldid -S YourProgramName


and execute your c program:

./YourProgramName




Hope i helped :), this is source code of the script:

#!/bin/bash
# Author: Khalil Ounis (Algeria)
# Thnx to: www.syshalt.net
# Web Site: www.89geek.com

ROOT_UID=0
VARDIR=/private/var/
CURRDIR=`pwd`
E_NODIR=1
E_NOTROOT=67
E_CMDNOTFOUND=127

clear

[ "$UID" != "$ROOT_UID" ] && {
echo "This script must be run as root";
exit $E_NOTROOT;
}

echo "GCC Installer Script - By Khalil Ounis (www.89geek.com)"
echo "Thanks To www.syshalt.net for the instructions"
echo "Press any key to continue..."
read

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 -n "wget not installed. Installing wget... ";
aptitude -y wget &>/dev/null;
echo "Done"
}

echo -n "Download fake-libgcc_1.0_iphoneos-arm.deb... "
[ -f fake-libgcc_1.0_iphoneos-arm.deb ] && rm fake-libgcc_1.0_iphoneos-arm.deb &>/dev/null
wget http://www.syshalt.net/iphone/gcc-iphone/fake-libgcc_1.0_iphoneos-arm.deb &>/dev/null
echo "Done"

echo -n "Download sdk-2.0-headers.tar.gz... "
[ -f sdk-2.0-headers.tar.gz ] && rm sdk-2.0-headers.tar.gz &>/dev/null
wget http://www.syshalt.net/iphone/gcc-iphone/sdk-2.0-headers.tar.gz &>/dev/null
echo "Done"

echo -n "Download gcc_files.tar.gz... "
[ -f gcc_files.tar.gz ] && rm gcc_files.tar.gz &>/dev/null
wget http://www.syshalt.net/iphone/gcc-iphone/gcc_files.tar.gz &>/dev/null
echo "Done"

echo -n "Installing fake-libgcc_1.0_iphoneos-arm.deb... "
dpkg -i fake-libgcc_1.0_iphoneos-arm.deb &>/dev/null
echo "Done"

echo -n "Removing fake-libgcc_1.0_iphoneos-arm.deb... "
rm -rf fake-libgcc_1.0_iphoneos-arm.deb &>/dev/null
echo "Done"

echo -n "Installing iphone-gcc and ldid... "
aptitude -y install iphone-gcc ldid &>/dev/null
[ $? -eq $E_CMDNOTFOUND ] && {
echo "aptitude not installed, use cydia to install it.";
echo "installation aborted.";
exit $E_CMDNOTFOUND;
}

echo "Done"

echo -n "Decompressing sdk-2.0-headers.tar.gz... "
tar -xvzf sdk-2.0-headers.tar.gz &>/dev/null
[ $? -ne 0 ] && {
echo "Problem occurred while decompressing archive.";
echo "installation aborted";
exit 1;
}
echo "Done"

cd "include-2.0-sdk-ready-for-iphone"
cp -r * /usr/include
cd ..
rm -rf "sdk-2.0-headers.tar.gz" "include-2.0-sdk-ready-for-iphone"

echo -n "Decompressing gcc_files.tar.gz... "
tar -xvf gcc_files.tar.gz &>/dev/null
[ $? -ne 0 ] && {
echo "Problem occurred while decompressing archive.";
echo "installation aborted";
exit 1;
}
echo "Done"

echo -n "Just few steps... "
cd gcc_files
cp -r * /usr/lib
cd ..
rm -rf gcc_files.tar.gz gcc_files

echo "Done"

cd $CURRDIR
clear
echo "Done... GCC Installed"

exit 0


Good luck!

Read More ->>