运行scrip时出现OWASP ZAP python API错误

2024-09-28 20:46:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用python-owasp-zap-api。我下载并安装了pythonowasp-zap所需的所有存储库。当我运行一个在网站https://github.com/zaproxy/zaproxy/wiki/ApiPython中给出的示例代码时,我得到了下面的错误,请帮助我。在

Traceback (most recent call last):
  File "zap2.py", line 34, in <module>
    while (int(zap.spider.status()) < 100):
ValueError: invalid literal for int() with base 10: 'Does Not Exist'

然后,我试着从状态法中去除妄想症:

^{pr2}$

我得到以下错误:

TypeError: Int argument must be an Int or string not an InstanceMethod

我们非常感谢您帮助纠正错误。在


Tags: httpsgithubcomanapi网站错误wiki
2条回答

在蜘蛛。状态()接受参数scanid。这是为了跟踪不同的扫描。您需要指定这是哪种扫描,可以按如下所示进行。在

target = 'some decimal base address'
scanid = zap.spider.scan(target)
while (int(zap.spider.status(scanid)) < 100):
    print 'Spider progress %: ' + zap.spider.status(scanid)
    time.sleep(5)

您需要使用:

while (int(zap.spider.status()) < 100):
    print 'Spider progress %: ' + zap.spider.status()
    time.sleep(5)

这里有一个示例脚本,用于扫描wavsep:https://github.com/zapbot/zap-mgmt-scripts/blob/master/wavsep/wavsep-1.5-spider-scan.py

我会尽快更新ZAP wiki;)

西蒙(ZAP项目负责人)

相关问题 更多 >