1.下载DVWA:
root@kali: git clone https://github.com/ethicalhack3r/DVWA.git
2.下载完成后复制到/var/www/html目录下:
root@kali:cp -r DVWA /var/www/html
3.赋予权限:
root@kali:cd /var/www/html
root@kali:chmod 755 -R DVWA
4.修改默认配置文件
root@kali: cd DVWA
root@kali: cp config.inc.php.dist config.inc.php
5.另外开启一个终端启动apache2和mysql
root@kali:service apache2 start
root@kali:service mysql start
查看端口状态
root@kali:netstat -anpt | grep 80
root@kali:netstat -anpt | grep 3306
6.登录mysql创建库并授权
root@kali:mysql -u root
MariaDB [(none)]> create database dvwa;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| dvwa |
| information_schema |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.000 sec)
MariaDB [(none)]> grant all privileges on *.* to [email protected] identified by "Qwer4321";
Query OK, 0 rows affected (0.042 sec)
MariaDB [(none)]> exit;
7.修改配置文件并保存:
root@kali:vim config.inc.php
$_DVWA[ 'db_user'] ='dvwa';
$_DVWA[ 'db_password'] = 'Qwer4321';
8.浏览器进入设置界面:
http://127.0.0.1/DVWA/setup.php
点击creat/reset database
9.登录DVWA
http://127.0.0.1/DVWA/index.php
admin/password
至此,渗透测试本地环境部署完成
但有些模块还未配置,还需要配置一下并重启下apache2
配置PHP,GD支持
apt-get install php-gd
修改php配置文件
找到 '' /etc/php/7.2/apache2/ '' 文件夹,用文档编辑器打开 '' php.ini '' 文件
更改如下两项:
''allow_url_include=Off'' 改为 ''allow_url_include=On''
''display_errors=Off'' 改为 ''display_errors=On''
在DVWA中测试Insecure CAPTCHA不安全的验证码关卡时,出现报错:
出现该问题是因为使用reCAPTCHA没有申请密钥,因此需要手动填入密钥,编辑提示的配置文件
vim config.inc.php
找到
$_DVWA[ 'recaptcha_public_key' ] = '';
$_DVWA[ 'recaptcha_private_key' ] = '';
修改如下配置:
$_DVWA[ 'recaptcha_public_key' ] = '6LdK7xITAAzzAAJQTfL7fu6I-0aPl8KHHieAT_yJg';
$_DVWA[ 'recaptcha_private_key' ] = '6LdK7xITAzzAAL_uw9YXVUOPoIHPZLfw2K1n5NVQ';
即可。
最后重启apahce2:
root@kali:servcie apache2 restart;