Advertisement
DataMaN

Auto Install: Damn Vulnerable Web App

Jul 4th, 2013
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. #/bin/bash
  2. echo -e "\n#######################################"
  3. echo -e "# Damn Vulnerable Web App Installer Script #"
  4. echo -e "#######################################"
  5. echo " Coded By: Travis Phillips"
  6. echo " Website: http://theunl33t.blogspot.com"
  7. echo -e -n "\n[*] Changing directory to /var/www..."
  8. cd /var/www > /dev/null
  9. echo -e "Done!\n"
  10.  
  11. echo -n "[*] Removing default index.html..."
  12. rm index.html > /dev/null
  13. echo -e "Done!\n"
  14.  
  15. echo -n "[*] Changing to Temp Directory..."
  16. cd /tmp
  17. echo -e "Done!\n"
  18.  
  19. echo "[*] Downloading DVWA..."
  20. wget http://voxel.dl.sourceforge.net/project/dvwa/DVWA-1.0.7.zip
  21. echo -e "Done!\n"
  22.  
  23. echo -n "[*] Unzipping DVWA..."
  24. unzip DVWA-1.0.7.zip > /dev/null
  25. echo -e "Done!\n"
  26.  
  27. echo -n "[*] Deleting the zip file..."
  28. rm DVWA-1.0.7.zip > /dev/null
  29. echo -e "Done!\n"
  30.  
  31. echo -n "[*] Copying dvwa to root of Web Directory..."
  32. cp -R dvwa/* /var/www > /dev/null
  33. echo -e "Done!\n"
  34.  
  35. echo -n "[*] Clearing Temp Directory..."
  36. rm -R dvwa > /dev/null
  37. echo -e "Done!\n"
  38.  
  39. echo -n "[*] Enabling Remote include in php.ini..."
  40. cp /etc/php5/apache2/php.ini /etc/php5/apache2/php.ini1
  41. sed -e 's/allow_url_include = Off/allow_url_include = On/' /etc/php5/apache2/php.ini1 > /etc/php5/apache2/php.ini
  42. rm /etc/php5/apache2/php.ini1
  43. echo -e "Done!\n"
  44.  
  45. echo -n "[*] Enabling write permissions to /var/www/hackable/upload..."
  46. chmod 777 /var/www/hackable/uploads/
  47. echo -e "Done!\n"
  48.  
  49. echo -n "[*] Starting Web Service..."
  50. service apache2 start &> /dev/null
  51. echo -e "Done!\n"
  52.  
  53. echo -n "[*] Starting MySQL..."
  54. service mysql start &> /dev/null
  55. echo -e "Done!\n"
  56.  
  57. echo -n "[*] Updating Config File..."
  58. cp /var/www/config/config.inc.php /var/www/config/config.inc.php1
  59. sed -e 's/'\'\''/'\''toor'\''/' /var/www/config/config.inc.php1 > /var/www/config/config.inc.php
  60. rm /var/www/config/config.inc.php1
  61. echo -e "Done!\n"
  62.  
  63. echo -n "[*] Updating Database..."
  64. wget --post-data "create_db=Create / Reset Database" http://127.0.0.1/setup.php &> /dev/null
  65. mysql -u root --password='toor' -e 'update dvwa.users set avatar = "/hackable/users/gordonb.jpg" where user = "gordonb";'
  66. mysql -u root --password='toor' -e 'update dvwa.users set avatar = "/hackable/users/smithy.jpg" where user = "smithy";'
  67. mysql -u root --password='toor' -e 'update dvwa.users set avatar = "/hackable/users/admin.jpg" where user = "admin";'
  68. mysql -u root --password='toor' -e 'update dvwa.users set avatar = "/hackable/users/pablo.jpg" where user = "pablo";'
  69. mysql -u root --password='toor' -e 'update dvwa.users set avatar = "/hackable/users/1337.jpg" where user = "1337";'
  70. echo -e "Done!\n"
  71.  
  72. echo -e -n "[*] Starting Firefox to DVWA\nUserName: admin\nPassword: password"
  73. firefox http://127.0.0.1/login.php &> /dev/null &
  74. echo -e "\nDone!\n"
  75. echo -e "[\033[1;32m*\033[1;37m] DVWA Install Finished!\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement