首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Zapproxy中的基本授权

Zapproxy中的基本授权
EN

Stack Overflow用户
提问于 2018-06-19 20:41:22
回答 1查看 850关注 0票数 0

我使用这个curl来调用一个api:

代码语言:javascript
复制
curl -X POST -u user:password /to/the/end/point

如果我收到zapproxy的请求,我可以发送这个并进行主动攻击,但我正在尝试调用python api。我无法使用基本授权(base64或user:password)进行身份验证。我尝试使用gui和export创建上下文,并使用zap-api-scan.py,但它不起作用。

我已经读过这些帖子了:

https://zaproxy.blogspot.com/2017/06/scanning-apis-with-zap.html

Basic Authorization in OWASP ZAP

https://github.com/zaproxy/zap-core-help/wiki/HelpStartConceptsAuthentication#httpntlm-authentication

但是我还没有找到解决方案。

你能帮帮我吗?

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2018-06-20 14:22:50

我有这个,但不工作,不要导入上下文:

代码语言:javascript
复制
#!/usr/bin/env python

from zapv2 import ZAPv2


target = 'https://target/to/api'

zap = ZAPv2(proxies={'http': 'http://127.0.0.1:8888', 'https': 'http://127.0.0.1:8888'})

zap.context.import_context("/file/context")

print 'Accessing target %s' % target
zap.urlopen(target)
time.sleep(2)

print 'Spidering target %s' % target
scanid = zap.spider.scan(target)

time.sleep(2)

print 'Spider completed'

time.sleep(5)

print 'Scanning target %s' % target
scanid = zap.ascan.scan(target)

print 'Scan completed'
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50928732

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档