1.下载及解压
1.首先切到 /var/www/htm/ 文件夹下
cd /var/www/html
2.下载DVWA压缩包
wget https://github.com/digininja/DVWA/archive/master.zip
3.解压
unzip master.zip
2.DVWA配置
1.DVWA System error - config file not found. Copy config/config.inc.php.dist to config/config.inc.php configure to your environment.
cd DVWA-master/config
cp config.inc.php.dist config.inc.php
2.configure to your environment 问题1:权限设置 [User: root] Writable folder /var/www/html/DVWA-master/hackable/uploads/: No [User: root] Writable file /var/www/html/DVWA-master/external/phpids/0.6/lib/IDS/tmp/phpids_log.txt: No [User: root] Writable folder /var/www/html/DVWA-master/config: No
cd ..
chmod -R 777 /var/www/html/DVWA-master/hackable/uploads/
chmod -R 777 /var/www/html/DVWA-master/external/phpids/0.6/lib/IDS/tmp/
chmod -R 777 /var/www/html/DVWA-master/config/
问题2:配置php.ini文件 If you see disabled on either allow_url_fopen or allow_url_include, set the following in your php.ini file and restart Apache. 找到配置文件
cd /etc/php/7.4/apache2
vim php.ini
进入编辑后 利用/allow_ 找到 i并修改其为On如图 esc wq enter 保存退出
service apache2 stop
问题3:gd库下载 PHP module gd: Missing - Only an issue if you want to play with captchas
apt install php-gd
service apache2 stop
问题4:数据库配置
连接数据库
mysql -u root -p
在数据库中操作
create database dvwa;
create user dvwa@localhost identified by 'passwd'; 此处的密码需要修改到配置文件config.inc.php中
grant all on dvwa.* to dvwa@localhost;
flush privileges;
问题5:配置config.inc.php文件与数据库一致
cd /var/www/html/DVWA-master/config
vim config.inc.php
进入编辑后 修改db_passwd esc wq enter 保存退出
3.测试
http://127.0.0.1/DVWA-master/ 成功!
相关命令
启动
service apache2 start 或者 systemcti start apache2
关闭
service apache2 stop
重启
service apache2 restart
设置开机自启
systemcti enable apache2
|