我使用这个curl来调用一个api:
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
但是我还没有找到解决方案。
你能帮帮我吗?
谢谢。
发布于 2018-06-20 14:22:50
我有这个,但不工作,不要导入上下文:
#!/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'https://stackoverflow.com/questions/50928732
复制相似问题