环境准备
操作系统:centos7
系统环境xampp:php开发环境部署(xampp)-CSDN博客
dvwa下载:https://github.com/digininja/DVWA/archive/master.zip
dvwa部署
# 将dvwa文件上传到/opt/lampp/htdocs目录
[root@192 htdocs]# pwd
/opt/lampp/htdocs
[root@192 htdocs]# ll DVWA-master.zip
-rw-r--r--. 1 root root 890062 10月 28 21:37 DVWA-master.zip
[root@192 htdocs]#
# 解压DVWA-master.zip
unzip DVWA-master.zip
# 进入DVWA-master目录
cd DVWA-master
# 复制示例文件作为配置文件
[root@192 DVWA-master]# cp config/config.inc.php.dist config/config.inc.php
[root@192 DVWA-master]# ll config/
总用量 8
-rw-r--r--. 1 root root 2194 10月 29 19:34 config.inc.php
-rw-r--r--. 1 root root 2194 10月 11 16:22 config.inc.php.dist
[root@192 DVWA-master]#
# 修改目录权限
[root@192 ~]# chmod 777 /opt/lampp/htdocs/DVWA-master/hackable/uploads
[root@192 ~]# chmod 777 /opt/lampp/htdocs/DVWA-master/config
# 修改config/config.inc.php 文件配置:
# 生成值:https://www.google.com/recaptcha/admin/create
$_DVWA[ 'recaptcha_public_key' ] = '';
$_DVWA[ 'recaptcha_private_key' ] = '';
# 修改php配置文件
vi /opt/lampp/etc/php.ini
allow_url_include=On
display_errors=On
# 重启apache服务
/opt/lampp/bin/apachectl restart
# 配置数据库
[root@192 ~]# /opt/lampp/bin/mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 15
Server version: 10.4.28-MariaDB Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database dvwa;
Query OK, 1 row affected (0.002 sec)
MariaDB [(none)]> create user dvwa@localhost identified by 'p@ssw0rd';
Query OK, 0 rows affected (0.002 sec)
MariaDB [(none)]> grant all on dvwa.* to dvwa@localhost;
Query OK, 0 rows affected (0.002 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]>
# 重启服务
[root@192 ~]# /opt/lampp/lampp stop
Stopping XAMPP for Linux 8.2.4-0...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...ok.
[root@192 ~]# /opt/lampp/lampp start
Starting XAMPP for Linux 8.2.4-0...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
[root@192 ~]#
配置
访问网站配置页面:http://192.168.21.129/DVWA-master/setup.php
点击“Create / Reset Database”
输入admin,password进行登录
至此,dvwa部署完成
重要提示:dvwa仅用于网络安全测试,不要将dvwa部署到真实服务器上,本文采用vmware虚拟机部署,网卡使用nat模式