该的Acunetix API让您有机会来实现任务自动化,从而提高效率-尤其是当你可以用加速您的工作流程的其他组件的功能整合。在此示例中,我们将在上一篇文章的基础上,向您展示如何在Bash脚本中使用Acunetix API:使用Bash和Acunetix API管理扫描。我们将代码添加到该Bash脚本中,以实现以下自动化:

Acunetix中: 触发创建导出文件以随后导入到WAF中 监视导出状态,直到完成 下载导出文件 在BigIP ASM中 定义目标 定义安全策略 上载汇出 脚本添加的剖析 脚本添加遵循以下结构:

Acunetix API任务 导出文件的生成被触发 创建一个循环,该循环每10秒检查一次导出文件生成的状态,并等待状态完成 导出文件已下载 WAF API任务 为目标创建一个虚拟服务器 漏洞评估基准的ID是从WAF中检索的 创建Acunetix扫描的安全策略 从WAF检索安全策略的ID 安全策略的扫描程序类型设置为“通用扫描程序” 计算导出文件的大小 导出文件已上传到WAF 导出文件已导入到安全策略中 Bash脚本添加

... previous script above this line
Declare variables for Acunetix
MyTargetIP=getent hosts testphp.vulnweb.com | awk '{ print $1 } ExportTypeID="21111111-1111-1111-1111-111111111113" # F5 BigIP

Declare variables for F5 BigIp
MyTargetDomain=echo "$MyTargetURL" | sed -e 's|^[^/]*//||' -e 's|/.*$||' MyBigIpUser="admin" MyBigIpPass="adminpass123%" MyBigIpHost="192.168.72.128"

MyExportResult=curl -i -sS -k -X POST $MyAXURL/exports -H "Content-Type: application/json" -H "X-Auth: $MyAPIKEY" --data "{\"export_id\":\"$ExportTypeID\",\"source\":{\"list_type\":\"scan_result\",\"id_list\":[\"$MyScanResultID\"]}}"

MyExportElement=echo "$MyExportResult" | grep "Location: " | sed "s/Location: \/api\/v1\/exports\///" | sed "s/\r//g" | sed -z "s/\n//g" MyExportURL=echo "$MyAXURL/exports/$MyExportElement" MyExportID=echo "$MyExportResult" | grep -Po '"report_id": *\K"[^"]*"' | tr -d '"'

while true; do MyExportStatus=curl -sS -k -X GET "$MyAXURL/exports/{$MyExportID}" -H "Accept: application/json" -H "X-Auth: $MyAPIKEY"

if [[ "$MyExportStatus" == *""status": "processing""* ]]; then echo "Export status: Processing - waiting 10 seconds" elif [[ "$MyExportStatus" == *""status": "queued""* ]]; then echo "Export status: Queued - waiting 10 seconds" elif [[ "$MyExportStatus" == *""status": "completed""* ]]; then echo "Export status: Completed" # Break out of loop break else echo "Invalid export status - aborting" # Clean up and exit script cleanup exit 1 fi sleep 10 done

MyExportFile=echo $MyExportStatus | sed 's/.*\[ \"\/api\/v1\/reports\/download\/\([^]]*\)\" \].*/\1/g' echo "Export file: $MyExportFile"

Download export file from Acunetix
Dummy=curl -sS -k "$MyAXURL/reports/download/$MyExportFile" -o $MyExportFile

Create a virtual server for your target
Dummy=curl -sS -k -u $MyBigIpUser:$MyBigIpPass -X POST "https://$MyBigIpHost/mgmt/tm/ltm/virtual" -H "Content-type: application/json" --data '{"name":"MyWebApplication","destination":"'"$MyTargetIP"':80","ipProtocol":"tcp"}' echo "Created a virtual server"

Get the ID of the vulnerability assessment baseline policy
MyBigIpVulnBaselineID=curl -sS -k -u $MyBigIpUser:$MyBigIpPass -X GET "https://$MyBigIpHost/mgmt/tm/asm/policy-templates" -H "Content-type: application/json" | jq -r '.items[] | select(.title == "Vulnerability Assessment Baseline") | .id'

