1. 关于Gotestwaf

Gotestwaf,全称为Go Test WAF,是一种用于 API 和 OWASP 攻击模拟的工具,可以用于检测率测试(Negative Tests)和误报率(Positive Tests)测试支持广泛的 API 协议,包括 REST、GraphQL、gRPC、WebSockets、SOAP、XMLRPC 等。
用于评估 Web 应用程序安全解决方案,例如 API 安全代理、Web 应用程序防火墙、IPS、API 网关等。
项目地址:https://github.com/wallarm/gotestwaf

2.配置文件说明:

GoTestWAF 使用放置在 HTTP 请求不同部分的编码负载生成恶意请求:其正文、标头、URL 参数等。生成的请求被发送到 被测设备。
默认配置文件放在testcases文件夹里的YAML文件

yml文件示例:

payload:- "<body οnlοad=alert('test1')>"- "<b οnmοuseοver=alert('Wufff!')>click me!</b>"
encoder:- Base64Flat- URL
placeholder:- URLPath- URLParam- HTMLForm- HTMLMultipartForm
type: "XSS"
...

payload:攻击的恶意样本
encoder:攻击样本编码方式
支持编码
Base64
Base64Flat(不进行等号补位)
JSUnicode
URL
Plain (保持攻击样本原样)
XML Entity
gRPC
placeholder:请求位置
Header
RequestBody
JSONRequest
JSONBody
HTMLForm
HTMLMultipartForm
SOAPBody
XMLBody(只是Content-Type: text/xml,请求body不是xml格式,需要在payload里定义xml攻击样本,encode用Plain )
URLParam
URLPath

请求生成是一个三步过程,涉及将payload个数乘以encoder和placeholder数量。假设定义了 2 个payload、3 个encoder(Base64、JSUnicode 和 URL)和 1 个placeholder(URLParameter - HTTP GET 参数)。在这种情况下,GoTestWAF 将在测试用例中发送 2x3x1 = 6 个请求

3.运行:

系统要求:
GoTestWAF支持所有流行的操作系统(Linux、Windows、macOS),如果系统中安装了Go,则可以进行本地开发。
如果将工具作为Docker容器运行,请确保您已经安装并配置了Docker,并且GoTestWAF和评估的应用程序安全解决方案连接到同一个Docker网络。
为了成功启动GoTestWAF,请确保运行GoTestWAF的机器的IP地址在运行应用安全解决方案的机器上被列入白名单。
通过docker运行
我们可以直使用下列命令将项目库拉取到本地:

docker pull wallarm/gotestwaf

本地Docker构建

docker build . --force-rm -t gotestwaf
docker run -v ${PWD}/reports:/app/reports --network=“host” gotestwaf --url=<EVALUATED_SECURITY_SOLUTION_URL>

运行命令之后,你将会在reports文件夹下查看到waf-test-report-.pdf报告文件,可以替换${PWD}/reports为用于放置评估报告的另一个文件夹的路径

go环境运行
安装go环境
https://golang.google.cn/dl/ 下载对应系统包。
下载gowaftest项目

git clone https://github.com/wallarm/gotestwaf.git
cd gotestwaf
go run ./cmd --url=<EVALUATED_SECURITY_SOLUTION_URL> --verbose

4.配置选项

–addHeader string An HTTP header to add to requests
–blockConnReset If true, connection resets will be considered as block 有些防护设备通过rest报文重置攻击,通过这个命令
–blockRegex string Regex to detect a blocking page with the same HTTP response status code as a not blocked request 根据定义正则匹配返回内容判断是否拦截
–blockStatusCode int HTTP status code that WAF uses while blocking requests (default 403) 根据返回码判断是否拦截
–configPath string Path to the config file (default “config.yaml”)
–followCookies If true, use cookies sent by the server. May work only with --maxIdleConns=1
–idleConnTimeout int The maximum amount of time a keep-alive connection will live (default 2)
–ignoreUnresolved If true, unresolved test cases will be considered as bypassed (affect score and results)
–maxIdleConns int The maximum number of keep-alive connections (default 2)
–maxRedirects int The maximum number of handling redirects (default 50)
–nonBlockedAsPassed If true, count requests that weren’t blocked as passed. If false, requests that don’t satisfy to PassStatuscode/PassRegExp as blocked
–passRegex string Regex to a detect normal (not blocked) web page with the same HTTP status code as a blocked request
–passStatusCode int HTTP response status code that WAF uses while passing requests (default 200)
–proxy string Proxy URL to use
–randomDelay int Random delay in ms in addition to the delay between requests (default 400)
–renderToHTML Save report as HTML page instead of PDF
–reportPath string A directory to store reports (default “reports”)
–sendDelay int Delay in ms between requests (default 400)
–skipWAFBlockCheck If true, WAF detection tests will be skipped
–testCase string If set then only this test case will be run 指定测试的单个yaml文件
–testCasesPath string Path to a folder with test cases (default “testcases”) 指定测试的yaml文件夹
–testSet string If set then only this test set’s cases will be run
–tlsVerify If true, the received TLS certificate will be verified
–url string URL to check
–verbose If true, enable verbose logging显示详细的运行过程,有些错误信息可以带着这个开关查看
–version Show GoTestWAF version and exit
–wafName string Name of the WAF product (default “generic”)
–workers int The number of workers to scan (default 5)
–wsURL string WebSocket URL在这里插入代码片 to check

5.报告查看


