if [ "`whoami`" = "root" ]; then echo Run this as the created user, not root exit 1 fi # # Get some basic RPM's aboard # banner "yum update" sudo yum -y update banner "yum install required packages" sudo yum -y install python-pip git ruby gem ruby-devel libimobiledevice libimobiledevice-utils gcc-c++ \ make patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \ bzip2 autoconf automake libtool bison iconv-devel sqlite-devel which zip unzip openssl file sudo pip freeze > /tmp/freeze0 banner "Upgrade pip" sudo pip install --upgrade pip sudo pip freeze > /tmp/freeze1 if [ 1 -eq 0 ]; then banner "Install construct" # The latest construct that is known to work with iSign won't install with pip - We need to get the URL and fetch manually CONVERSION=2.5.5 CONURL=`wget -q -O- https://pypi.org/simple/construct/ | sed -e "s/-reupload.tar.gz /tmp/freeze2 banner "Install isign" git clone https://github.com/apperian/isign.git cd isign /usr/bin/perl -pi -e "if (/pyOpenSSL/) { s/=.*[0-9]/==`pip freeze | grep ^pyOpenSSL | cut -d "=" -f 3`/ }" setup.py /usr/bin/perl -pi -e "if (/construct/) { s/=.*[0-9]/==`pip freeze | grep ^construct | cut -d "=" -f 3`/ }" setup.py /usr/bin/perl -pi -e "if (/ak-construct/) { s/=.*[0-9]/==`pip freeze | grep ^ak-construct | cut -d "=" -f 3`/ }" setup.py sed -i "s/apt-get/echo apt-get/" INSTALL.sh if [ ! -e ~/.isign ]; then mkdir ~/.isign; fi #sudo ./INSTALL.sh read more sudo rm -rf build dist isign.egg-info cd fi # Install newer non-standard GCC package required for insert_dylib banner "install centos-release-scl" sudo yum -y install centos-release-scl banner "install devtoolset-4-gcc" sudo yum -y install devtoolset-4-gcc* banner "install insert_dylib" git clone https://github.com/LeanVel/insert_dylib cd ~/insert_dylib scl enable devtoolset-4 "bash -c 'gcc -I ./insert_dylib/include/ -o ./insert_dylib/insert_dylib ./insert_dylib/main.c'" sudo mv ~/insert_dylib/insert_dylib/insert_dylib /usr/local/bin/ rm -rf ~/insert_dylib # # Install a newer version of Ruby (RBENV method) # See https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-centos-7 # banner install rbenv cd git clone git://github.com/sstephenson/rbenv.git .rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile echo 'eval "$(rbenv init -)"' >> ~/.bash_profile export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" banner install ruby-build git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH" banner "install ruby" # # Install a newer ruby version and set it as our global version for now # # Prevent generation of local documentation for each gem installed (It's slow!) echo "gem: --no-document" > ~/.gemrc VERSION=`curl -s https://www.ruby-lang.org/en/downloads/ | grep pub | grep -v rc | sed -e "s/.tar.gz.*//" -e "s/.*ruby-//" | grep ^[0-9] | sort -nr | head -1` rbenv install -v $VERSION rbenv global $VERSION banner install fastlane gem install fastlane banner install pry gem install pry banner install son gem install json banner install genProvisioningProfile.rb wget -O genProvisioningProfile.rb https://dji.retroroms.info/_export/code/og/ipabuild/start?codeblock=2 sed -i "s/sensepost/`whoami`/" genProvisioningProfile.rb # TODO: Add wget here for our custom iinject.sh file #cd ~ #git clone https://github.com/LeanVel/iInject #sed -i "s/^checkProvisioning$/checkProvisioning/" iInject/iInject.sh #sed -i "s/#Installing/cd \"\$currPath\"\ncleanup\nexit 0\n#Installing/" iInject/iInject.sh #curl https://build.frida.re/frida/ios/lib/FridaGadget.dylib --output iInject/FridaGadget.dylib ## ## Install rails ## # #VERSION=`curl -s http://railsapps.github.io/rails-release-history.html | grep "was released" | head -1 | sed -e "s/ was.*//" -e "s/.* //"` #gem install rails -v $VERSION # # # ## ## Import apple cert ## # #cd /usr/share/pki/ca-trust-source/anchors #sudo wget https://raw.githubusercontent.com/saucelabs/isign/master/isign/apple_credentials/applecerts.pem #sudo update-ca-trust # ## ## Install MySQL ## # #sudo yum -y install mariadb mariadb-server #sudo systemctl enable mariadb.service #sudo systemctl start mariadb.service ## mysql_secure_installation # Recommend to do this as well - but commented out now for scripted setup # ## ## Install MySQL gem file ## # #sudo yum -y install mysql-devel #gem install mysql2 # ## ## Build MySQL-udf-http ## # #sudo yum -y install libcurl-devel #cd #git clone https://github.com/y-ken/mysql-udf-http.git #cd mysql-udf-http #chmod 700 configure #./configure --libdir=/usr/lib64/mysql/plugin/ --with-mysql=/bin/mysql_config #make #sudo make install #sudo sh -c 'echo /usr/lib64/mysql/plugin/ > /etc/ld.so.conf.d/mysql.conf' #sudo /sbin/ldconfig # #echo create function http_get returns string soname \'mysql-udf-http.so\'\; | mysql #echo create function http_post returns string soname \'mysql-udf-http.so\'\; | mysql #echo create function http_put returns string soname \'mysql-udf-http.so\'\; | mysql #echo create function http_delete returns string soname \'mysql-udf-http.so\'\; | mysql # ## ## Install a web server ## # #sudo yum -y install lighttpd #sudo /usr/bin/perl -pi -e "if (/server.use-ipv6/) { s/enable/disable/ }" /etc/lighttpd/lighttpd.conf # ## ## Install PHP ## ## #sudo yum -y install install php-fpm lighttpd-fastcgi #sudo /usr/bin/perl -pi -e "if (/^user|^group/) { s/apache/lighttpd/ }" /etc/php-fpm.d/www.conf # ## ## Start web server and php-fpm ## # #sudo systemctl enable php-fpm.service #sudo systemctl start php-fpm.service #sudo systemctl enable lighttpd.service #sudo systemctl start lighttpd.service # ## ## Install InspectorGadget ## # ##cd /var/www/lighttpd # ## TO BE CONTINUED # # ## ## Install rails code ## #sudo yum -y install nodejs # #cd ~ #mkdir rails #cd rails # #rails new gadget #cd gadget # #### ADD RAILS CODE HERE ### # #rails server & # # # Cleanup # #sudo rm -f /etc/sudoers.d/build exit