Create a security policy for Acunetix scans
MyBigIpPolicyResponse=curl -sS -k -u $MyBigIpUser:$MyBigIpPass -X POST "https://$MyBigIpHost/mgmt/tm/asm/policies" -H "Content-type: application/json" --data '{"name":"AcunetixPolicy","description":"Import from Acunetix Scan Results","virtualServers":["/Common/MyWebApplication"],"type":"security","enforcementMode":"blocking","templateReference":{"link":"https://$MyBigIpHost/mgmt/tm/asm/policy-templates/'"$MyBigIpVulnBaselineID"'"}}' MyBigIpPolicyID=echo $MyBigIpPolicyResponse | jq -r '.id' echo "Security policy ID: $MyBigIpPolicyID"

Set scanner type to Generic scanner
Dummy=curl -sS -k -u $MyBigIpUser:$MyBigIpPass -X PATCH "https://$MyBigIpHost/mgmt/tm/asm/policies/$MyBigIpPolicyID/vulnerability-assessment" -H "Content-type: application/json" --data '{"scannerType":"generic"}' echo "Scanner type set to Generic scanner"

Get file size
MyExportFileSize=stat --printf="%s" $MyExportFile

Upload the file to the WAF
Dummy=curl -sS -k -u $MyBigIpUser:$MyBigIpPass -X POST "https://$MyBigIpHost/mgmt/tm/asm/file-transfer/uploads/$MyExportFile" -H "Content-type: application/octet-stream" -H "Content-Range: 0-$((MyExportFileSize-1))/$MyExportFileSize" --data-binary @$MyExportFile echo "Acunetix export file uploaded to the WAF"

Import the file into the security policy
Dummy=curl -sS -k -u $MyBigIpUser:$MyBigIpPass -X POST "https://$MyBigIpHost/mgmt/tm/asm/tasks/import-vulnerabilities" -H "Content-type: application/json" --data '{"policyReference":{"link":"https://'"$MyBigIpHost"'/mgmt/tm/asm/policies/'"$MyBigIpPolicyID"'"},"filename":"'"$MyExportFile"'","importAllDomainNames":false,"domainNames":["'"$MyTargetDomain"'"]}' echo "Acunetix export file imported to the security policy"

Get the vulnerabilities collection object
MyVulnerabilities=curl -sS -k -u $MyBigIpUser:$MyBigIpPass -X GET "https://$MyBigIpHost/mgmt/tm/asm/policies/$MyBigIpPolicyID/vulnerabilities" MyVulnerabilitiesItems=echo $MyVulnerabilities | jq '.totalItems' echo "Number of vulnerabilities imported: $MyVulnerabilitiesItems" if [[ $MyVulnerabilitiesItems -eq 0 ]]; then echo "No vulnerabilities imported; exiting" exit 1; fi

echo "$MyVulnerabilitiesItems vulnerabilities imported. You now need to configure resolution parameters for each vulnerability."
————————————————
版权声明:本文为CSDN博主「kevin20182019」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/kevin20182019/article/details/117121273

Acunetix与WAF集成:Acunetix和F5 BigIP ASM的更多相关文章

  1. WAF集成:Acunetix和FortiWeb

    Acunetix API使您有机会自动化任务以提高效率,尤其是在您可以加速与工作流其他组件的集成功能时.在此示例中,我们将在上一篇文章的基础上,向您展示如何在Bash脚本中使用Acunetix API ...

  2. CVE-2020-5902 F5 BIG-IP 远程代码执行漏洞

    CVE-2020-5902 F5 BIG-IP 远程代码执行漏洞复现 漏洞介绍 F5 BIG-IP 是美国 F5 公司的一款集成了网络流量管理.应用程序安全管理.负载均衡等功能的应用交付平台. 近日, ...

  3. F5 BIG-IP 远程代码执行RCE(CVE-2020-5902)复现

    漏洞简介 F5 BIG-IP 是美国``F5公司一款集成流量管理.DNS.出入站规则.web应用防火墙.web网关.负载均衡等功能的应用交付平台. 在F5 BIG-IP产品的流量管理用户页面 (TMU ...

  4. F5 BIG-IP 远程代码执行漏洞环境搭建

    最近F5设备里的远程代码执行漏洞可谓是火爆,漏洞评分10分,所以,我也想搭建下环境复现一下该漏洞 漏洞详情 F5 BIG-IP 是美国F5公司一款集成流量管理.DNS.出入站规则.web应用防火墙.w ...

  5. F5 BIG-IP负载均衡器配置实例与Web管理界面体验

    [文章作者:张宴 本文版本:v1.0 最后修改:2008.05.22 转载请注明出自:http://blog.s135.com/f5_big_ip] 前言:最近一直在对比测试F5 BIG-IP和Cit ...

  6. [转]F5 BIG-IP负载均衡器配置实例与Web管理界面体验

    转载:http://www.zyan.cc/f5_big_ip/ 前言:最近一直在对比测试F5 BIG-IP和Citrix NetScaler负载均衡器的各项性能,于是写下此篇文章,记录F5 BIG- ...

  7. F5 BIG-IP – Useful SNMP oids to monitor

    I have collected some of the most interesting OIDs (in my scenario im using LTM and APM modules) fro ...

  8. 将Acunetix与CircleCI集成

    如果要在DevSecOps中包含Acunetix ,则需要将其与CI / CD系统集成.Acunetix具有针对最受欢迎的CI / CD系统Jenkins的现成集成.但是,您可以使用Acunetix ...

  9. CVE-2020-5902 F5 BIG-IP 远程代码执行RCE

    cve-2020-5902 : RCE:curl -v -k 'https://[F5 Host]/tmui/login.jsp/..;/tmui/locallb/workspace/tmshCmd. ...

随机推荐

  1. 第七章 DevOps工具链

    DevOps工具生态圈 协同开发工具 敏捷开发 可视化 加强团队沟通协作 数据分析 协同开发 持续集成工具 Jenkins 自动化编译 自动化测试 自动化部署 丰富的插件库 版本管理工具 Git 简介 ...

  2. Apple macOS 下载汇总

    macOS Big Sur 11,macOS Catalina 10.15,macOS Mojave 10.14,macOS High Sierra 10.13,macOS Sierra 10.12 ...

  3. Linux Docker 部署 ASP.NET Core应用

    一.系统环境 1.腾讯云轻量应用服务器CentOS7.6 二.操作流程及途中遇到的问题 1.SSH方式远程Linux ssh <username>@<IP address or do ...

  4. 关于Linux的一些基础命令

    今天学习scala语言,在linux系统上运行,发现对Linux的命令不太熟悉,为了熟悉掌握,也便于查询,这些命令主要是为了收藏备用,,希望能帮助到大家 linux20个常用命令是: 1.显示日期的指 ...

  5. [leetcode] 875. 爱吃香蕉的珂珂(周赛)

    875. 爱吃香蕉的珂珂 这题时间要求比较严格... 首先,将piles排序,然后二分查找. 总之,答案K肯定位于piles[?]piles[?+1]或者1piles[0]之间 所以我们先二分把?找到 ...

  6. GO学习-(35) Go实现日志收集系统4

    Go实现日志收集系统4   到这一步,我的收集系统就已经完成很大一部分工作,我们重新看一下我们之前画的图: 我们已经完成前面的部分,剩下是要完成后半部分,将kafka中的数据扔到ElasticSear ...

  7. curl 常用操作总结

    前言 curl 是一个强大的命令行工具,支持 HTTP, HTTPS, SCP 等多种协议,本文主要总结一下其常用的功能,方便及时查阅. curl --version curl 7.68.0 (x86 ...

  8. CVPR 2020几篇论文内容点评:目标检测跟踪,人脸表情识别,姿态估计,实例分割等

    CVPR 2020几篇论文内容点评:目标检测跟踪,人脸表情识别,姿态估计,实例分割等 CVPR 2020中选论文放榜后,最新开源项目合集也来了. 本届CPVR共接收6656篇论文,中选1470篇,&q ...

  9. 重新整理 .net core 实践篇—————日志系统之结构化[十八]

    前言 什么是结构化呢? 结构化,就是将原本没有规律的东西进行有规律话. 就比如我们学习数据结构,需要学习排序然后又要学习查询,说白了这就是一套,没有排序,谈如何查询是没有意义的,因为查询算法就是根据某 ...

  10. day05对象和类

    day06作业: 第一题:分析以下需求,并用代码实现 手机类Phone 属性: 品牌brand 价格price 行为: 打电话call() 发短信sendMessage() 玩游戏playGame() ...