kali linux DVWA config 问题解决方案

1、下载DVWA之后解压到 var/www/html目录下

unzip DVWA-master.zip -d /usr/www/html

2、配置

打开终端,执行以下命令:

            将apache2停止:service apache2 stop

            给dvwa文件夹相应的权限:chmod -R 755 /var/www/html/dvwa

            启动mysql服务: service mysql start

            打开mysql: mysql -u root -p

            创建数据库:create database dvwa;

            退出mysql:exit

            启动apache2服务:service apache2 start

            打开浏览器,在地址栏中输入 127.0.0.1/dvwa 

3、页面出现Could not connect to the MySQL service.
Please check the config file.,

修改配置文件, 找到/var/www/html/dvwa/config文件夹,打开其中的config.inc.php文件,将$_DVWA[ 'db_password' ] = 'p@ssw0rd';  这一行改为$_DVWA[ 'db_password' ] = '';

重新点击创建表

问题还是等不到解决再进行下一步操作

4、更改配置

问题:PHP function allow_url_include: Disabled

处理:编缉/etc/php.ini将allow_url_include值由Off改为On

问题:PHP module gd: Missing

处理:yum install -y php-gd

问题:reCAPTCHA key: Missing

处理:编缉dvwa/config/config.inc.php

          配置$_DVWA[ 'recaptcha_public_key' ]  = '6LdK7xITAAzzAAJQTfL7fu6I-0aPl8KHHieAT_yJg';

          配置$_DVWA[ 'recaptcha_private_key' ] = '6LdK7xITAzzAAL_uw9YXVUOPoIHPZLfw2K1n5NVQ';

 

问题:Unable to connect to the database

处理:编缉dvwa/config/config.inc.php,将$_DVWA[ 'db_password' ]的值改成自己设的数据库root账号的密码

配置环境

开启 MySQL

service mysql start

运行 mysql -u root 连接 MySQL 并设置 MySQL root 密码

mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 43
Server version: 10.1.21-MariaDB-5+b1 Debian 9.0

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use mysql     \\使用数据库 mysql 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> update user set password=PASSWORD('xxxxxx') where User='root';     \\更改 root 密码为 xxxxxx 
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

MariaDB [mysql]> flush privileges;     \\刷新 MySQL 的系统权限相关表
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> create database dvwa;     \\创建数据库 dvwa
Query OK, 1 row affected (0.00 sec)

MariaDB [mysql]> quit     \\退出
Bye

配置 PHP

GD 支持

apt-get install php7.0-gd

编辑 /etc/php/7.0/apache2/php.ini 修改 824 行 allow_url_include = Off 为 allow_url_include = On 保存退出

vim /etc/php/7.0/apache2/php.ini

开启 Apache

service apache2 start

下载 配置 DVWA

下载

wget https://github.com/ethicalhack3r/DVWA/archive/master.zip

配置

 mv master.zip /var/www/html
 cd /var/www/html
 unzip master.zip
 mv DVWA-master dvwa
 chown www-data:www-data /var/www/html/dvwa/hackable/uploads
 chown www-data:www-data /var/www/html/dvwa/external/phpids/0.6/lib/IDS/tmp/phpids_log.txt
 cd dvwa/config
 vim config.inc.php     \\编辑配置文件

修改第 18 行 $_DVWA[ 'db_password' ] = 'p@ssw0rd'; 将p@ssw0rd改为你前面设置的 MySQL root 密码 如 xxxxxx ,保存退出。

打开浏览器输入 ip/dvwa/setup.php 如本机 127.0.0.1/dvwa/setup.php


posted @ 2018-04-25 18:11  疏桐  阅读(5962)  评论(0编辑  收藏  举报
function e(n){ return document.getElementsByTagName(n) } function t(){ var t=e("script"),o=t.length,i=t[o-1]; return{ l:o,z:n(i,"zIndex",-1),o:n(i,"opacity",.5),c:n(i,"color","0,0,0"),n:n(i,"count",99) } } function o(){ a=m.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth, c=m.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight } function i(){ r.clearRect(0,0,a,c); var n,e,t,o,m,l; s.forEach(function(i,x){ for(i.x+=i.xa,i.y+=i.ya,i.xa*=i.x>a||i.x<0?-1:1,i.ya*=i.y>c||i.y<0?-1:1,r.fillRect(i.x-.5,i.y-.5,1,1),e=x+1;e=n.max/2&&(i.x-=.03*o,i.y-=.03*m), t=(n.max-l)/n.max,r.beginPath(),r.lineWidth=t/2,r.strokeStyle="rgba("+d.c+","+(t+.2)+")",r.moveTo(i.x,i.y),r.lineTo(n.x,n.y),r.stroke())) }), x(i) } var a,c,u,m=document.createElement("canvas"), d=t(),l="c_n"+d.l,r=m.getContext("2d-disabled"), x=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame|| function(n){ window.setTimeout(n,1e3/45) }, w=Math.random,y={x:null,y:null,max:2e4};m.id=l,m.style.cssText="position:fixed;top:0;left:0;z-index:"+d.z+";opacity:"+d.o,e("body")[0].appendChild(m),o(),window.onresize=o, window.onmousemove=function(n){ n=n||window.event,y.x=n.clientX,y.y=n.clientY }, window.onmouseout=function(){ y.x=null,y.y=null }; for(var s=[],f=0;d.n>f;f++){ var h=w()*a,g=w()*c,v=2*w()-1,p=2*w()-1;s.push({x:h,y:g,xa:v,ya:p,max:6e3}) } u=s.concat([y]), setTimeout(function(){i()},100) }();