SHARE
TWEET

weaponizen900.sh

zitstif Nov 25th, 2012 753 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # $Id: weaponizen900.sh 11/24/2012
  3. # email: zitstif[@]gmail.com
  4. # website: http://zitstif.no-ip.org/
  5. # name: Kyle Young
  6. # Bash shell script for weaponizing the Nokia N900
  7.  
  8.  
  9. ###Banner/Intro Seciton###
  10.  
  11. clear;
  12. echo "||=====================================================||";
  13. echo "||Program name:----weaponizen900.sh---------\----------||";
  14. echo "||Author website:--zitstif.no-ip.org---------|---------||";
  15. echo "||__________________________________________/__________||";
  16. echo '[!]NOTE: USING THIS PROGRAM MAY REQUIRE YOU TO REFLASH[!]';
  17. echo '[!]YOUR N900. THIS SOFTWARE IS PROVIDED "AS IS", WITH [!]';
  18. echo '[!]OUT WARRANTY OF ANY KIND! I AM NOT RESPONSIBLE IF  [!]';
  19. echo '[!]THIS PROGRAM DAMAGES YOUR PHONE! USE WITH CAUTION! [!]';
  20. echo '||_____________________________________________________||';
  21. echo "[?]Would you like to continue? (y|n)------------------[?]";
  22. read -p "Response: " response;
  23.  
  24. if ! echo ${response} | grep -E "(Y|y).*" &> /dev/null;
  25.  then
  26.    echo "[!]exiting now..[!]";
  27.    exit 1;
  28. fi
  29.  
  30. PresentDir="$(pwd)"
  31.  
  32. if [ -e /etc/weaponized ];
  33.  then
  34.    if cat /etc/weaponized | grep 75eea509c19cc66576a1bdea893834f8291c2d96 &> /dev/null;
  35.     then
  36.       echo '[!]It appears that this n900 has already been weaponized![!]';
  37.       echo '[?]Are you sure you want to continue?[?]';
  38.       read -p "Response: " response;
  39.       if ! echo ${response} | grep -E "(Y|y).*" &> /dev/null;
  40.        then
  41.          echo "[!]exiting now..[1]";
  42.          exit 1;
  43.       fi
  44.    fi
  45. fi
  46.  
  47.  
  48. ###End of Banner/Intro Section###
  49.  
  50. #Initial tests#
  51.  
  52.  
  53. if [ -e listweapons.sh ]
  54.  then
  55.    if [ ! $(sha1sum listweapons.sh | awk '{print $1}') == "42dc8b7e3cd62605328f2c1a24ef59bbb2a10788" ]
  56.     then
  57.       echo '[!]listweapons.sh sha1sum not correct![!]';
  58.       echo '[!]File may have been tampered with![!]';
  59.       exit 1;
  60.    fi
  61.  else
  62.    echo '[!]listweapons.sh does not exist![!]';
  63.    echo '[!]Exiting...[!]';
  64.    exit 1;
  65. fi
  66.  
  67. if [ -e update.sh ]
  68.  then
  69.    if [ ! $(sha1sum update.sh | awk '{print $1}') == "a6254b0b7b7097c2d79f15db6eb7a12f338ff406" ]
  70.     then
  71.       echo '[!]update.sh sha1sum not correct![!]';
  72.       echo '[!]File may have been tampered with![!]';
  73.       exit 1;
  74.    fi
  75.  else
  76.    echo '[!]update.sh does not exist![!]';
  77.    echo '[!]Exiting...[!]';
  78.    exit 1;
  79. fi
  80.  
  81. if [[ ${USER} != "root" ]]
  82.  then
  83.    echo "[!]I need to be root..[!]";
  84.    echo "[I]Make sure you have bash installed and rootsh installed.[I]";
  85.    exit 2;
  86. fi
  87.  
  88. if ! ls /bin/bash &> /dev/null;
  89.  then
  90.    echo "[!]Please make sure you have bash installed..[!]";
  91.    echo "[!]/bin/bash does not appear to exist![!]";
  92.    echo "[!]You may need to make a symlink!";
  93.    exit 2;
  94. fi
  95.  
  96.  
  97. UseModem="false";
  98.  
  99. if ifconfig -a | grep gprs0 &> /dev/null;
  100.  then
  101.    if [ "$(ifconfig gprs0 | awk '/inet addr:/{print $2}' | cut -f2 -d:)" ]
  102.     then
  103.       if [ -n "$(ifconfig gprs0 | awk '/inet addr:/{print $2}' | cut -f2 -d:)" ]
  104.        then
  105.          echo "[!]It appears you're connected through your local mobile provider![!]";
  106.          echo "[!]I strongly recommend you use a local secure wireless network![!]";
  107.          echo "[!](With strong signal strength.)[!]"
  108.          echo "[?]Would you like to continue?[?]"
  109.          read -p "Response: " response;
  110.          if ! echo ${response} | grep -E "(Y|y).*" &> /dev/null;
  111.           then
  112.             echo "[!]exiting now..[!]";
  113.             exit 1;
  114.           else
  115.             UseModem="true";
  116.          fi
  117.       fi
  118.    fi
  119. fi
  120.  
  121.  
  122.  
  123. #kill cell phone modem?
  124. if [ "${UseModem}" == "false" ]
  125.  then
  126.    echo "[?]Would you like to kill your cell phone modem temporarily for this install?(Y|n)[?]";
  127.    read -p "Response: " response;
  128.    if echo ${response} | grep -E "(Y|y).*" &> /dev/null;
  129.     then
  130.       echo "[I]Stopping modem...[I]";
  131.       initctl stop sscd
  132.    fi
  133. fi
  134. #initctl start sscd #later?
  135.  
  136.  
  137. if [ "$(cat /usr/sbin/gainroot | fgrep ash_history | awk '{print $2}')" == "/bin/sh" ];
  138.  then
  139.    echo "[I]Changing gainroot default login shell to bash[I]";
  140.    cp /usr/sbin/gainroot /usr/sbin/gainroot.bk;
  141.    cat /usr/sbin/gainroot.bk | sed 's/.ash_history \/bin\/sh/.ash_history \/bin\/bash/g' > /usr/sbin/gainroot;
  142.    chmod a+x /usr/sbin/gainroot;  
  143. fi
  144.  
  145.  
  146. ping -c 1 www.google.com &> /dev/null;
  147.  
  148. if [ $? -ne 0 ]
  149.  then
  150.    echo "[!]It doesn't look like you're connected to the internet!![!]";
  151.    echo "[!]For weaponizen900.sh to work, you need to be connected to the internet..[!]";
  152.    exit 2;
  153.  else
  154.    var=$(ping www.google.com -c 1 | awk '/time=/{print $7}' | cut -f2 -d= | sed 's/\..*//g')
  155.    if [ ${var} -gt 120 ]
  156.     then
  157.       echo "[!]The latency on this network doesn't appear to be good![!]"
  158.       echo "[?]Would you like to continue?[?]"
  159.       read -p "Response: " response;
  160.       if ! echo ${response} | grep -E "(Y|y).*" &> /dev/null;
  161.        then
  162.          echo "[!]exiting now..[!]";
  163.          exit 1;
  164.       fi
  165.     fi
  166. fi
  167.  
  168. ####End of initial tests########
  169.  
  170. #####Repo edit#####
  171.  
  172. echo "[I]Backing up hildon-application-manager.list..[I]";
  173.  
  174. cp /etc/apt/sources.list.d/hildon-application-manager.list /etc/apt/sources.list.d/hildon-application-manager.list.bk;
  175.  
  176. echo "[I]Adding additional repositories if needed...[I]";
  177.  
  178. if ! grep "repository.maemo.org" /etc/apt/sources.list.d/hildon-application-manager.list | grep extras-testing &> /dev/null;
  179.  then
  180.    echo "deb http://repository.maemo.org/extras-testing/ fremantle free non-free" >> /etc/apt/sources.list.d/hildon-application-manager.list;
  181. fi
  182.  
  183. if ! grep "repository.maemo.org" /etc/apt/sources.list.d/hildon-application-manager.list | grep extras-devel &> /dev/null;
  184.  then
  185.    echo "deb http://repository.maemo.org/extras-devel/ fremantle free non-free" >> /etc/apt/sources.list.d/hildon-application-manager.list;
  186. fi
  187.  
  188. if ! grep "my-maemo.com" /etc/apt/sources.list.d/hildon-application-manager.list | grep repository &> /dev/null;
  189.  then
  190.    echo "deb http://my-maemo.com/repository/ fremantle user" >> /etc/apt/sources.list.d/hildon-application-manager.list;
  191. fi
  192.  
  193. if ! grep "downloads.maemo.nokia.com" /etc/apt/sources.list.d/hildon-application-manager.list &> /dev/null;
  194.  then
  195.    echo "deb https://downloads.maemo.nokia.com/fremantle/ovi/ ./" >> /etc/apt/sources.list.d/hildon-application-manager.list;
  196. fi
  197.  
  198. if ! grep "repository.maemo.org" /etc/apt/sources.list.d/hildon-application-manager.list | grep tools &> /dev/null;
  199.  then
  200.    echo "deb http://repository.maemo.org fremantle/tools free non-free" >> /etc/apt/sources.list.d/hildon-application-manager.list;
  201. fi
  202.  
  203. if ! grep "repository.maemo.org" /etc/apt/sources.list.d/hildon-application-manager.list | grep "deb-src" &> /dev/null;
  204.  then
  205.    echo "deb-src http://repository.maemo.org fremantle/tools free non-free" >> /etc/apt/sources.list.d/hildon-appliccation-manager.list;
  206. fi
  207.  
  208. echo "[I]Running apt-get update...[I]";
  209.  
  210. apt-get update;
  211.  
  212. echo "[I]Running apt-get update again for safe measures..[I]";
  213.  
  214. apt-get update;
  215.  
  216. if [ $? -ne 0 ]
  217.  then
  218.    echo "[!]There was a problem with apt-get update...[!]";
  219.    echo "[?]Shall we move on anyways? (Y|N) [?]"
  220.    read response;
  221.    if ! echo ${response} | grep -E "(Y|y).*" &> /dev/null;
  222.     then
  223.       echo "[!]Exiting...[!]";
  224.       exit 3;
  225.    fi
  226. fi
  227.  
  228. if dpkg --list | grep cherry &> /dev/null;
  229.  then
  230.    echo "[I]Let me do you a favor and remove cherry...[I]";
  231.    apt-get remove cherry -y
  232. fi
  233.  
  234. if ! dpkg --list | grep notmynokia &> /dev/null;
  235.  then
  236.    apt-get install notmynokia -y;
  237. fi
  238.  
  239.  
  240.  
  241. #####End of RepoEdit##
  242.  
  243. ####Create Directories and symlinks due to rootfs limited size..###
  244.  
  245. #http://wiki.maemo.org/Free_up_rootfs_space#
  246.  
  247. echo "[I]Attempting to free up rootfs space...[I]";
  248.  
  249. docpurge;
  250.  
  251. apt-get clean;
  252.  
  253. apt-get autoremove -y;
  254.  
  255. if [ ! -d /home/user/MyDocs/apt-archive-cache ]
  256.  then
  257.    echo "[I]Adjusting apt cache directory location...[I]";
  258.    mkdir /home/user/MyDocs/apt-archive-cache;
  259.    mkdir /home/user/MyDocs/apt-archive-cache/partial;
  260.    if ! grep "Dir::Cache" /etc/apt/apt.conf.d/00maemo;
  261.     then
  262.       echo "[I]Backing up the 00maemo config file..[I]";
  263.       cp /etc/apt/apt.conf.d/00maemo /etc/apt/apt.conf.d/00maemo.bk;
  264.       echo 'Dir::Cache::archives "/home/user/MyDocs/apt-archive-cache";' >> /etc/apt/apt.conf.d/00maemo;
  265.    fi
  266. fi
  267.  
  268. apt-get install pymaemo-optify -y;
  269.  
  270. if [ ! -d /home/opt/nokia-maps ]
  271.  then
  272.    echo "[I]moving nokia maps to /home/opt..[I]";
  273.    mv /usr/share/nokia-maps /home/opt/;
  274.    ln -s /home/opt/nokia-maps /usr/share/nokia-maps;
  275. fi
  276.  
  277. if [ ! -d /home/opt/microb-engine ]
  278.  then
  279.    echo "[I]Moving microb-engine to /home/opt...[I]";
  280.    mv /usr/share/microb-engine /home/opt;
  281.    ln -s /home/opt/microb-engine /usr/share/microb-engine;
  282. fi
  283.  
  284. #####End of rootfs related section####
  285.  
  286. #####Installing additional tools that are needed#####
  287.  
  288. echo "[I]Installing scripting languages and other useful tools needed..[I]";
  289.  
  290. apt-get install wine kbvpn-client cadaver zip gpscorrelate-gui exiv2 exif python-httplib2 python2.5-libxml2 \
  291.  python-simplejson python-pycurl python2.5-dev gcc-4.6 file man git-core wget tar-gnu \
  292.  grep-gnu perl ruby1.8 sed-gnu nano-opt openssl python2.5 vim subversion less bzip2 busybox-power libaprutil1=1.3.9-2 libapr1=1.4.2-1 --force-yes -y;
  293.  
  294.  
  295. if [ $? -ne 0 ];
  296.  then
  297.    echo "[!]There was a problem installing the languages and other useful tools needed..[!]";
  298.    echo "[!]Please read the error message from apt to try to troubleshoot the issue..[!]";
  299.    exit 3;
  300. fi
  301.  
  302. apt-get clean;
  303. apt-get autoclean -y;
  304.  
  305. if [ ! -e /usr/bin/gcc ];
  306.  then
  307.    ln -s /usr/bin/gcc-4.6 /usr/bin/gcc;
  308. fi
  309.  
  310.  
  311. echo "[I]Installing tools that can be found on sectools.org list..[I]"
  312.  
  313. apt-get install sshfs openssh-server fping lynx hexedit minicom privoxy qtwol tsocks proxytunnel \
  314.  tor bluez-hcidump iodine cowpatty geoip-database stunnel4 cleven reaver maegios curl dsniff \
  315.  gnupg truecrypt macchanger vncviewer hideuseragent recovery-tools socat nmap=5.50-2 rdesktop \
  316.  wireshark aircrack-ng netcat tcpdump john kismet openssh-client python-scapy telnet dig tcptraceroute mtr-tiny whois miredo-server miredo easy-deb-chroot --force-yes -y;
  317.  
  318.  
  319. if [ $? -ne 0 ]
  320.  then
  321.    echo "[!] There was a problem installing tools found on seclist.org...[!]";
  322.    echo "[!]Please read the error message from apt to try to troubleshoot the issue..[!]";
  323.    exit 3;
  324. fi
  325.  
  326. if [ ! -e /usr/bin/fping ]
  327.  then
  328.    ln -s /usr/local/sbin/fping /usr/bin/fping;
  329. fi
  330.  
  331. echo "[I]Creating /home/user/MyDocs/.weaponize for certain packages[I]";
  332.  
  333. if [ ! -d /home/user/MyDocs/.weaponize ];
  334.  then
  335.    mkdir /home/user/MyDocs/.weaponize;
  336.  else
  337.    echo "[I]/home/user/MyDocs/.weaponize exists already..[I]";
  338. fi
  339.  
  340. echo "[I]Creating /home/user/MyDocs/.weaponize/scripts[I]";
  341.  
  342. if [ ! -d /home/user/MyDocs/.weaponize/scripts ];
  343.  then
  344.    mkdir /home/user/MyDocs/.weaponize/scripts/;
  345. fi
  346.  
  347. #Download tools like nito... bozocrack(hash tool)
  348.  
  349. if [ ! -d /home/user/MyDocs/.weaponize/scripts/BozoCrack/ ];
  350.  then
  351.   echo "[I]Downloading bozocrack...[I]";
  352.   mkdir /home/user/MyDocs/.weaponize/scripts/BozoCrack;
  353.   git clone git://github.com/juuso/BozoCrack.git /home/user/MyDocs/.weaponize/scripts/BozoCrack;
  354.   if [ ! -e /usr/bin/bozocrack ];
  355.    then
  356.      echo 'ruby /home/user/MyDocs/.weaponize/scripts/Bozocrack/bozocrack.rb $@' > /usr/bin/bozocrack;
  357.      chmod a+x /usr/bin/bozocrack;
  358.   fi
  359. fi
  360.  
  361. if [ ! -e /usr/bin/BozoCrackUpdate ];
  362.  then
  363.   echo 'cd /home/user/MyDocs/.weaponize/scripts/Bozocrack/ && git pull && cd -' > /usr/bin/BozoCrackUpdate;
  364.   chmod a+x /usr/bin/BozoCrackUpdate;
  365. fi
  366.  
  367.  
  368.  
  369. if [ ! -d /home/user/MyDocs/.weaponize/scripts/nikto ];
  370.  then
  371.    echo "[I]Downloading nikto...[I]";
  372.    mkdir /home/user/MyDocs/.weaponize/scripts/nikto/;
  373.    git clone git://anonscm.debian.org/collab-maint/nikto.git /home/user/MyDocs/.weaponize/scripts/nikto/;
  374.    if [ ! -e /usr/bin/nikto ];
  375.     then
  376.       echo 'perl /home/user/MyDocs/.weaponize/scripts/nikto/./nikto.pl -config /home/user/MyDocs/.weaponize/scripts/nikto/nikto.conf $@' > /usr/bin/nikto;
  377.       chmod a+x /usr/bin/nikto;
  378.    fi
  379. fi
  380.  
  381. if [ ! -e /usr/bin/niktoUpdate ]
  382.  then
  383.    echo 'cd /home/user/MyDocs/.weaponize/scripts/nikto/ && git pull && cd -' > /usr/bin/niktoUpdate;
  384.    chmod a+x /usr/bin/niktoUpdate;
  385. fi
  386.  
  387. if [ ! -d /home/user/MyDocs/.weaponize/scripts/theHarvester ];
  388.  then
  389.    echo "[I]Downloading theHarvester...[I]";
  390.    cd /home/user/MyDocs/.weaponize/scripts/ && wget http://theharvester.googlecode.com/files/theHarvester-2.2.tar;
  391.    tar -xvf theHarvester*.tar;
  392.    if [ $? -ne 0 ];
  393.     then
  394.       echo "[!]There was a problem downloading theHarvester...[!]";
  395.       exit 4;
  396.    fi
  397. fi
  398.  
  399. if [ ! -e /usr/bin/theHarvester ];
  400.  then
  401.    echo 'python /home/user/MyDocs/.weaponize/scripts/theHarvester/theHarvester.py $@' > /usr/bin/theHarvester;
  402.    chmod a+x /usr/bin/theHarvester;
  403. fi  
  404.  
  405.  
  406. if [ ! -d /home/user/MyDocs/.weaponize/scripts/findmyhash ];
  407.  then
  408.    echo "[I]Downloading findmyhash..[I]";
  409.    mkdir /home/user/MyDocs/.weaponize/scripts/findmyhash
  410.    svn checkout http://findmyhash.googlecode.com/svn/trunk/ /home/user/MyDocs/.weaponize/scripts/findmyhash;
  411.    if [ $? -ne 0 ];
  412.     then
  413.       echo "[!]There was a problem downloading findmyhash..[!]";
  414.       exit 4;
  415.    fi
  416. fi
  417.  
  418. if [ ! -e /usr/bin/findmyhash ];
  419.  then
  420.    echo 'python /home/user/MyDocs/.weaponize/scripts/findmyhash/findmyhash.py $@' > /usr/bin/findmyhash;
  421.    chmod a+x /usr/bin/findmyhash;
  422. fi
  423.  
  424. if [ ! -e /usr/bin/findmyhashUpdate ];
  425.  then
  426.    echo 'cd /home/user/MyDocs/.weaponize/scripts/findmyhash/ && svn update && cd -' > /usr/bin/findmyhashUpdate;
  427.    chmod a+x /usr/bin/findmyhashUpdate;
  428. fi
  429.  
  430.  
  431. if [ ! -d /home/user/MyDocs/.weaponize/scripts/wapiti ];
  432.  then
  433.    echo "[I]Downloading wapiti..[I]";
  434.    mkdir /home/user/MyDocs/.weaponize/scripts/wapiti;
  435.    svn co http://wapiti.svn.sourceforge.net/svnroot/wapiti /home/user/MyDocs/.weaponize/scripts/wapiti;
  436.    if [ $? -ne 0 ];
  437.     then
  438.       echo "[!]There was a problem downloading wapiti..[!]";
  439.       exit 4;
  440.    fi
  441. fi
  442.  
  443. if [ ! -e /usr/bin/wapiti ];
  444.  then
  445.    echo 'python /home/user/MyDocs/.weaponize/scripts/wapiti/trunk/src/wapiti.py $@' > /usr/bin/wapiti;
  446.    chmod a+x /usr/bin/wapiti;
  447. fi
  448.  
  449. if [ ! -e /usr/bin/wapitiUpdate ];
  450.  then
  451.    echo 'cd /home/user/MyDocs/.weaponize/scripts/wapiti/ && svn update && cd -' > /usr/bin/wapitiUpdate;
  452.    chmod a+x /usr/bin/wapitiUpdate;
  453. fi
  454.  
  455. #svn checkout http://waffit.googlecode.com/svn/trunk/ waffit-read-only
  456.  
  457. if [ ! -d /home/user/MyDocs/.weaponize/scripts/waffit/ ]
  458.  then
  459.    echo "[I]Downloading waffit..[I]";
  460.    mkdir /home/user/MyDocs/.weaponize/scripts/waffit/
  461.    svn checkout http://waffit.googlecode.com/svn/trunk/ /home/user/MyDocs/.weaponize/scripts/waffit/;
  462.    if [ $? -ne 0 ];
  463.     then
  464.       echo "[!]There was a problem downloading waffit (wafw00f)..[!]";
  465.       exit 4;
  466.    fi
  467. fi
  468.  
  469. if [ ! -e /usr/bin/wafw00f ];
  470.  then
  471.    echo 'python /home/user/MyDocs/.weaponize/scripts/waffit/wafw00f.py $@' > /usr/bin/wafw00f;
  472.    chmod a+x /usr/bin/wafw00f;
  473. fi
  474.  
  475. if [ ! -e /usr/bin/wafw00fUpdate ];
  476.  then
  477.   echo 'cd /home/user/MyDocs/.weaponize/scripts/waffit/ && svn update && cd -' > /usr/bin/wafw00fUpdate;
  478.   chmod a+x /usr/bin/wafw00fUpdate;
  479. fi
  480.  
  481. if [ ! -d /home/user/MyDocs/.weaponize/scripts/exiftool ];
  482.  then
  483.    echo "[I]Downloading exiftool..[I]";
  484.    mkdir /home/user/MyDocs/.weaponize/scripts/exiftool && cd /home/user/MyDocs/.weaponize/scripts/exiftool;
  485.    wget http://owl.phy.queensu.ca/~phil/exiftool/Image-ExifTool-9.00.tar.gz;
  486.    tar -xvzf *.tar.gz;
  487.    if [ $? -ne 0 ];
  488.     then
  489.       echo "[!]There was a problem downloading exiftool..[!]";
  490.       exit 4;
  491.    fi
  492.    rm /home/user/MyDocs/.weaponize/scripts/exiftool/Image-ExifTool-9.00.tar.gz;
  493. fi
  494.  
  495. if [ ! -e /usr/bin/exiftool ];
  496.  then
  497.    echo 'perl /home/user/MyDocs/.weaponize/scripts/exiftool/Image-ExifTool-9.00/exiftool $@' > /usr/bin/exiftool;
  498.    chmod a+x /usr/bin/exiftool;
  499. fi
  500.  
  501. if [ ! -d /home/user/MyDocs/.weaponize/scripts/RVT ];
  502.  then
  503.    echo "[I]Downloading a few RVT tools..[I]";
  504.    mkdir /home/user/MyDocs/.weaponize/scripts/RVT;
  505.    cd /home/user/MyDocs/.weaponize/scripts/RVT
  506.    wget http://revealertoolkit.googlecode.com/svn/tags/RVT_v0.2.1/tools/dumplnk.pl;
  507.    wget http://revealertoolkit.googlecode.com/svn-history/r90/trunk/tools/evtparse.pl;
  508.    wget http://revealertoolkit.googlecode.com/svn-history/r91/tags/RVT_v0.2.1/tools/evtrpt.pl;
  509.    if [ $? -ne 0 ];
  510.     then
  511.       echo "[!]There was a problem downloading some RVT tools..[!]";
  512.       exit 4;
  513.    fi
  514. fi
  515.  
  516. if [ ! -e /usr/bin/dumplnk ];
  517.  then
  518.    echo 'perl /home/user/MyDocs/.weaponize/scripts/RVT/dumplnk.pl $@' > /usr/bin/dumplnk;
  519.    chmod a+x /usr/bin/dumplnk
  520. fi
  521.  
  522. if [ ! -e /usr/bin/evtparse ];
  523.  then
  524.    echo 'perl /home/user/MyDocs/.weaponize/scripts/RVT/evtparse.pl $@' > /usr/bin/evtparse;
  525.    chmod a+x /usr/bin/evtparse;
  526. fi
  527.  
  528. if [ ! -e /usr/bin/evtrpt ];
  529.  then
  530.    echo 'perl /home/user/MyDocs/.weaponize/scripts/RVT/evtrpt.pl $@' > /usr/bin/evtrpt;
  531.    chmod a+x /usr/bin/evtrpt;
  532. fi
  533.  
  534.  
  535. if [ ! -d /home/user/MyDocs/.weaponize/scripts/mork/ ];
  536.  then
  537.    echo "[I]Downloading mork.pl...[I]";
  538.    mkdir /home/user/MyDocs/.weaponize/scripts/mork/ && cd /home/user/MyDocs/.weaponize/scripts/mork/;
  539.    wget http://www.jwz.org/hacks/mork.pl --user-agent=Mozilla;
  540.    if [ $? -ne 0 ];
  541.     then
  542.       echo "[!]There was a problem downloading mork.pl..[!]";
  543.    fi
  544. fi
  545.  
  546. if [ ! -e /usr/bin/mork ];
  547.  then
  548.    echo 'perl /home/user/MyDocs/.weaponize/scripts/mork/mork.pl $@' > /usr/bin/mork;
  549.    chmod a+x /usr/bin/mork;
  550. fi
  551.  
  552.  
  553. if [ ! -d /home/user/MyDocs/.weaponize/scripts/dnschef ];
  554.  then
  555.    echo "[I]Downloading dnschef...[I]";
  556.    mkdir /home/user/MyDocs/.weaponize/scripts/dnschef;
  557.    cd /home/user/MyDocs/.weaponize/scripts/dnschef && wget http://thesprawl.org/media/projects/dnschef-0.1.tar.gz;
  558.    tar -xvzf dnschef*.tar.gz
  559.    if [ $? -ne 0 ];
  560.     then
  561.       echo "[!]There was a problem downloading dnschef.py[!]";
  562.       exit 4;
  563.    fi
  564. fi
  565.  
  566. if [ ! -e /usr/bin/dnschef ];
  567.  then
  568.    echo 'python /home/user/MyDocs/.weaponize/scripts/dnschef/dnschef-0.1/dnschef.py $@' > /usr/bin/dnschef;
  569.    chmod a+x /usr/bin/dnschef;
  570. fi
  571.  
  572. if [ ! -d /home/user/MyDocs/.weaponize/scripts/sipvicious ];
  573.  then
  574.    echo "[I]Downloading sipvicious..[I]";
  575.    mkdir /home/user/MyDocs/.weaponize/scripts/sipvicious;
  576.    svn checkout http://sipvicious.googlecode.com/svn/trunk/ /home/user/MyDocs/.weaponize/scripts/sipvicious;
  577.    if [ $? -ne 0 ];
  578.     then
  579.       echo "[!]There was a problem downloading sipvicious..[!]";
  580.       exit 4;
  581.    fi
  582. fi
  583.  
  584. if [ ! -e /usr/bin/svcrack ];
  585.  then
  586.    echo 'python /home/user/MyDocs/.weaponize/scripts/sipvicious/svcrack.py $@' > /usr/bin/svcrack;
  587.    chmod a+x /usr/bin/svcrack;
  588. fi
  589.  
  590. if [ ! -e /usr/bin/svlearnfp ];
  591.  then
  592.    echo 'python /home/user/MyDocs/.weaponize/scripts/sipvicious/svlearnfp.py $@' > /usr/bin/svlearnfp;
  593.    chmod a+x /usr/bin/svlearnfp
  594. fi
  595.  
  596. if [ ! -e /usr/bin/svmap ];
  597.  then
  598.    echo 'python /home/user/MyDocs/.weaponize/scripts/sipvicious/svmap.py $@' > /usr/bin/svmap;
  599.    chmod a+x /usr/bin/svmap;
  600. fi
  601.  
  602. if [ ! -e /usr/bin/svreport ];
  603.  then
  604.    echo 'python /home/user/MyDocs/.weaponize/scripts/sipvicious/svreport.py $@' > /usr/bin/svreport;
  605.    chmod a+x /usr/bin/svreport;
  606. fi
  607.  
  608. if [ ! -e /usr/bin/svwar ];
  609.  then
  610.    echo 'python /home/user/MyDocs/.weaponize/scripts/sipvicious/svwar.py $@' > /usr/bin/svwar;
  611.    chmod a+x /usr/bin/svwar;
  612. fi
  613.  
  614. if [ ! -e /usr/bin/sipviciousUpdate ];
  615.  then
  616.    echo 'cd /home/user/MyDocs/.weaponize/scripts/sipvicious/ && svn update && cd -' > /usr/bin/sipviciousUpdate;
  617.    chmod a+x /usr/bin/sipviciousUpdate;
  618. fi
  619.  
  620.  
  621. if [ ! -d /home/user/MyDocs/.weaponize/scripts/PACK ];
  622.  then
  623.    echo "[I]Downloading PACK (Password Analysis and Cracking Kit)..[I]";
  624.    mkdir /home/user/MyDocs/.weaponize/scripts/PACK/;
  625.    cd /home/user/MyDocs/.weaponize/scripts/PACK/ && wget http://thesprawl.org/media/projects/PACK-0.0.2.tar.bz2;
  626.    tar -xvjf PACK-0.0.2.tar.bz2;
  627.    if [ $? -ne 0 ];
  628.     then
  629.       echo "[!]There was a problem downloading PACK..[!]";
  630.       exit 4;
  631.    fi
  632. fi
  633.  
  634. if [ ! -e /usr/bin/dictstat ];
  635.  then
  636.    echo 'python /home/user/MyDocs/.weaponize/scripts/PACK/PACK-0.0.2/dictstat.py $@' > /usr/bin/dictstat;
  637.    chmod a+x /usr/bin/dictstat;
  638. fi
  639.  
  640. if [ ! -e /usr/bin/maskgen ];
  641.  then
  642.    echo 'python /home/user/MyDocs/.weaponize/scripts/PACK/PACK-0.0.2/maskgen.py $@' > /usr/bin/maskgen;
  643.    chmod a+x /usr/bin/maskgen;
  644. fi
  645.  
  646. if [ ! -e /usr/bin/policygen ];
  647.  then
  648.    echo 'python /home/user/MyDocs/.weaponize/scripts/PACK/PACK-0.0.2/policygen.py $@' > /usr/bin/policygen;
  649.    chmod a+x /usr/bin/policygen;
  650. fi
  651.  
  652.  
  653. if [ ! -d /home/user/MyDocs/.weaponize/scripts/metagoofil ];
  654.  then
  655.    echo "[I]Downloading metagoofil..[I]";
  656.    git clone http://github.com/cohesioN241/Metagoofil.git /home/user/MyDocs/.weaponize/scripts/metagoofil;
  657.    if [ $? -ne 0 ];
  658.     then
  659.       echo "[!]There was a problem downloading metagoofil..[!]";
  660.       exit 4;
  661.    fi
  662. fi
  663.  
  664. if [ ! -e /usr/bin/metagoofil ];
  665.  then
  666.    echo 'python /home/user/MyDocs/.weaponize/scripts/metagoofil/metagoofil.py $@' > /usr/bin/metagoofil;
  667.    chmod a+x /usr/bin/metagoofil;
  668. fi
  669.  
  670. if [ ! -e /usr/bin/metagoofilUpdate ];
  671.  then
  672.    echo 'cd /home/user/MyDocs/.weaponize/scripts/metagoofil/ && git pull' > /usr/bin/metagoofilUpdate;
  673.    chmod a+x /usr/bin/metagoofilUpdate;
  674. fi
  675.  
  676.  
  677. if [ ! -d /home/user/MyDocs/.weaponize/scripts/cge ];
  678.  then
  679.    echo "[I]Downloading cisco-global-exploiter..[I]";
  680.    mkdir /home/user/MyDocs/.weaponize/scripts/cge;
  681.    cd /home/user/MyDocs/.weaponize/scripts/cge;
  682.    wget http://dl.packetstormsecurity.net/0405-exploits/cge-13.tar.gz;
  683.    tar -xvzf cge-13.tar.gz;
  684.    if [ $? -ne 0 ];
  685.     then
  686.       echo '[!]There was a problem downloading cisco-global-exploiter..[!]';
  687.       exit 4;
  688.    fi
  689. fi
  690.  
  691. if [ ! -e /usr/bin/cge ];
  692.  then
  693.    echo 'perl /home/user/MyDocs/.weaponize/scripts/cge/cge-13/cge.pl $@' > /usr/bin/cge;
  694.    chmod a+x /usr/bin/cge;
  695. fi
  696.  
  697.  
  698. if [ ! -d /home/user/MyDocs/.weaponize/wordlist ];
  699.  then
  700.    echo "[I]Downloading Cain and Abel Wordlist....[I]";
  701.    mkdir /home/user/MyDocs/.weaponize/wordlist;
  702.    cd /home/user/MyDocs/.weaponize/wordlist;
  703.    wget http://downloads.skullsecurity.org/passwords/cain.txt.bz2;
  704.    bunzip2 *.bz2;
  705.    if [ $? -ne 0 ];
  706.     then
  707.       echo "[!]There was a problem downloading the Cain and Abel Wordlist[!]";
  708.       exit 4;
  709.    fi
  710. fi
  711.  
  712. if [ ! -e /pentest/passwords ];
  713.  then
  714.    mkdir -p /pentest/passwords;
  715.    ln -s /home/user/MyDocs/.weaponize/wordlist /pentest/passwords/wordlists;
  716. fi
  717.  
  718.  
  719. if [ ! -d /home/user/MyDocs/.weaponize/scripts/sqlbrute/ ];
  720.  then
  721.    echo "[I]Dowloading sqlbrute..[I]";
  722.    mkdir /home/user/MyDocs/.weaponize/scripts/sqlbrute/;
  723.    git clone http://github.com/GDSSecurity/SQLBrute.git /home/user/MyDocs/.weaponize/scripts/sqlbrute/;
  724.    if [ $? -ne 0 ];
  725.     then
  726.       echo "[!]There was a problem downloading sqlbrute..[I]";
  727.       exit 4;
  728.    fi
  729. fi
  730.  
  731. if [ ! -e /usr/bin/sqlbrute ];
  732.  then
  733.    echo 'python /home/user/MyDocs/.weaponize/scripts/sqlbrute/sqlbrute.py $@' > /usr/bin/sqlbrute;
  734.    chmod a+x /usr/bin/sqlbrute;
  735. fi
  736.  
  737. if [ ! -e /usr/bin/sqlbruteUpdate ];
  738.  then
  739.    echo 'cd /home/user/MyDocs/.weaponize/scripts/sqlbrute/ && git pull && cd -' > /usr/bin/sqlbruteUpdate;
  740.    chmod a+x /usr/bin/sqlbruteUpdate;
  741. fi
  742.  
  743.  
  744. if [ ! -d /home/user/MyDocs/.weaponize/metasploit/ ];
  745.  then
  746.    echo "[I]Downloading Metasploit...[I]";
  747.    mkdir /home/user/MyDocs/.weaponize/metasploit/;
  748.    git clone git://github.com/rapid7/metasploit-framework.git /home/user/MyDocs/.weaponize/metasploit/
  749.    if [ $? -ne 0 ]
  750.     then
  751.       echo "[!] There was a problem downloading metasploit via git!![!]";
  752.       pkill git;
  753.       exit 3;
  754.    fi
  755.  else
  756.    echo "[I]It appears that metasploit may already be installed..[I]";
  757. fi
  758.  
  759. echo "[I]Installing required tools/libraries for metasploit..[I]";
  760.  
  761. apt-get install ruby1.8 irb1.8 rdoc1.8 libopenssl-ruby1.8 --force-yes -y;
  762.  
  763. if [ $? -ne 0 ]
  764.  then
  765.   echo "[!]There was a problem downloading ruby, irb1.8 and other required tools/libraries through apt-get![!]";
  766.   exit 3;
  767. fi
  768.  
  769. if [ ! -e /usr/bin/ruby ];
  770.  then
  771.    echo "[I]Creating /usr/bin/ruby symlink..[I]";
  772.    ln -s /usr/bin/ruby1.8 /usr/bin/ruby
  773. fi
  774.  
  775. if [ ! -d /usr/local/lib/site_ruby/*/rubygems/ ];
  776.  then
  777.    echo "[I]I need to install rubygems for Metasploit..[I]";
  778.    RUBYGEMS="$(wget -q https://rubygems.org/pages/download --no-check-certificate && egrep "http://production.cf.rubygems.org" download | fgrep tgz | cut -f2 -d'"')";
  779.    rm download;
  780.    wget ${RUBYGEMS};
  781.    if [ $? -ne 0 ]
  782.     then
  783.       echo "[!]There was a problem downloading rubygems.. please look at the error message above![!]";
  784.       exit 3;
  785.    fi
  786.    tar -xvzf rubygems*.tgz;
  787.    cd rubygems*;
  788.    ruby1.8 setup.rb;
  789.    cd -;
  790.    if [ $? -ne 0 ];
  791.     then
  792.       echo "[!]There was a problem setting up rubygems..[!]"
  793.       exit 3;
  794.    fi
  795.    rm rubygems-*.tgz;
  796.    rm -rf rubygems-*;
  797.  else
  798.    echo "[I]It appers that rubygems is already installed..[I]";
  799. fi
  800.  
  801. if [ ! -e /usr/bin/gem ];
  802.  then
  803.    ln -s /usr/bin/gem1.8 /usr/bin/gem;
  804. fi
  805.  
  806. if [ ! -e /usr/bin/msfconsole ];
  807.  then
  808.    echo 'ruby /home/user/MyDocs/.weaponize/metasploit/msfconsole -L $@' > /usr/bin/msfconsole;
  809.    chmod a+x /usr/bin/msfconsole
  810. fi
  811.  
  812. if [ ! -e /usr/bin/msfbinscan ];
  813.  then
  814.    echo 'ruby /home/user/MyDocs/.weaponize/metasploit/msfbinscan $@' > /usr/bin/msfbinscan;
  815.    chmod a+x /usr/bin/msfbinscan;
  816. fi
  817.  
  818. if [ ! -e /usr/bin/msfcli ];
  819.  then
  820.    echo 'ruby /home/user/MyDocs/.weaponize/metasploit/msfcli $@' > /usr/bin/msfcli;
  821.    chmod a+x /usr/bin/msfcli;
  822. fi
  823.  
  824. if [ ! -e /usr/bin/msfd ];
  825.  then
  826.    echo 'ruby /home/user/MyDocs/.weaponize/metasploit/msfd $@' > /usr/bin/msfd;
  827.    chmod a+x /usr/bin/msfd;
  828. fi
  829.  
  830. if [ ! -e /usr/bin/msfelfscan ];
  831.  then
  832.    echo 'ruby /home/user/MyDocs/.weaponize/metasploit/msfelfscan $@' > /usr/bin/msfelfscan;
  833.    chmod a+x /usr/bin/msfelfscan;
  834. fi
  835.  
  836. if [ ! -e /usr/bin/msfencode ];
  837.  then
  838.    echo 'ruby /home/user/MyDocs/.weaponize/metasploit/msfencode $@' > /usr/bin/msfencode;
  839.    chmod a+x /usr/bin/msfencode;
  840. fi
  841.  
  842. if [ ! -e /usr/bin/msfpayload ];
  843.  then
  844.    echo 'ruby /home/user/MyDocs/.weaponize/metasploit/msfpayload $@'  > /usr/bin/msfpayload;
  845.    chmod a+x /usr/bin/msfpayload;
  846. fi
  847.  
  848. if [ ! -e /usr/bin/msfvenom ];
  849.  then
  850.    echo 'ruby /home/user/MyDocs/.weaponize/metasploit/msfvenom $@' > /usr/bin/msfvenom;
  851.    chmod a+x /usr/bin/msfvenom;
  852. fi
  853.  
  854. if [ ! -e /usr/bin/msfupdate ];
  855.  then
  856.    echo "cd /home/user/MyDocs/.weaponize/metasploit/ && git pull && cd -" > /usr/bin/msfupdate;
  857.    chmod a+x /usr/bin/msfupdate;
  858. fi
  859.  
  860.  
  861. #Install SET next.. along with pre-reqs?#
  862.  
  863. #Requirements for SET: Install subversion, python-pexpect, python-beautifulsoup, python-crypto, python-openssl, python-pefile manually for all of SET dependancies.
  864.  
  865. if [ ! -d /home/user/MyDocs/.weaponize/SET/ ];
  866.  then
  867.    echo "[I]Downloading Social Engineering toolkit..";
  868.    svn co http://svn.secmaniac.com/social_engineering_toolkit /home/user/MyDocs/.weaponize/SET/;
  869.    if [ $? -ne 0 ];
  870.     then
  871.       echo "[!]There was a problem downloading the SET toolkit![!]";
  872.       exit 3;
  873.    fi
  874.    apt-get install python-beautifulsoup python-crypto python-openssl -y --force-yes;
  875.    if [ $? -ne 0 ];
  876.     then
  877.       echo "[!]There was a problem downloading and installing some of the required python libraries for SET![!]"
  878.       exit 3;
  879.    fi
  880.    echo "[!]SET should handle downloading and installing the rest of the required Python libraries[!]";
  881. fi
  882.  
  883. apt-get install python-beautifulsoup python-crypto python-openssl -y --force-yes;
  884.  
  885.  
  886. if [ "$(egrep "METASPLOIT_PATH" /home/user/MyDocs/.weaponize/SET/config/set_config )" != "METASPLOIT_PATH=/home/user/MyDocs/.weaponize/metasploit" ];
  887.  then
  888.    echo "[I]Making sure that SET can find metasploit..[I]";
  889.    mv /home/user/MyDocs/.weaponize/SET/config/set_config /home/user/MyDocs/.weaponize/SET/config/set_config.bk;
  890.    cat /home/user/MyDocs/.weaponize/SET/config/set_config.bk  | sed 's/\/opt\/metasploit\/msf3/\/home\/user\/MyDocs\/.weaponize\/metasploit/g' > /home/user/MyDocs/.weaponize/SET/config/set_config;
  891. fi
  892.  
  893. echo "[I]To run the Social engineering toolkit, type in SET[I]";
  894. echo "[I]To update the Social engineering toolkit, type in SETupdate[I]";
  895.  
  896. if [ ! -e /usr/bin/SET ];
  897.  then
  898.    echo "cd /home/user/MyDocs/.weaponize/SET/ && python ./set" > /usr/bin/SET;
  899.    chmod a+x /usr/bin/SET;
  900. fi
  901.  
  902. if [ ! -e /usr/bin/SETupdate ]
  903.  then
  904.    echo "cd /home/user/MyDocs/.weaponize/SET/ && svn update" > /usr/bin/SETupdate;
  905.    chmod a+x /usr/bin/SETupdate;
  906. fi
  907.  
  908. if [ ! -d /home/user/MyDocs/.weaponize/sslstrip/ ];
  909.  then
  910.    echo "[I]Downloading sslstrip...[I]";
  911.    mkdir /home/user/MyDocs/.weaponize/sslstrip/;
  912.    git clone git://github.com/moxie0/sslstrip /home/user/MyDocs/.weaponize/sslstrip/;
  913.    if [ $? -ne 0 ];
  914.     then
  915.       echo "[!]There was a problem downloading sslstrip![!]";
  916.       exit 3;
  917.    fi
  918.    apt-get install python-twisted-web iptables python-twisted-conch -y --force-yes;
  919.    if [ $? -ne 0 ];
  920.     then
  921.       echo "[!]There was a problem installing the required libraries/packages for sslstrip![!]";
  922.       exit 3;
  923.    fi
  924.    cd /home/user/MyDocs/.weaponize/sslstrip/;
  925.    python ./setup.py install;
  926.    if [ $? -ne 0 ];
  927.     then
  928.       echo "[!]There was a problem installing sslstrip![!]";
  929.       echo "[!]Please read the error message above![!]";
  930.       exit 3;
  931.    fi
  932.    cd -;
  933. fi
  934.  
  935. apt-get install python-twisted-web iptables python-twisted-conch -y --force-yes;
  936.  
  937.  
  938. #New n900weapons.tar file needed... 8/20/2012#
  939.  
  940. #new file = 3d10927195fa6579e78f21219800f7a640a5a6cd n900weapons.tar
  941.  
  942. echo "[I]Downloading n900weapons.tar....[I]"
  943.  
  944. if [ ! -e /home/user/MyDocs/.weaponize/n900weapons.tar ];
  945.  then
  946.    cd /home/user/MyDocs/.weaponize/ && wget "http://ia600301.us.archive.org/24/items/n900weapons.tar/n900weapons.tar"
  947.  else
  948.    echo "[I]It appears that the file n900weapons.tar already exists[I]"
  949. fi
  950.  
  951. if [ $? -ne 0 ];
  952.  then
  953.    echo "[!]There was a problem downloading n900weapons.tar.. this program needs this file to continue[!]";
  954.    exit 4;
  955.  else
  956.    echo "[I]Checking shasum of file...[I]"
  957.       if [ "$(sha1sum /home/user/MyDocs/.weaponize/n900weapons.tar | awk '{print $1}')" == "3d10927195fa6579e78f21219800f7a640a5a6cd" ]
  958.        then
  959.          echo "[I] sha1sum = 3d10927195fa6579e78f21219800f7a640a5a6cd[I]";
  960.          echo "[I] continuing to extraction process..[I]";
  961.        else
  962.          echo "[!]sha1sum doesn't match 0cbcb1e9ea87901d5045b3141f001e9f62e6a5f3!!! [!]";
  963.          echo "[!]file may be corrupt..[!]";
  964.          exit 4;
  965.       fi
  966. fi
  967.  
  968. ###Extraction process..##
  969.  
  970. echo "[I]Extracting n900weapons.tar...[I]";
  971. cd /home/user/MyDocs/.weaponize/;
  972.  
  973. if [ ! -e /home/user/MyDocs/.weaponize/n900weapons ]
  974.  then
  975.    tar -xvf /home/user/MyDocs/.weaponize/n900weapons.tar;
  976.  else
  977.    echo "[I]It appears that n900weapons.tar has already been extracted..[I]";
  978. fi
  979.  
  980. if [ $? -ne 0 ]
  981.  then
  982.    echo "[!]There was a problem with extracting n900weapons.tar![!]";
  983.    exit 4;
  984. fi
  985.  
  986.  
  987. if [ ! -e /pentest/windows-binaries ];
  988.  then
  989.    echo "[I]Setting up /pentest/windows-binaries directory..[I]"
  990.    cd /home/user/MyDocs/.weaponize/n900weapons/
  991.    tar xvf windows-binaries.tar
  992.    ln -s /home/user/MyDocs/.weaponize/n900weapons/windows-binaries /pentest/windows-binaries;
  993.  else
  994.    echo "[I]/pentest/windows-binaries already exists..[I]";
  995. fi
  996.  
  997. #Install ettercap from the tar file..##
  998.  
  999. echo "[I]Extracting and installing ettercap for n900..[I]"
  1000.  
  1001.  
  1002. if [ ! -d /opt/ettercap/ ];
  1003.  then
  1004.    cd /home/user/MyDocs/.weaponize/n900weapons/ec-n900/
  1005.    tar -xvf ec-n900.tar;
  1006.    mv ettercap/ /opt/
  1007.    ln -s /opt/ettercap/bin/ettercap /bin/ettercap;
  1008.    ln -s /opt/etteracp/bin/etterfilter /bin/etterfilter;
  1009.    ln -s /opt/ettercap/bin/etterlog /bin/etterlog;
  1010.    ln -s /opt/ettercap/lib/libnet.so.1.3.0 /usr/lib/libnet.so.1;
  1011.    ln -s /opt/ettercap/lib/libpcre.so.3 /usr/lib/libpcre.so.3;
  1012.    chmod a+x /bin/ettercap;
  1013.    chmod a+x /bin/etterfilter;
  1014.    chmod a+x /bin/etterlog;
  1015.    echo "[I]Ettercap installed..[I]";
  1016.  else
  1017.    echo "[I]It appears that ettercap is already installed..[I]";
  1018. fi
  1019.  
  1020.  
  1021. ##Installing kernel...###
  1022.  
  1023.  
  1024. #Check if the kernel is already installed... use the dpkg --contents to find out a list of files that will be on the n900 if the
  1025. #kernel is installed already..
  1026.  
  1027. echo "[I]checking to see if custom kernel that supports packet injection is installed...[I]";
  1028.  
  1029. #File from kernel-power_2.6.28-10power51r1_armel.deb##
  1030.  
  1031. KernelInstall=0
  1032.  
  1033. if [ "$(dpkg --list | fgrep power | fgrep kernel)" ];
  1034.  then
  1035.    (( KernelInstall++ ))
  1036. fi
  1037.  
  1038.  
  1039. if [ -e /boot/zImage-2.6.28.10-power51.fiasco ]
  1040.  then
  1041.    (( KernelInstall++ ))
  1042. fi
  1043.  
  1044. ######################################################
  1045.  
  1046.  
  1047. #Files from linux-kernel-power-headers_2.6.28-10power51r1_armel.deb###8/22/2012
  1048.  
  1049. if [ -e /usr/include/linux/gfs2_ondisk.h ]
  1050.  then
  1051.    (( KernelInstall++ ))
  1052. fi
  1053.  
  1054. if [ -e /usr/include/linux/netfilter_ipv4/ipt_comment.h ]
  1055.  then
  1056.    (( KernelInstall++ ))
  1057. fi
  1058. ##################################################################
  1059.  
  1060.  
  1061. #Files from kernel-power-modules_2.6.28-10power51r1_armel.deb####8/22/2012
  1062.  
  1063. if [ -e /lib/modules/2.6.28.10-power51/usbserial.ko ]
  1064.  then
  1065.    (( KernelInstall++ ))
  1066. fi
  1067.  
  1068. if [ -e /lib/modules/2.6.28.10-power51/dm-crypt.ko ]
  1069.  then
  1070.    (( KernelInstall++ ))
  1071. fi
  1072.  
  1073. ##################################################################
  1074.  
  1075. #Files from kernel-power-flasher_2.6.28-10power51r1_armel.deb####8/22/2012
  1076.  
  1077. if [ -e /usr/sbin/kernel-power-uninstall ]
  1078.  then
  1079.    (( KernelInstall++ ))
  1080. fi
  1081.  
  1082. if [ -e /etc/sudoers.d/kernel-power-flasher.sudoers ]
  1083.  then
  1084.    (( KernelInstall++ ))
  1085. fi
  1086.  
  1087. #################################################################
  1088.  
  1089.  
  1090. ##Put this in your if loops in the file check sections..###
  1091.  
  1092. response="N"
  1093.  
  1094. if [ ${KernelInstall} -gt 0 ]
  1095.  then
  1096.    echo "[!]Files from kernel 2.6.28-10power51r1_deb suite found or a power kernel is installed![!]";
  1097.    echo "[!]A custom kernel appears to be installed already![!]";
  1098.    echo "[?]Skip installing custom kernel?[?]"
  1099.    read -p "Response: (Y|N)" response;
  1100.    if ! echo ${response} | grep -E "(Y|y).*" &> /dev/null;
  1101.     then
  1102.       KernelInstall=0;
  1103.     else
  1104.       echo "[!]Skipping install of custom kernel..[!]";
  1105.       SkipInstall="true";
  1106.    fi
  1107. fi
  1108. ######^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^###############
  1109.  
  1110.  
  1111. if [ ${KernelInstall} -eq 0 ]
  1112.  then
  1113.    echo "[!]This program will be removing the currently installed kernel![!]";
  1114.    echo "[?]Are you CERTAIN that you want to install the custom kernel?[?]";
  1115.    read -p "Response: (Y|N)" response;
  1116.    if echo ${response} | grep -E "(Y|y).*" &> /dev/null;
  1117.     then
  1118.       echo "[I]Removing current kernel...[I]";
  1119.       apt-get remove $(dpkg --list | fgrep kernel | sed 's/ii//g'  | egrep "Linux kernel" | fgrep -v tools | awk '{print $1}') -y;
  1120.       if [ $? -ne 0 ]
  1121.        then
  1122.          echo "[!]CRITICAL[!]"
  1123.          echo "[!]There was a problem removing your current kernel!![!]";
  1124.          echo '[!]LOOK OVER THESE ERROR MESSAGES CAREFULLY[!]';
  1125.          exit 5;
  1126.       fi
  1127.       echo "[I]Installing custom kernel that supports packet injection...[I]";
  1128.       #Start installing the custom kernel...#
  1129.       #http://talk.maemo.org/showthread.php?t=65232&page=107  Forensics and packetinjection?#
  1130.       dpkg -i /home/user/MyDocs/.weaponize/n900weapons/kernel/kernel-power_2.6.28-10power51r1_armel.deb;
  1131.       if [ $? -ne 0 ]
  1132.        then
  1133.          echo "[!]CRITICAL[!]"
  1134.          echo "[!]There was a problem installing kernel-power_2.6.28-10power51r1_armel!![!]";
  1135.          echo '[!]LOOK OVER THESE ERROR MESSAGES CAREFULLY[!]';
  1136.          exit 5;
  1137.       fi
  1138.       dpkg -i /home/user/MyDocs/.weaponize/n900weapons/kernel/kernel-power-headers_2.6.28-10power51r1_armel.deb;
  1139.       if [ $? -ne 0 ]
  1140.        then
  1141.          echo "[!]CRITICAL[!]"
  1142.          echo "[!]There was a problem installing kernel-power-headers_2.6.28-10power51r1_armel!![!]";
  1143.          echo '[!]LOOK OVER THESE ERROR MESSAGES CAREFULLY[!]';
  1144.          exit 5;
  1145.       fi
  1146.       dpkg -i /home/user/MyDocs/.weaponize/n900weapons/kernel/kernel-power-modules_2.6.28-10power51r1_armel.deb;
  1147.       if [ $? -ne 0 ]
  1148.        then
  1149.          echo "[!]CRITICAL[!]"
  1150.          echo "[!]There was a problem installing kernel-power-modules_2.6.28-10power51r1_armel!![!]";
  1151.          echo '[!]LOOK OVER THESE ERROR MESSAGES CAREFULLY[!]';
  1152.          exit 5;
  1153.       fi
  1154.       dpkg -i /home/user/MyDocs/.weaponize/n900weapons/kernel/kernel-power-flasher_2.6.28-10power51r1_armel.deb;
  1155.       if [ $? -ne 0 ]
  1156.        then
  1157.          echo "[!]CRITICAL[!]"
  1158.          echo "[!]There was a problem installing kernel-power-flasher_2.6.28-10power51r1_armel.deb!![!]";
  1159.          echo '[!]LOOK OVER THESE ERROR MESSAGES CAREFULLY[!]';
  1160.          exit 5;
  1161.       fi
  1162.       echo "[I]Installing some more useful hostmode-gui, qtmobilehotspot and wlan driver selector app..[I]";
  1163.       apt-get install status-area-wlan-driver-selector-applet hostmode-gui qtmobilehotspot --force-yes -y;
  1164.       if [ $? -ne 0 ];
  1165.        then
  1166.          echo "[!]There was a problem installing these tools![!]";
  1167.          exit 4;
  1168.       fi
  1169.       echo "[I]Customizing status-area-wlan-driver-selector-applet per current config..[I]";
  1170.       gconftool-2 --set /apps/wlan_driver_selector/driver_folder --type string "/opt/packet-injection-modules/2.6.28.10-power51";
  1171.       if ! cat /usr/sbin/pcsuite-enable.sh | fgrep "\-o wlan0 \-j MASQUERADE" &> /dev/null;
  1172.        then
  1173.          echo "[I]Adjusting pcsuite-enable.sh...[I]";
  1174.          cat /usr/sbin/pcsuite-enable.sh | sed 's/exit 0//g' > /usr/sbin/pcsuite-enable.NEW;
  1175.          echo 'echo 1 > /proc/sys/net/ipv4/ip_forward' >> /usr/sbin/pcsuite-enable.NEW;
  1176.          echo 'iptables -t nat -F POSTROUTING' >> /usr/sbin/pcsuite-enable.NEW;
  1177.          echo 'iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE' >> /usr/sbin/pcsuite-enable.NEW;
  1178.          echo 'iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE' >> /usr/sbin/pcsuite-enable.NEW;
  1179.          echo 'ifup usb0' >> /usr/sbin/pcsuite-enable.NEW;
  1180.          echo 'dnsmasq -I lo -z -a 192.168.2.15 -F 192.168.2.64,192.168.2.127' >> /usr/sbin/pcsuite-enable.NEW;
  1181.          echo 'exit 0' >> /usr/sbin/pcsuite-enable.NEW;
  1182.          mv /usr/sbin/pcsuite-enable.sh /usr/sbin/pcsuite-enable.bk;
  1183.          mv /usr/sbin/pcsuite-enable.NEW /usr/sbin/pcsuite-enable.sh;
  1184.          chmod a+x /usr/sbin/pcsuite-enable.sh;
  1185.        fi
  1186.     else
  1187.       echo "[I]Skipping install of custom kernel..[I]";
  1188.    fi
  1189. fi
  1190.  
  1191.  
  1192. echo "[I]Installing some other useful tools..[I]";
  1193. apt-get install cell-modem-ui 3g2g-mode-selection-applet simple-brightness-applet ntorch pc-connectivity-manager --force-yes -y;
  1194. if [ $? -ne 0 ];
  1195.  then
  1196.    echo "[!]There was a problem installing these tools![!]";
  1197.    exit 4;
  1198. fi
  1199.  
  1200.  
  1201. if [ ! -e /usr/bin/tether ]
  1202.  then
  1203.    echo "[I]Installing useful tethering script.. (Thanks jschan :-) )[I]";
  1204.    mkdir /home/user/MyDocs/.weaponize/scripts/tether/;
  1205.    cd /home/user/MyDocs/.weaponize/scripts/tether/;
  1206.    wget 'http://talk.maemo.org/attachment.php?attachmentid=21253&d=1310189015' -O tether.tar;
  1207.    if [ $? -ne 0 ];
  1208.     then
  1209.       echo "[!]There was a problem downloading a useful tether.sh script..[!]";
  1210.       exit 4;
  1211.    fi
  1212.    /home/user/MyDocs/.weaponize/scripts/tether/;
  1213.    tar -xvf tether.tar;
  1214.    cd /home/user/MyDocs/.weaponize/scripts/tether/opt/tether;
  1215.    mkdir /opt/tether;
  1216.    cd /home/user/MyDocs/.weaponize/scripts/tether/opt/tether;
  1217.    cp tether-dbus-config /etc/dbus-scripts.d/;
  1218.    cp tether-dbus-controller.sh tether.sh /opt/tether
  1219.    cp tether.sh /usr/bin/tether
  1220.    chmod a+x /usr/bin/tether;
  1221.    cd /home/user/MyDocs/.weaponize/scripts/tether/;
  1222.    rm -rf opt;
  1223.    rm -rf teth*;
  1224. fi
  1225.  
  1226. if grep "DisablePlugins" /etc/bluetooth/main.conf | fgrep network &> /dev/null;
  1227.  then
  1228.    echo "[I]Editing bluetooth main.conf file..[I]";
  1229.    cp /etc/bluetooth/main.conf /etc/bluetooth/main.conf.bk
  1230.    sed 's/DisablePlugins = network,input,hal/DisablePlugins = hal/g' /etc/bluetooth/main.conf.bk > cp /etc/bluetooth/main.conf;
  1231. fi
  1232.  
  1233. if [ ! -e /usr/bin/update ]
  1234.  then
  1235.    cd ${PresentDir};
  1236.    cp update.sh /usr/bin/update;
  1237.    chmod a+x /usr/bin/update;
  1238. fi
  1239.  
  1240. if [ ! -e /usr/bin/listweapons ]
  1241.  then
  1242.   cd ${PresentDir};
  1243.   cp listweapons.sh /usr/bin/listweapons;
  1244.   chmod a+x /usr/bin/listweapons;
  1245. fi
  1246.  
  1247. apt-get clean;
  1248.  
  1249. apt-get autoremove -y;
  1250.  
  1251. if [ ! -e /etc/weaponized ];
  1252.  then
  1253.    echo "This phone has been weaponized on $(date)" >> /etc/weaponized;  
  1254.    echo 'Website: zitstif.no-ip.org' >> /etc/weaponized;
  1255.    echo '75eea509c19cc66576a1bdea893834f8291c2d96' >> /etc/weaponized;
  1256. fi
  1257.  
  1258. echo "[!]You should reboot your phone![!]";
  1259. exit 0;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top