Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

sslstrip version check function

By: a guest on Jul 18th, 2011  |  syntax: None  |  size: 2.24 KB  |  views: 210  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ##################################################
  2. f_sslstrip_vercheck(){
  3. clear
  4. f_Banner
  5.  
  6. printf "\nChecking the thoughtcrime website for the latest version of SSLStrip...\n"
  7.  
  8. #Get the installed version
  9. installedver=$(cat /pentest/web/sslstrip/setup.py|grep version|cut -d "'" -f2)
  10.  
  11. # Change to tmp folder to keep things clean then get the index.html from thoughtcrime.com for SSLStrip
  12. cd /tmp/
  13. wget -q http://www.thoughtcrime.org/software/sslstrip/index.html
  14. latestver=$(cat index.html | grep "cd sslstrip"|cut -d "-" -f2)
  15. cd $location
  16.  
  17. vercompare=$(echo "$installedver < $latestver"|bc)
  18.  
  19. printf "\nInstalled version of SSLStrip: $installedver\n"
  20. printf "\nLatest version of SSLStrip: $latestver\n"
  21.  
  22. if [ $vercompare == 1 ]; then
  23.   printf "\nYou have version $installedver installed, version $latestver is available.\nWould you like to install the latest version? (y/n) "
  24.   read -e sslstripupdate
  25.   sslstripupdate="$(echo ${sslstripupdate} | tr 'A-Z' 'a-z')"
  26.  
  27.     if [ -z $sslstripupdate ]; then
  28.       f_Error
  29.       f_sslstrip_vercheck #may need to change so it doesn't keep grabbing website
  30.     fi
  31.  
  32.     if [ $sslstripupdate == "y" ]; then
  33.       f_sslstrip-update
  34.     else
  35.       printf "\nOK, maybe next time...\n"
  36.       sleep 3
  37.     fi
  38. else
  39.   printf "\nLooks like you're running the latest version available.\n"
  40.   sleep 5
  41. fi
  42.  
  43. #clean up the mess
  44. rm /tmp/index.html
  45.  
  46. f_prereqs
  47. }
  48.  
  49. ##################################################
  50. f_sslstrip-update(){
  51. clear
  52. f_Banner
  53.  
  54. printf "\nThis will install SSLStrip from the thoughtcrime website, not the BackTrack repositories.\nHit return to continue or ctrl-c to cancel and return to main menu."
  55. read $continue
  56.  
  57. mv /pentest/web/sslstrip/ /pentest/web/sslstrip-$installedver
  58.  
  59. printf "\nDownloading the tar file...\n"
  60. cd /tmp
  61. wget -q http://www.thoughtcrime.org/software/sslstrip/sslstrip-0.9.tar.gz
  62. sleep 2
  63.  
  64. printf "\nInstalling the latest version of SSLStrip...\n"
  65. tar zxvf sslstrip-$latestver.tar.gz
  66. mv -f /tmp/sslstrip-$latestver/ /pentest/web/sslstrip/
  67. cd $location
  68. sleep 2
  69.  
  70. printf "\nVersion $latestver has been installed.\n"
  71. sleep 2
  72.  
  73. #clean up the mess
  74. rm -rf /tmp/sslstrip-$latestver
  75. rm /tmp/sslstrip-$latestver.tar.gz
  76. }
  77.  
  78. ##################################################
clone this paste RAW Paste Data