报告文件waf-evaluation-report-.pdf位于reports用户目录的文件夹中

6.常见问题

1 main error: WAF was not detected. Please use the ‘–blockStatusCode’ or ‘–blockRegex’ flags. Use ‘–help’ for additional info.
gotestwaf测试之前会发一个 及包括sql注入又包含xss攻击的恶意样本 ,如果这个没有拦截或者返回的错误码不是默认的403会出现这个报错。可以根据被测设备定义状态码,如果是通过rest断链接的加上
也可以通过–skipWAFBlockCheck跳过这个检查。

WAF检测率及误报测试工具Gotestwaf相关推荐

  1. 易语言空壳程序360误报测试解决方法

    易语言空壳程序360误报测试解决方法 参考文章: (1)易语言空壳程序360误报测试解决方法 (2)https://www.cnblogs.com/hongyuyingxiao/p/9630107.h ...

  2. TCP端口检测、网络连接时延测试工具 tcping

    原文地址:https://zhangnq.com/3158.html 在主流的linux系统中,通过yum或者apt也可安装tcping,不过通过源安装的tcping只能显示单次检测的结果,也没有具体 ...

  3. 精选用户故事|洞态在聚水潭的误报率几乎为0,如何做到?

    亮点锦集: 我个人在实际使用过程中体验到,对于像命令执行和sql注入这类漏洞,洞态能够做到百分百的检测. --Spenser 除了之前关于敏感信息检测这一块有误报,其它基本没有.不过这块儿经过优化之后 ...

  4. 误报率、故障检测率、漏报率、虚警率、误警率等指标异同及计算公式

    文章目录 误报率.故障检测率.漏报率.虚警率.误警率等指标异同及计算公式 1. 一些标准指标的计算 true positive rate (tp rate)[真阳性率], or hit rate [命 ...

  5. 目标检测(降低误检测率及小目标检测系列笔记)

    深度学习中,为了提高模型的精度和泛化能力,往往着眼于两个方面:(1)使用更多的数据(2)使用更深更复杂的网络. ** 一.什么是负样本 ** 负样本是指不包含任务所要识别的目标的图像,也叫负图像(Ne ...

  6. PostgreSQL 11 preview - bloom filter 误报率评估测试及如何降低误报 - 暨bloom filter应用于HEAP与INDEX的一致性检测...

    标签 PostgreSQL , bloom filter , 误报率 , amcheck 背景 bloom filter是一个空间压缩,概率数据结构,可以存储超容量的数据集,用于判断某个元素是否存在于 ...

  7. 关于Android SDK工具Lint的误报分析

    在项目基本做完后,我们通常会用Android SDK自带的工具Lint来检查一下项目中的一些潜在的问题(右键工程-->Android Tools-->Run Lint:Check for ...

  8. iPhone闯大祸!车祸检测大量误报挤占救援资源

    Alex 发自 凹非寺 量子位 | 公众号 QbitAI 美国某紧急救助中心,一个周末收到了71通报警电话. 然鹅,这里面居然没有一个是真的-- 原来,该救助中心附近有座雪场,现在正值滑雪旺季. 一些 ...

  9. 误报率、漏报率、准确率和召回率(虚警率、漏警率)

    文章目录 什么是positive和negative 什么是true和false TP.FP.TN.FN 误报率.漏报率.召回率 误报率和漏报率的关系 see also References 什么是po ...

最新文章

  1. fullcaledar日历插件
  2. 小白学phoneGap《构建跨平台APP:phoneGap移动应用实战》连载一(PhoneGap中的API)...
  3. 3、excel数据格式设置快捷键
  4. mysql 建表_别再胡乱建表了,看看阿里P8总结的mysql建表规约吧
  5. 四元数相关总结-未完
  6. AI基础:简易数学入门
  7. 对NumPy中dot()函数的理解(亲测,矩阵算法)
  8. 文件排版,较难的线性dp
  9. 4K超清,2500万人在线,猫晚直播技术全解读
  10. webpack Plugin常用 optimization splitChunks UglifyJsPlugin sourceMap
  11. Intellij 中的git操作 转!
  12. apk 反编译工具的使用
  13. 《First Order Motion Model for Image Animation》论文解读
  14. 微信支付:nginx配置 网页授权域名 用户在网页授权页同意授权给公众号后,微信会将授权数据传给一个回调页面,回调页面需在此域名下,以确保安全可靠。
  15. 分治法--线性时间选择(求第k小数)
  16. 如何用AE做出动画效果杭州UI设计分享方法
  17. 【附源码】Python计算机毕业设计食疗养生服务平台
  18. TextView 跑马灯效果
  19. 随机验证码生成(生成一个含有n位随机数字的字符串)
  20. 基于springboot的汽车配件管理系统

热门文章

  1. 用代码过中秋,python海龟月饼你要不要尝一口?
  2. 微信认证300元发票获取
  3. 【一起入门NLP】中科院自然语言处理作业五:BiLSTM+Attention实现SemEval-2010 Task 8上的关系抽取(Pytorch)【代码+报告】
  4. 灰狼优化matlab,混合灰狼优化(HGWO,DE-GWO)算法matlab源码
  5. c语言代码怎样制作成一个游戏?
  6. 如何提高自己的编码水平
  7. 像素画软件android,Pixly像素画编辑器
  8. OpenStack核心组件原理与应用之Glance
  9. python测试代码报错:Ran 0 test in 0.00s
  10. 自学Python 64 使用Python语言收发电子邮件