{"id":9653,"date":"2021-07-12T22:03:26","date_gmt":"2021-07-12T19:03:26","guid":{"rendered":"https:\/\/kifarunix.com\/?p=9653"},"modified":"2024-03-18T19:38:59","modified_gmt":"2024-03-18T16:38:59","slug":"install-and-setup-dvwa-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-and-setup-dvwa-on-rocky-linux-8\/","title":{"rendered":"Install and Setup DVWA on Rocky Linux 8"},"content":{"rendered":"\n
If you want to play around with Damn Vulnerable Web Application<\/a>, then follow through this guide to learn how to install and setup DVWA on Rocky Linux 8 as a legal environment to run your web application security tests.<\/p>\n\n\n\n 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 Rocky Linux 8.<\/p>\n\n\n\n Note that we use PHP 7.4.<\/p>\n\n\n\n Install LAMP Stack with MariaDB 10 on Rocky Linux 8<\/a><\/p>\n\n\n\n Install additional PHP modules and other packages;<\/p>\n\n\n\n Once the LAMP stack installation is done, proceed to create MariaDB DVWA database and database user.<\/p>\n\n\n\n Create DVWA database. Replace the database name accordingly.<\/p>\n\n\n\n Create DVWA database user and grant all privileges. Replace the database user accordingly.<\/p>\n\n\n\n Reload the privileges table and exit the database.<\/p>\n\n\n\n Clone the latest version of the DVWA to Apache default web root directory, Check the contents of Begin by renaming the sample configuration file Next, edit the configuration file, Replace the database and database user and the password accordingly.<\/p>\n\n\n\n…\n Generate recapture values from Google service<\/a>.<\/p>\n\n\n\n Once generated, simply copy and paste the site key<\/strong> and site secret key<\/strong> to Save and exit the configuration file.<\/p>\n\n\n\n Restart MariaDB<\/p>\n\n\n\n The version PHP installed in our case here is 7.4.<\/p>\n\n\n\n Proceed to edit Save and quit the PHP configuration file<\/p>\n\n\n\n Set the ownership of the DVWA web root directory to Web server user.<\/p>\n\n\n\n Restart Apache and MariaDB<\/p>\n\n\n\n You might experience that the apache web server user might not be allowed to write Such errors as:<\/p>\n\n\n\n To fix this, we simply set SELinux to permissive.<\/p>\n\n\n\n sed -i ‘s\/=enforcing\/=permissive\/’ \/etc\/selinux\/config<\/p>\n\n\n\n Navigate to the web browser and access your DVWA using the address, On the status check page, ensure that you fix any check whose status is red.<\/p>\n\n\n\n Next, click Create\/Reset Database<\/strong> at the bottom to setup the DVWA database. If the database already exists, it will be reset.<\/p>\n\n\n\n After that, you are then taken to the Login screen.<\/p>\n\n\n\n Login using the default credentials: admin:password<\/strong>.<\/p>\n\n\n\n You should now land on DVWA welcome page.<\/p>\n\n\n\n There you go. That is it on how to setup DVWA on Rocky Linux 8. You can now run web application security testings as you wish. Enjoy.<\/p>\n\n\n\n Detecting Malicious Files with Wazuh and VirusTotal<\/a><\/p>\n\n\n\n Install and Use Nikto Web Scanner on Ubuntu 18.04<\/a><\/p>\n\n\n\nInstalling DVWA on Rocky Linux 8<\/h2>\n\n\n\n
Install LAMP Stack on Rocky Linux 8<\/h3>\n\n\n\n
dnf install php-gd git vim<\/code><\/pre>\n\n\n\n
Create DVWA Database and Database User<\/h3>\n\n\n\n
mysql -u root -p<\/code><\/pre>\n\n\n\n
create database dvwa;<\/code><\/pre>\n\n\n\n
grant all on dvwa.* to dvwauser<\/strong>@localhost identified by 'Str0nGp@ssword<\/strong>';<\/code><\/pre>\n\n\n\n
flush privileges;<\/code><\/pre>\n\n\n\n
quit<\/code><\/pre>\n\n\n\n
Install DVWA on Rocky Linux 8<\/h3>\n\n\n\n
\/var\/www\/html<\/code><\/strong>.<\/p>\n\n\n\n
git clone https:\/\/github.com\/digininja\/DVWA.git \/var\/www\/html\/<\/code><\/pre>\n\n\n\n
\/var\/www\/html\/<\/code>.<\/p>\n\n\n\n
ls -1 \/var\/www\/html\/<\/code><\/pre>\n\n\n\n
about.php\nCHANGELOG.md\nconfig\nCOPYING.txt\ndocs\ndvwa\nexternal\nfavicon.ico\nhackable\nids_log.php\nindex.php\ninstructions.php\nlogin.php\nlogout.php\nphpinfo.php\nphp.ini\nREADME.md\nREADME.zh.md\nrobots.txt\nsecurity.php\nsetup.php\ntests\nvulnerabilities\n<\/code><\/pre>\n\n\n\n
Configure DVWA on Rocky Linux 8<\/h3>\n\n\n\n
Setup DVWA Database Connection<\/h4>\n\n\n\n
\/var\/www\/html\/config\/config.inc.php.dist<\/code><\/strong> to
\/var\/www\/html\/config\/config.inc.php<\/code><\/strong><\/p>\n\n\n\n
cp \/var\/www\/html\/config\/config.inc.php{.dist,}<\/code><\/pre>\n\n\n\n
\/var\/www\/html\/config\/config.inc.php<\/code><\/strong> and set the database connection details.<\/p>\n\n\n\n
vim \/var\/www\/html\/config\/config.inc.php<\/code><\/pre>\n\n\n\n
# Database variables\n...\n
Install reCAPTCHA keys<\/h4>\n\n\n\n
$_DVWA[ 'recaptcha_public_key' ]<\/code><\/strong> and
$_DVWA[ 'recaptcha_private_key' ]<\/strong><\/code> respectively.<\/p>\n\n\n\n…\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$_DVWA[ 'recaptcha_public_key' ] = '6Lc4BsMUAAAAAKs72dKl4ZTVsA8giXiN7yqQcoVz';\n$_DVWA[ 'recaptcha_private_key' ] = '6Lc4BsMUAAAAAI9v0sd_xvlh_PMXTcgtqRYJ6VEd';<\/strong>\n<\/code><\/pre>\n…\n\n\n\n
systemctl restart mariadb<\/code><\/pre>\n\n\n\n
Configure PHP<\/h3>\n\n\n\n
php -v<\/code><\/pre>\n\n\n\n
PHP 7.4.6 (cli) (built: May 12 2020 08:09:15) ( NTS )\nCopyright (c) The PHP Group\nZend Engine v3.4.0, Copyright (c) Zend Technologies\n with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies<\/code><\/pre>\n\n\n\n
\/etc\/php.ini<\/strong><\/code><\/strong> and make the following changes.<\/p>\n\n\n\n
vim \/etc\/php.ini<\/code><\/pre>\n\n\n\n
\n
allow_url_include = On<\/code> \u2013 Allows for Remote File Inclusions (RFI)<\/li>\n\n\n\n
allow_url_fopen = On<\/code> \u2013 Allows for Remote File Inclusions (RFI)<\/li>\n\n\n\n
display_errors = Off<\/code> \u2013 (Optional) Hides PHP warning messages to make it less verbose<\/li>\n<\/ul>\n\n\n\n
chown -R apache: \/var\/www\/html<\/code><\/pre>\n\n\n\n
systemctl restart httpd mariadb<\/code><\/pre>\n\n\n\n
Configure SELinux<\/h4>\n\n\n\n
\/var\/www\/html\/external\/phpids\/0.6\/lib\/IDS\/tmp\/phpids_log.txt<\/code> as well as on the directory,
\/var\/www\/html\/config<\/code>. <\/p>\n\n\n\n
\n
setenforce 0<\/code><\/pre>\n\n\n\n
Complete DVWA Setup from Browser<\/h3>\n\n\n\n
http:\/\/server-IP<\/code><\/strong>.<\/p>\n\n\n
<\/figure><\/div>\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n