docker - 如何将 zap 会话文件传递给 dockerized zap 扫描仪?
问题描述
如何在执行扫描之前将会话文件(.session .session.data .session.properties .session.script 和上下文)正确传递给以下命令?
docker run -rm -v $(pwd):/zap/wrk/:rw -t owasp/zap2docker-stable zap-baseline.py \
-t https://www.example.com -r testreport.html
解决方案
使用core/action/loadSession/
API 端点。像这样的东西:
from zapv2 import ZAPv2 as zap
import time
apikey = 'apikey12345' #Change this to match your setup
z = zap(apikey=apikey, proxies={'http': 'http://127.0.0.1:9999', 'https': 'http://127.0.0.1:9999'})
time.sleep(5)
print 'start..'
z.core.load_session('/root/Download/zaptmp/test.session') #Obviously this needs to be your session path
sites = z.core.sites
# Check that the session loaded... I'm printing, you could check count not zero, whatever
print 'Listing sites in loaded session:'
for site in sites:
print site
推荐阅读
- c - 如何从其他字符串中获取新字符串而不简单地连接它们?
- winapi - ProcessDebugPort 和 IsDebugPresent 结果不匹配
- google-sheets - Google表格根据重复项合并行并更新单元格值
- javascript - 如何从列表项的文本中删除日期
- javascript - 如何在javascript中单击按钮时删除完整的行?
- typescript - 如何在 TypeScript 动态属性中建模?
- image - 将路径节点文本文件转换为图形树
- paypal - PayPal 立即付款按钮 - 电子邮件链接
- sql - 在我的 oracle SQL 查询中不是按表达式分组
- c# - 针对 SQS 队列的 Amazon AWS 上的 MassTransit 服务器端加密