DVWA靶场CentOS

安装

[root@localhost ~]# yum -y install httpd mariadb mariadb-server php php-mysql php-gd git
[root@localhost ~]# systemctl enable mariadb && systemctl restart mariadb
[root@localhost ~]# systemctl enable httpd && systemctl restart httpd

设置数据库密码

[root@localhost ~]# mysqladmin -u root password '123456'		# 设置Mariadb密码为123456
[root@localhost ~]# mysql -u root -p
#####################################################################################
MariaDB [(none)]> create database dvwa character set utf8;                  		#
MariaDB [(none)]> show databases;													#
MariaDB [(none)]> grant all on dvwa.*to dvwa@localhost identified by '123456';		#
MariaDB [(none)]> flush privileges;													#
#####################################################################################

下载dvwa,然后备份

[root@localhost ~]# git clone https://github.com/lscq/dvwa.git
[root@localhost ~]# cp -r dvwa /var/www/html/
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# chmod 755 -R dvwa
[root@localhost ~]# cp /etc/php.ini /etc/php.ini.bak
[root@localhost ~]# cd /var/www/html/dvwa/config/
[root@localhost config]# cp config.inc.php.dist config.inc.php

修改配置文件

[root@localhost ~]# vim /etc/php.ini
allow_url_include = On
[root@localhost ~]# vim /var/www/html/dvwa/config/config.inc.php
$_DVWA[ 'db_password' ] = '123456';
$_DVWA[ 'recaptcha_public_key' ]  = '6LdK7xITAAzzAAJQTfL7fu6I-0aPl8KHHieAT_yJg';
$_DVWA[ 'recaptcha_private_key' ] = '6LdK7xITAzzAAL_uw9YXVUOPoIHPZLfw2K1n5NVQ';

防火墙

[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0

打开浏览器:http://ip/dvwa/setup.php

DVWA靶场CentOS_第1张图片

默认用户:admin 默认密码:password

DVWA靶场CentOS_第2张图片

你可能感兴趣的:(DVWA靶场)