Skip to content
Snippets Groups Projects
Commit 8baff31b authored by jdh8d's avatar jdh8d
Browse files

revised to release to ais w/o ida.key, added installer and test harness for ubuntu16

parent ef291229
No related branches found
No related tags found
No related merge requests found
......@@ -64,9 +64,16 @@ centos_files/zlib-1.2.7-17.el7.x86_64.rpm -text svneol=unset#application/x-rpm
/irdb_vars -text
/manifest.txt -text
/postgres_setup.sh -text
/regen_install.sh -text
/set_command_envs -text
/set_env_vars -text
/set_ida_server -text
/start_dev.sh -text
/svn.externals.uva_dev -text
ubuntu16_files/README.txt -text
ubuntu16_files/Vagrantfile -text
ubuntu16_files/generate_ais_installer.sh -text
ubuntu16_files/install.sh -text
ubuntu16_files/manifest.txt -text
ubuntu16_files/test.sh -text
/yum_packages.sh -text
......@@ -6,9 +6,12 @@ submanifest SMPStaticAnalyzer/manifest.txt
submanifest zipr_install/manifest.txt
submanifest stratafier/manifest.txt
submanifest IdaProServer/manifest.txt
submanifest ubuntu16_files/manifest.txt
file set_command_envs ps
file set_env_vars ps
file set_ida_server ps
file irdb_vars ps
file yum_packages.sh centos
file postgres_setup.sh ps
file README.txt ps
directory centos_files centos
#!/bin/bash
#Add PostGres password file for modifying the database
printf ":5432::$USER:1qaz2wsx\nlocalhost:5432:*:$USER:1qaz2wsx\n127.0.0.1:5432:*:$USER:1qaz2wsx" > $HOME/.pgpass
chmod og-rw $HOME/.pgpass
#Allow remote access to PostGres
sudo su -c "printf \"\nhost \t all \t all \t 127.0.0.1/16 \t md5\nhostssl all \t all \t 127.0.0.1/16 \t md5\n\" >> /etc/postgresql/9.3/main/pg_hba.conf"
printf "\nlisten_addresses = '*'\n" | sudo tee -a /etc/postgresql/9.3/main/postgresql.conf > /dev/null
main()
{
local randpass=$(date +%s | sha256sum | base64 | head -c 32)
#Restart PostGres
sudo service postgresql restart
#Add PostGres password file for modifying the database
newlines=$(printf ":5432::$USER:$randpass\nlocalhost:5432:*:$USER:$randpass\n127.0.0.1:5432:*:$USER:$randpass\n" )
echo -e "$newlines$(cat $HOME/.pgpass >/dev/null)" > $HOME/.pgpass
chmod og-rw $HOME/.pgpass
#Create Database User and Table
echo "CREATE ROLE $USER WITH CREATEDB LOGIN NOSUPERUSER NOCREATEROLE PASSWORD '1qaz2wsx'" | sudo -u postgres psql
sudo su -c "createdb -O $USER peasoup_$USER" postgres
#Create Database User and Table
echo "CREATE ROLE $USER WITH CREATEDB LOGIN NOSUPERUSER NOCREATEROLE PASSWORD '$randpass'" | sudo -u postgres psql
echo "ALTER ROLE $USER WITH PASSWORD '$randpass'" | sudo -u postgres psql
dropdb peasoup_$USER
createdb peasoup_$USER
#Setup the Database to store PEASOUP info
source set_env_vars
$PEASOUP_HOME/tools/db/pdb_setup.sh
#Setup the Database to store PEASOUP info
source set_env_vars
$PEASOUP_HOME/tools/db/pdb_setup.sh
}
main
#!/bin/bash
main()
{
local keys="$@"
local key_args=""
for i in $keys
do
key_args="$key_args -l $i"
done
$PEDI_HOME/pedi --clean -m manifest.txt
$PEDI_HOME/pedi --setup -m manifest.txt $key_args -i $PS_INSTALL
$PEDI_HOME/pedi -m manifest.txt
}
main "$@"
......@@ -23,8 +23,8 @@ export IRDB_TRANSFORMS=$PEASOUP_UMBRELLA_DIR/irdb_transforms
export ZEST_RUNTIME=$PEASOUP_UMBRELLA_DIR/zest_runtime
export DAFFY_HOME=$PEASOUP_UMBRELLA_DIR/daffy
if [ -z "$PS_INSTALL" -o -f manifest.txt ]; then
if [ -z $PS_INSTALL ]; then
if [ -f manifest.txt ]; then
if [ -f $PS_INSTALL ]; then
export PS_INSTALL=$PEASOUP_UMBRELLA_DIR/installed
fi
export PS=$PS_INSTALL/peasoup_examples/tools/ps_analyze.sh
......
Steps to installing.
0) Unpack the tarball (likely called zipr_toolchain.tgz) -- you must have done this already
to be reading this!
1) Switch to the directory created during unpacking. i.e., cd zipr_toolchain
2) Copy your ida.key for IdaPro7.0 to ./idaproCur/ida.key
3) Run "./ubuntu16_files/install.sh" in this directory -- lots of packages
will be installed.
4) Run "source set_env_vars"
5) This step sets up postgres to hold the Zipr database. If you already
have postgres configured, it may damage your data. Use with appropriate caution.
Run "postgres_setup.sh"
6) Test the installation:
run "cd /tmp; $PSZ /bin/ls ./ls.ziprd"
You should see the Zipr toolchain protecting /bin/ls and writing results into the file
The Zipr toolchain should report success if installed properly.
Run the rewritten program as if it were /bin/ls: "/tmp/ls.ziprd"
If you log out and log back in (or log into a new session), you'll need to re-run steps 1 and 4
before using the toolchain again. You may wish to automate this step by adding it to your .bashrc
file or other, appropriate login files.
Vagrant.configure(2) do |config|
config.vm.define "zipr_toolchain" do |zipr_toolchain|
# sanity check env. -- but do this after the box definition.
zipr_toolchain.vm.box = "ubuntu/xenial64"
zipr_toolchain.vm.box_url = "http://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-vagrant.box"
# zipr_toolchain.vm.hostname = "ziprtools"
zipr_toolchain.vm.provider "virtualbox" do |vbox|
# vbox.gui = true
vbox.name = "ziprtools"
vbox.cpus = 2
vbox.memory = 8192
end
# README step 0, unpack tarball.
zipr_toolchain.vm.provision "shell", privileged: false, inline: <<-SHELL
cd /home/vagrant
tar xzf /vagrant/zipr_toolchain.tgz
SHELL
# README step 2: install key.
zipr_toolchain.vm.provision "file", source: Pathname.new(ENV["IDAROOT"]).join("ida.key"), destination: "$HOME/zipr_toolchain/idaproCur/ida.key"
# README step 3-6: run installer, setup postgres as vagrant, test ls.
zipr_toolchain.vm.provision "shell", privileged: false, inline: <<-SHELL
cd /home/vagrant/zipr_toolchain ; sudo ./ubuntu16_files/install.sh 2>&1 | tee /tmp/install.log
source set_env_vars
./postgres_setup.sh
cd /tmp
$PSZ /bin/ls ./ls.protected
if ./ls.protected ; then
echo
echo
echo
echo "Installation Success! (Passed smoke test on /bin/ls)"
echo
echo
echo
else
echo
echo
echo
echo
echo "Installation failed! (Could not protect /bin/ls)"
echo
echo
echo
fi
echo "Cleaning up"
rm -Rf /tmp/ls /tmp/peasoup*
SHELL
end
end
#!/bin/bash
cd $PEASOUP_UMBRELLA_DIR
./regen_install.sh ida ps zipr ubuntu16 stars
cp -r installed zipr_toolchain
tar czf ubuntu16_files/zipr_toolchain.tgz zipr_toolchain
rm -Rf zipr_toolchain
#!/bin/bash
main()
{
# 1) force sudo password as necessary
# 2) make sure package manager is ready for installing packages.
sudo apt-get update
local packages="
realpath
gcc
nasm
coreutils
postgresql
postgresql-client
libpqxx-3.1
python
"
for i in $packages
do
sudo apt-get install -y $i
done
}
main "$@"
file install.sh ubuntu16
file README.txt ubuntu16
#/bin/bash
./generate_ais_installer.sh
vagrant destroy -f
vagrant up
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment