DVWA 安装

Platform: 4.15.0-kali2-amd64


DVWA安装

  • Kali Linux 默认安装了 Apache2, MySQL 和 PHP, 不需要重复安装
root@server2:/var/www/html# apachectl -v
Server version: Apache/2.4.29 (Debian)
Server built:   2018-01-14T11:01:58

root@server2:/var/www/html# mysql --version
mysql  Ver 15.1 Distrib 10.1.29-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

root@server2:/var/www/html# php --version
PHP 7.2.3-1 (cli) (built: Mar  6 2018 11:15:04) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.3-1, Copyright (c) 1999-2018, by Zend Technologies

  • 在 /var/www/html  目录下clone DVWA文件
root@server2:/var/www/html# git clone https://github.com/ethicalhack3r/DVWA.git
root@server2:/var/www/html# ls
DVWA  index.html  index.nginx-debian.html

  • 启动 MySQL: /etc/init.d/mysql start
  • 连接 MySQL,并添加 database
root@server2:/var/www/html# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 34
Server version: 10.1.29-MariaDB-6 Debian buildd-unstable


Copyright (c) 2000, 2017, 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;
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| dvwa               |
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
  • 添加 user
MariaDB [(none)]> grant all privileges on *.* to dvwa@localhost identified by 'dvwa123';
MariaDB [(none)]> select user from mysql.user;
+------+
| user |
+------+
| dvwa |
| root |
+------+
2 rows in set (0.00 sec)
MariaDB [(none)]> exit
Bye
  • DVWA 配置文件: root@server2:/var/www/html/DVWA/config# cp config.inc.php.dist config.inc.php
  • 修改配置文件 config.inc.php
# Database variables
#   WARNING: The database specified under db_database WILL BE ENTIRELY DELETED during setup.
#   Please use a database dedicated to DVWA.
#
# If you are using MariaDB then you cannot use root, you must use create a dedicated DVWA user.
#   See README.md for more information on this.
$_DVWA = array();
$_DVWA[ 'db_server' ]   = '127.0.0.1';
$_DVWA[ 'db_database' ] = 'dvwa';
$_DVWA[ 'db_user' ]     = 'dvwa';
$_DVWA[ 'db_password' ] = 'dvwa123';
  • 启动 apache2: systemctl start apache2
  • 访问 http://localhost/DVWA/index.php
  • 点击 Create/Reset Database 按钮,提示数据库创建成功
  • DVWA 安装完成,默认用户名/密码: admin/password
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值