kali下DVWA靶场的搭建

本文档详细介绍了DVWA(Damn Vulnerable Web Application)的下载、解压、配置过程,包括权限设置、php.ini文件配置、GD库安装、数据库连接以及config.inc.php的修改。最后,提供了测试和启动DVWA的步骤,帮助读者成功搭建一个用于安全学习的Web应用。
摘要由CSDN通过智能技术生成

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Andrewlong_lhl

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值