#!/bin/bash # # simple_dl1.sh: A simple demo script for simple automactic downloading (without explicit proxy), # without encryption, steganography etc., but optional with a little hiding, confuscation/deniability and # optional self-destruction to remove traces. # # Dr. Rolf Freitag 2010 # # Version 2010-07-22 # set -u : Stop the script when a variable isn't set (add -x for debugging) set -u # go to the download directory #cd /tmp/ cd /mnt-system/tmp # wait while not online while [ ! -f /home/knoppix/Desktop/online ] do sleep 1 done # now we are online; download with the biggest file at last, because the return value of that single download will be checked USER_AGENT=Mozilla/4.0\ \(compatible\;\ MSIE\ 7.0\;\ Windows\ NT\ 6.0\;\ SLCC1\;\ .NET\ CLR\ 2.0.50727\;\ .NET\ CLR\ 3.0.04506\) OTHER_WGET_OPTIONS="-c -v -np -e robots=off --cache=off -T 20 --quota=2345M --tries=2 --restrict-file-names=unix --ignore-length --no-passive-ftp --retry-connrefused" # download the current version of damnsmalllinux (DSL) with a checksum (about 50 MB) URLS="http://ftp.belnet.be/packages/damnsmalllinux/current/current.iso.md5.txt http://ftp.belnet.be/packages/damnsmalllinux/current/current.iso" typeset -i retval=1 while [ $retval -ne 0 ] ; do # retry while the dowload is not finished for URL in $URLS ; do wget --user-agent="$USER_AGENT" $OTHER_WGET_OPTIONS --header="Accept-Encoding: deflate, gzip" $URL retval=$? done done # Optional: Move the download to an unsuspicious place, reverse it and set it's times to the ones # from this script for confuscation/deniability #mkdir -p /mnt-system/found.000 #perl -e 'print reverse <>' current.iso > /mnt-system/found.000/file0000.chk #perl -e 'print reverse <>' current.iso.md5.txt > /mnt-system/found.000/file0001.chk #touch -r $0 /mnt-system/found.000 #touch -r $0 /mnt-system/found.000/file*.chk #rm -f current.iso* & # after the download the job is done, so shutdown poweroff & # Optional: Simple self-destruction to remove traces #shred -u "$0"