DVWA学习笔记

  • 2019年1月19日
  • CTF, Security, ...
  • visibility 1,506 views

1 什么是DVWA?

Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application that is damn vulnerable. Its main goal is to be an aid for security professionals to test their skills and tools in a legal environment, help web developers better understand the processes of securing web applications and to aid both students & teachers to learn about web application security in a controlled class room environment.

The aim of DVWA is to practice some of the most common web vulnerabilities, with various levels of difficulty, with a simple straightforward interface. Please note, there are both documented and undocumented vulnerabilities with this software. This is intentional. You are encouraged to try and discover as many issues as possible.

简单来说,就是个靶子。随便搞,搞完了重建就好。

DVWA main page

官网:http://dvwa.co.uk/

2 搭建DVWA

搭建方法有多种,但最方便的还是直接在docker里搭建,容易恢复,又不怕伤到宿主机。(可以在VPS里搭建,也可以在本地开个VM虚拟机,装上linux或者windows,再在VM虚拟机里面装docker,网络调成桥接模式。)(docker是什么?是一种虚拟化技术,剩下的百度去)

如何安装docker?参见官网的指南:https://docs.docker.com/install/

注意!国内linux主机先换源!(软件更新源)默认的源为国外的官方源,速度不是很理想。推荐使用清华或中科大的源。否则你极有可能将会消耗非常长的时间。

百度一下:xxx(你的linux系统名和版本号) 换源
如:Ubuntu 18.04 换源

Ubuntu、Debian这一类用apt管理软件的系统,源链接存在/etc/apt/sources.list,换完记得sudo apt-get update

新的centOS都会有自动选择最快的mirror

一键安装docker:(官网提供的脚本,支持CentOS, fedora, Ubuntu, debian, raspbian)
curl -fsSL https://get.docker.com -o get-docker.sh

sudo sh get-docker.sh

如果提示curl : command not found
debian, Ubuntu: sudo apt-get install curl
CentOS: yum install curl -y

如果提示某某文件被占用(… was locked)
解决办法如下:
1、终端输入ps aux ,列出进程。找到含有apt-get的进程,直接sudo kill PID
2、强制解锁,命令
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

然后安装screen(有图形界面的系统就不用了,开个终端就好)
sudo apt-get install screen

用screen创建一个新的窗口:
screen -S dvwa

启动dvwa(首次启动会自动安装)
sudo docker run --rm -it -p 80:80 vulnerables/web-dvwa
过一会就可以访问你的服务器ip,进入dvwa了

如果搞坏了,ctrl-C退出,再执行就可以重开了

将当前screen窗口最小化:ctrl-A-D
列出screen窗口screen -list
恢复screen窗口:screen -r [screen id或screen name]
默认用户名:admin 密码:password

之后左侧选择Instruction,点击下方的Create/Reset Database按钮,再重新登录,就可以开干了

3 如何玩耍

3.1 暴力Brute Force破解

Learing

3.2 命令注入

Learing

3.3 跨站请求伪造CSRF (Cross-site request forgery)

Learing

3.4 文件包含

Learing

3.5 文件上传

[security = low]

本环境为php,上传php的一句话木马:(但我菜刀一直连不了),看看别人的文章,似乎都是Windows server……用docker安装的dvwa是虚拟在一个debian的系统里

那就直接传个大马吧……?(略)

3.6 不安全的验证码(CAPTCHA)

Learing

3.7 SQL注入

Learing

3.8 SQL盲注

Learing

3.9 弱会话ID

Learing

3.10 XSS (DOM)(本地利用)

Learing

3.11 XSS (Reflected)(反射型)

Learing

3.12 XSS (Stored)(存储型)

Learing

3.11 CSP绕过

Learing

3.12 JavaScript脚本

Learing

 




没有评论


你先离开吧:)



发表评论

邮箱地址不会被公开。 必填项已用*标注