kali 2.0下搭建DVWA環境


DVWA (Dam Vulnerable Web Application)DVWA是用PHP+Mysql編寫的一套用於常規WEB漏洞教學和檢測的WEB脆弱性測試程序。包含了SQL注入、XSS、盲注等常見的一些安全漏洞,在kali linux下搭建DVWA非常方便,因為所需的apache2、mysql、php等環境在kali linux中默認已經安裝好了

搭建步驟:

1. 首先去github上下載DVWA的安裝包,網址為:

https://github.com/ethicalhack3r/DVWA
root@bigzero:~# git clone https://github.com/ethicalhack3r/DVWA.git

2. 將下載好的壓縮包解壓並改名為dvwa,然后將其復制到 /var/www/html 文件夾中

root@bigzero:~# mv DVWA /var/www/html
root@bigzero:~# mv /var/www/html/DVWA /var/www/html/dvwa

3. 打開終端,執行以下命令:

    給dvwa文件夾相應的權限:

root@bigzero:~# chmod -R 755 /var/www/html/dvwa
 啟動mysql數據庫(kali自帶的是10.1.26-MariaDB-1)
root@bigzero:~# /etc/init.d/mysql start

     登錄mysql(自帶的mariadb默認沒有密碼):

root@bigzero:~# mysql -uroot

     創建數據庫、創建授權連接數據庫的用戶名密碼:(mariadb新版本默認不能使用root連接數據庫):

create database dvwa;
grant all privileges on *.* to dvwa@127.0.0.1 identified by "xxxxxxxx";
#這里做漏洞測試環境,所以給的 "all" 權限,給的所有數據庫的權限 "*" 

      默認的DVWA的配置文件是config.inc.php.dist,需要修改為config.inc.php

root@bigzero:~# cd /var/www/html/dvwa/config/
root@bigzero:/var/www/html/dvwa/config# cp config.inc.php.dist config.inc.php

      編輯config.inc.php:

 

上面圖片中標錯了,密碼不是為空,密碼設置為grant授權的密碼

      啟動apache2:

root@bigzero:~# /etc/init.d/apache2 start

4、打開瀏覽器訪問127.0.0.1/dvwa

點擊Create/Reset Database等待幾秒后跳轉到登錄界面:

默認用戶名密碼是admin:password

相比舊版本增加了不少漏洞測試選項

至此,DVWA環境安裝成功。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM