参考
-
部署环境
Windows Server 2022
- phpStudy-x64-2016.11.03
- DVWA v1.10
登录信息
| | 账号 | 密码 | | —- | —- | —- | | DVWA | admin | password | | phpStudy MySQL/phpMyAdmin | root | root |
部署过程
1)解压 DVWA 文件到 phpStudy 网站根目录:D:\phpStudy\WWW\DVWA
2)创建 DVWA 配置文件:copy D:\phpStudy\WWW\DVWA\config\config.inc.php.dist D:\phpStudy\WWW\DVWA\config\config.inc.php
3)修改 DVWA 配置文件
# 1)修改 MySQL 连接账号密码
$_DVWA = array();
$_DVWA[ 'db_server' ] = '127.0.0.1';
$_DVWA[ 'db_database' ] = 'dvwa';
$_DVWA[ 'db_user' ] = 'root'; // phpStudy MySQL 默认账号
$_DVWA[ 'db_password' ] = 'root'; // phpStudy MySQL 默认密码
$_DVWA[ 'db_port'] = '3306';
# 2)设置 Google ReCAPTCHA 验证码系统
# ReCAPTCHA settings
# Used for the 'Insecure CAPTCHA' module
# You'll need to generate your own keys at: https://www.google.com/recaptcha/admin
$_DVWA[ 'recaptcha_public_key' ] = '6LdSdcoeAAAAAI6wPAUxnjQMcQ_8MogGsi1Wn4eW'; // 可自行生成,或使用我生成的
$_DVWA[ 'recaptcha_private_key' ] = '6LdSdcoeAAAAAM4FRMcHdOMWuikiG5x4nKdOoklT';
# 3)解决 Command Injection 出现的乱码
// Send Headers + main HTML code
Header( 'Cache-Control: no-cache, must-revalidate'); // HTTP/1.1
Header( 'Content-Type: text/html;charset=gbk' ); // 字符集修改为 gbk(默认为 utf-8)
Header( 'Expires: Tue, 23 Jun 2009 12:00:00 GMT' ); // Date in the past
4)启用 PHP 功能 allow_url_include
5)创建 DVWA 数据库,访问 http://localhost/dvwa/setup.php 操作
6)登录 DVWA:http://localhost/dvwa