DVWA漏洞环境搭建

记录一下,防止需要的时候再找。。。

Everyone has talent.What is rare is the courage to follow the talent to the dark place where it leads.

David LevithanWide Awake

首先安装Apache

Yum install –y httpd

启动Apache服务并设置服务器开机启动

Systemctl start httpd.service
Systemctl enable httpd.service

安装Mariadb

Yum install –y mariadb mariadb-server
Systemctl enable mariadb //开机启动
Systemctl start mariadb //启动服务

安装PHP环境

Yum install –y php
Yum install –y php-mysql //安装mysql的php支持
Yum install –y php71w-fpm php71w-opcache php71w-cli php71w-gd php71w-imap php71w-mysqlnd php71w-mbstring
php71w-mcrypt php71w-pdo php71w-pecl-apcu php71w-pecl-mongodb php71w-pecl-redis php71w-pgsql php71w-xml
php71w-xmlrpc php71w-devel mod_php71w //安装php7及其扩展

下载Dvwa测试环境

Wget https://github.com/ethicalhack3r/DVWA/archive/master.zip //下载dvwa
Unzip master.zip //解压master.zip
Mv DVWA-master /var/www/html/ //移动至Apache环境下
Chmod 777 /var/www/html/DVWA-master //更改目录权限,确保apache用户也可以方问该目录

关闭防火墙,selinux

Systemctl stop firewalld.service //关闭防火墙
Setenforce 0 //临时关闭selinux

dvwa配置文件设置,php allow_url_include设置

Cd /var/www/html/DVWA-master/config
Vim config.inc.php
修改数据库相关信息
Vim /etc/php.ini
Allow_url_include = on
开启测试环境的url_include设置