当前位置:网站首页>测试开发必备技能:安全测试漏洞靶场实战
测试开发必备技能:安全测试漏洞靶场实战
2022-06-28 03:54:00 【TEST_二 黑】
安全在互联网行业,是一个对专业性较强,且敏感的一个领域,所谓"一念成佛,一念入魔",安全技术利用得当,可以为你的产品、网站更好的保驾护航,而如果心术不正,利用安全漏洞去做一些未法牟利,则容易造成承担不必要的违法责任。
在日常很容易被大家忽略的一点,在非授权的情况下,对网站进行渗透攻击测试,也是属于非合规操作,是触及法律法规的。因此对于大家在学习安全测试过程中,通常建议是直接在本地直接搭建安全演练靶场环境,尽量避免直接对非授权的网站进行测试。
掌握安全测试是测试开发工程师进阶的一项硬技能,今天这篇文章,就来给大家分享两款常用安全测试演练靶场项目。
▌ WebGoat
WebGoat 是由 OWASP 组织研制出的用于进行 Web 漏洞实验的 Java 靶场程序。提供的训练课程有 30 多个,其中包括:跨站点脚本攻击(XSS)、访问控制、线程安全、操作隐藏字段、操纵参数、弱会话 cookie、SQL 盲注、数字型 SQL 注入、字符串型 SQL 注入、web 服务、Open Authentication 失效、危险的 HTML 注释等等。WebGoat 提供了一系列 web 安全学习的教程,某些课程也给出了视频演示,指导用户利用这些漏洞进行攻击。
项目地址:
https://github.com/WebGoat/WebGoat
1.1 安装前置条件说明
进入到项目地址,选择 WebGoat 的 jar 版本,由于 WebGoat 8 的 jar 文件已自带了 tomcat 和数据库,所以不需要再另外安装 tomcat 和 mysql,只需要安装 jdk 用于运行 jar 文件即可。
需要说明的是,WebGoat8.0 以上的版本,需要安装依赖 JDK11 以上。
下载完成后,其中:
webgoat-server-8.1.0.jar对应的是webgoat服务,用于启动WebGoat。
webwolf-8.1.0 另一个含有漏洞的辅助系统,非必需。
1.2 启动方法
通过 java -jar xxx.jar 分别启动 webgoat 和 webwolf 两个 jar 程序,例如:
执行成功后,就可以通过链接http://127.0.0.1:8080/WebGoat访问 Webgoat。
首先需要注入一个账号,然后登陆后,按照 WebGoat 的侧边顺序一项一项进行测试。
目前 WebGoat 分为三类,Lesson、Challenges/CTF、WebWolf。
其中 Lesson 为课程,每个课程中包括漏洞描述,成因,以及练习,
WebWolf 的启动方式基本一致,WebWolf 的默认端口为 9090,登录地址http://127.0.0.1:9090/WebWolf/login,WebWolf 的账户与 WebGoat 是相通的,使用 WebGoat 的账户可以直接登录 WebWolf。
▌ DVWA
DVWA(Damn Vulnerable Web Application)是一款比较著名的漏洞靶场,采用 PHP+Mysql 编写的一套用于常规 WEB 漏洞教学和检测的 WEB 脆弱性测试程序。包含了 SQL 注入、XSS、盲注等常见的一些安全漏洞。旨在为安全专业人员测试自己的专业技能和工具提供合法的环境,帮助 web 开发者更好的理解 web 应用安全防范的过程。
官网:https://dvwa.co.uk/
DVWA 共有十个模块,分别是:
1.Brute Force(暴力(破解))
2.Command Injection(命令行注入)
3.CSRF(跨站请求伪造)
4.File Inclusion(文件包含)
5.File Upload(文件上传)
6.Insecure CAPTCHA(不安全的验证码)
7.SQL Injection(SQL 注入)
8.SQL Injection(Blind)(SQL 盲注)
9.XSS(Reflected)(反射型跨站脚本)
10.XSS(Stored)(存储型跨站脚本)
2.1 搭建方法
如果是在 Windows 上搭建 DVWA,安装过程主要分为两步:
phpstudy 下载以及安装。
DVWA 下载及配置。
1、 由于 DVWA 需要运行在有数据库/服务器等多种环境下,我们一般选用集成了这些环境的 phpStudy: https://www.xp.cn/,这个工具可以在官网下载,如下:
2、下载完成,按要求,傻瓜式安装即可,安装完成后,打开启动Apache、MySQL两个服务。
3、下载 DVWA,将压缩包解压到 phpstudy 的 WWW 目录下。并且找到 DVWA\config 下面的 config.ini.php.dist 文件,修改其中的用户名密码,按需修改即可。最后将后缀.dist 删除,文件名为:config.inc.php,内容如下:
<?php
# If you are having problems connecting to the MySQL database and all of the variables below are correct
# try changing the 'db_server' variable from localhost to 127.0.0.1. Fixes a problem due to sockets.
# Thanks to @digininja for the fix.
# Database management system to use
$DBMS = 'MySQL';
#$DBMS = 'PGSQL'; // Currently disabled
# Database variables
# WARNING: The database specified under db_database WILL BE ENTIRELY DELETED during setup.
# Please use a database dedicated to DVWA.
#
# If you are using MariaDB then you cannot use root, you must use create a dedicated DVWA user.
# See README.md for more information on this.
$_DVWA = array();
$_DVWA[ 'db_server' ] = '127.0.0.1';
$_DVWA[ 'db_database' ] = 'dvwa';
$_DVWA[ 'db_user' ] = 'root';
$_DVWA[ 'db_password' ] = '123456';
$_DVWA[ 'db_port'] = '3306';
$_DVWA[ 'allow_url_include'] = 'on';
$_DVWA[ 'allow_url_fopen'] = 'on';
# ReCAPTCHA settings
# Used for the 'Insecure CAPTCHA' module
# You'll need to generate your own keys at: https://www.google.com/recaptcha/admin
$_DVWA[ 'recaptcha_public_key' ] = 'mikezhou';
$_DVWA[ 'recaptcha_private_key' ] = 'mikezhou';
# Default security level
# Default value for the security level with each session.
# The default is 'impossible'. You may wish to set this to either 'low', 'medium', 'high' or impossible'.
$_DVWA[ 'default_security_level' ] = 'impossible';
# Default PHPIDS status
# PHPIDS status with each session.
# The default is 'disabled'. You can set this to be either 'enabled' or 'disabled'.
$_DVWA[ 'default_phpids_level' ] = 'disabled';
# Verbose PHPIDS messages
# Enabling this will show why the WAF blocked the request on the blocked request.
# The default is 'disabled'. You can set this to be either 'true' or 'false'.
$_DVWA[ 'default_phpids_verbose' ] = 'false';
?>
4、访问:http://localhost/dvwa/setup.php
点击创建数据库。
5、创建成功,会自动跳转到登录页面,需要输入用户名密码。默认用户名:admin ,默认密码:password。
到这里,我们已经完成了,安全漏洞靶场环境的搭建。怎么样,你学会了吗?
边栏推荐
- Lamaba expression learning and common functional interfaces
- 【Linux】【Mysql】ERROR 1698 (28000): Access denied for user ‘root‘@‘localhost‘
- 互联网的发展促进了无界零售、数字零售、即时零售等一系列新模式的出现
- 从零到一,教你搭建「以文搜图」搜索服务(一)
- leetcode:714. The best time to buy and sell stocks includes handling fee [DP dual status]
- Reading notes of top performance version 2 (II) -- Performance observation tool
- What is the level 3 password complexity of ISO? How often is it replaced?
- Games104 operation 2-colorgrading
- 抖音实战~取关博主
- Has anyone ever used CDC to synchronize to MySQL with a deadlock?
猜你喜欢
2021 year end summary and 2022 outlook
Tiktok practice ~ pay attention to bloggers
Web3来临时的风口浪尖
领歌leangoo敏捷看板工具新增导出卡片文档和粘贴共享脑图节点功能
Lingge leangoo agile Kanban tool adds the functions of exporting card documents and pasting shared brain map nodes
How to write a software test report? Here comes the third party performance report template
MSc 307 (88) (2010 FTPC code) Part 2 smoke and toxicity test
A summary of my recent situation in June 2022
有关函数模板的那些小知识-.-
How to clean the nozzle of Epson l3153 printer
随机推荐
Is the securities account opened by qiniu safe? How to open an account
Une seule pile dans l'ordre inverse avec des fonctions récursives et des opérations de pile
内卷、躺平与中年危机的相关思考
Introduction to multi project development, basic design class library project use
June 27, 2022: give a 01 string with a length of N. now please find two intervals so that the number of 1 and the number of 0 in the two intervals are equal. The two intervals can intersect, but not c
等保2.0密码要求是什么?法律依据有哪些?
一文详解|增长那些事儿
AspNetCoreRateLimit 速率限制 接口访问限制 限流控制
TFTLCD display experiment of mini plate based on punctual atom stm32
Multithreading and high concurrency II: detailed introduction to volatile and CAS
From zero to one, I will teach you to build a "search by text and map" search service (I)
简单工厂模式
僅用遞歸函數和棧操作逆序一個棧
Sorting from one stack to another
Introduction notes to machine learning
E-week finance Q1 mobile banking has 650million active users; Layout of financial subsidiaries in emerging fields
Multithreading and high concurrency six: source code analysis of thread pool
[proteus simulation] timer 1 external counting interrupt
从零到一,教你搭建「以文搜图」搜索服务(一)
Multithreading and high concurrency V: detailed explanation of wait queue, executor and thread pool (key)