{"id":4634,"date":"2019-11-14T19:26:13","date_gmt":"2019-11-14T16:26:13","guid":{"rendered":"https:\/\/kifarunix.com\/?p=4634"},"modified":"2024-03-12T23:16:45","modified_gmt":"2024-03-12T20:16:45","slug":"install-and-setup-dvwa-on-debian-10","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-and-setup-dvwa-on-debian-10\/","title":{"rendered":"Install and Setup DVWA on Debian 10"},"content":{"rendered":"\n<p>Want to shape your skills on web application security? Well how about you play around with <a href=\"http:\/\/www.dvwa.co.uk\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Damn Vulnerable Web Application (opens in a new tab)\">Damn Vulnerable Web Application<\/a>? Follow through this guide to learn how to install and setup DVWA on Debian 10 Buster as a legal environment to run your tests.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing DVWA on Debian 10<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Run System Update<\/h3>\n\n\n\n<p>To begin with, ensure that your system packages are up-to-date.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt upgrade<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install LAMP Stack on Debian 10<\/h3>\n\n\n\n<p>One of the major requirements for setting up DVWA lab is to have LAMP Stack up and running. Follow the guides below to learn how to install LAMP stack on Debian 10 Buster.<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\"Install LAMP Stack with MariaDB 10 on Debian 10 (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-lamp-stack-with-mariadb-10-on-debian-10-buster\/\" target=\"_blank\">Install LAMP Stack with MariaDB 10 on Debian 10<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create DVWA Database and Database User<\/h3>\n\n\n\n<p>Once the LAMP stack installation is done, proceed to create MariaDB DVWA database and database user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>Create DVWA database. Replace the database name accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>create database dvwa;<\/code><\/pre>\n\n\n\n<p>Create DVWA database user and grant all privileges. Replace the database user accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>grant all on dvwa.* to <strong>dvwauser<\/strong>@localhost identified by '<strong>Str0nGp@ssword<\/strong>';<\/code><\/pre>\n\n\n\n<p>Reload the privileges table and exit the database.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>flush privileges;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>quit<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install DVWA on Debian 10<\/h3>\n\n\n\n<p>Download and  install DVWA on the Apache web root directory,<strong><code>\/var\/www\/html<\/code><\/strong>.<\/p>\n\n\n\n<p>Remove the default Apache <code>index.html<\/code> file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rm -rf \/var\/www\/html\/index.html<\/code><\/pre>\n\n\n\n<p>Clone the latest version of the DVWA&nbsp;to Apache default web root directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install git vim<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>git clone https:\/\/github.com\/ethicalhack3r\/DVWA \/var\/www\/html\/<\/code><\/pre>\n\n\n\n<p>Check the contents of <code>\/var\/www\/html\/<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ls \/var\/www\/html\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>about.php     config\t   docs  external     hackable\t   index.php\t     login.php\t phpinfo.php  README.md   security.php\tvulnerabilities\nCHANGELOG.md  COPYING.txt  dvwa  favicon.ico  ids_log.php  instructions.php  logout.php  php.ini      robots.txt  setup.php<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configure DVWA on Debian 10 Buster<\/h3>\n\n\n\n<p>Configure DVWA database connection details. Begin by renaming the sample configuration file <strong><code>\/var\/www\/html\/config\/config.inc.php.dist<\/code><\/strong> to&nbsp;<strong><code>\/var\/www\/html\/config\/config.inc.php<\/code><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cp \/var\/www\/html\/config\/config.inc.php.dist \/var\/www\/html\/config\/config.inc.php<\/code><\/pre>\n\n\n\n<p>Next, edit the configuration file,&nbsp;<strong><code>\/var\/www\/html\/config\/config.inc.php<\/code><\/strong> and set the database connection details.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/var\/www\/html\/config\/config.inc.php<\/code><\/pre>\n\n\n\n<p>Replace the database and database user and the password accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>...\n# Database variables\n#   WARNING: The database specified under db_database WILL BE ENTIRELY DELETED during setup.\n#   Please use a database dedicated to DVWA.\n#\n# If you are using MariaDB then you cannot use root, you must use create a dedicated DVWA user.\n#   See README.md for more information on this.\n$_DVWA = array();<strong>\n$_DVWA[ 'db_server' ]   = '127.0.0.1';\n$_DVWA[ 'db_database' ] = 'dvwa';\n$_DVWA[ 'db_user' ]     = 'dvwauser';\n$_DVWA[ 'db_password' ] = 'Str0nGp@ssword';<\/strong>\n...<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install reCAPTCHA keys<\/h3>\n\n\n\n<p>Generate recapture values from&nbsp;<a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.google.com\/recaptcha\/admin\" target=\"_blank\">Google service<\/a>.<\/p>\n\n\n\n<p>Once generated, simply copy and paste the <strong>site key<\/strong> and <strong>site secret key<\/strong> to <strong><code>$_DVWA[ 'recaptcha_public_key' ]<\/code><\/strong> and <code><strong>$_DVWA[ 'recaptcha_private_key' ]<\/strong><\/code> respectively.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>...\n# ReCAPTCHA settings\n#   Used for the 'Insecure CAPTCHA' module\n#   You'll need to generate your own keys at: https:\/\/www.google.com\/recaptcha\/admin\n<strong>$_DVWA[ 'recaptcha_public_key' ]  = '6Lc4BsMUAAAAAKs72dKl4ZTVsA8giXiN7yqQcoVz';\n$_DVWA[ 'recaptcha_private_key' ] = '6Lc4BsMUAAAAAI9v0sd_xvlh_PMXTcgtqRYJ6VEd';<\/strong>\n...<\/code><\/pre>\n\n\n\n<p>Save and exit the configuration file and restart MariaDB<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart mariadb<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configure PHP<\/h3>\n\n\n\n<p>Install Required PHP-GD module.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install php-gd<\/code><\/pre>\n\n\n\n<p>The version PHP installed in our case here is 7.3.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>php -v<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>PHP 7.3.11-1~deb10u1 (cli) (built: Oct 26 2019 14:14:18) ( NTS )\nCopyright (c) 1997-2018 The PHP Group\nZend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies\n    with Zend OPcache v7.3.11-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies<\/code><\/pre>\n\n\n\n<p>Proceed to edit <strong><code><strong>\/etc\/php\/7.3\/apache2\/php.ini<\/strong><\/code><\/strong>&nbsp;and make the following changes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/etc\/php\/7.3\/apache2\/php.ini<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>allow_url_include = on<\/code>&nbsp;\u2013 Allows for Remote File Inclusions (RFI)<\/li>\n\n\n\n<li><code>allow_url_fopen = on<\/code>&nbsp;\u2013 Allows for Remote File Inclusions (RFI)<\/li>\n\n\n\n<li><code>display_errors = off<\/code>&nbsp;\u2013 (Optional) Hides PHP warning messages to make it less verbose<\/li>\n<\/ul>\n\n\n\n<p>Save and quit the PHP configuration file<\/p>\n\n\n\n<p>Set the ownership of the DVWA web root directory to Web server user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chown -R www-data:www-data \/var\/www\/html<\/code><\/pre>\n\n\n\n<p>Restart Apache<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart apache2<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Complete DVWA Setup from Browser<\/h3>\n\n\n\n<p>Navigate to the web browser and access your DVWA using the address, <strong><code>http:\/\/server-IP\/login.php<\/code><\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1051\" height=\"345\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/11\/dvwa-login.png\" alt=\"Setup DVWA on Debian 10\" class=\"wp-image-4642\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/11\/dvwa-login.png?v=1574007439 1051w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/11\/dvwa-login-768x252.png?v=1574007439 768w\" sizes=\"(max-width: 1051px) 100vw, 1051px\" \/><\/figure>\n\n\n\n<p>Login using the default credentials: <strong>admin:password<\/strong>.<\/p>\n\n\n\n<p>On the status check page, ensure that you fix any check whose status is red.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/11\/dvwa_setup.png\"><img loading=\"lazy\" decoding=\"async\" width=\"540\" height=\"630\" data-id=\"4643\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/11\/dvwa_setup.png\" alt=\"\" class=\"wp-image-4643\" title=\"\"><\/a><\/figure>\n<\/figure>\n\n\n\n<p>Next, click <strong>Create\/Reset Database<\/strong> at the bottom to setup the DVWA database. If the database already exists, it will be reset. After that, you are then taken to the Login screen.<\/p>\n\n\n\n<p>Login again using the default credentials provided above. You should now land on DVWA welcome page.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/11\/dvwa-welcome-page.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1097\" height=\"859\" data-id=\"4644\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/11\/dvwa-welcome-page.png\" alt=\"\" class=\"wp-image-4644\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/11\/dvwa-welcome-page.png?v=1574007544 1097w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/11\/dvwa-welcome-page-768x601.png?v=1574007544 768w\" sizes=\"(max-width: 1097px) 100vw, 1097px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p>There you go. You have successfully setup Damn Vulnerable web application Lab on Debian 10. You can now run web application security testings. Enjoy.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Related Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-setup-damn-vulnerable-web-app-lab-on-ubuntu-18-04-server\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">How to Install and Configure DVWA Lab on Ubuntu 18.04 server<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/how-to-install-and-use-nikto-web-scanner-on-ubuntu-18-04\/\" target=\"_blank\">How to Install and Use Nikto Web Scanner on Ubuntu 18.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-openvas-10-gvm-on-debian-10-buster\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install OpenVAS 10 (GVM) on Debian 10 Buster<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to shape your skills on web application security? Well how about you play around with Damn Vulnerable Web Application? Follow through this guide to<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,254,34],"tags":[997,222,1205],"class_list":["post-4634","post","type-post","status-publish","format-standard","hentry","category-howtos","category-apache","category-security","tag-debian-10","tag-dvwa","tag-dvwa-debian-10","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4634"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=4634"}],"version-history":[{"count":6,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4634\/revisions"}],"predecessor-version":[{"id":21261,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4634\/revisions\/21261"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=4634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=4634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=4634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}