#!/bin/sh
# ec2-pyrit-prep.sh
# Preps an: Amazon Linux AMI with NVIDIA GRID GPU Driver AMI
# Created for hacking exposed wireless, third edition, 2014-08-06

echo "Installing the run of the mill dependencies.."
yum -y install python-devel zlib-devel openssl-devel libpcap-devel.x86_64 tmux glibc-devel  automake autoconf gcc-c++

#install the cuda tools, and set a symlink so cuda-pyrit can find them
echo "Installing cuda SDK.."
yum  -y install cuda.x86_64
ln -s /opt/nvidia/cuda/ /opt/cuda


#--download scapy and pyrit
echo "Downloading scapy and pyrit.."
wget http://www.secdev.org/projects/scapy/files/scapy-2.2.0.tar.gz

wget http://pyrit.googlecode.com/files/pyrit-0.4.0.tar.gz
wget http://pyrit.googlecode.com/files/cpyrit-cuda-0.4.0.tar.gz

#---install scapy--
echo "Installing scapy.."
tar -zxf ./scapy-2.2.0.tar.gz; cd scapy-2.2.0/
python ./setup.py install; cd ..


#--install pyrit-cuda module
echo "Installing pyrit, pyrit-cuda"
tar -zxf cpyrit-cuda-0.4.0.tar.gz; cd cpyrit-cuda-0.4.0; 
python ./setup.py  install; cd ..


--install pyrit
tar -zxf ./pyrit-0.4.0.tar.gz; cd pyrit-0.4.0
python ./setup.py  install; cd ..

echo "--All done--"
echo "  press enter to run benchmark."
read a
pyrit benchmark
