def scan(self, url=None, recurse=None, inscopeonly=None, scanpolicyname=None, method=None, postdata=None, contextid=None, apikey=''):
"""
Runs the active scanner against the given URL and/or Context. Optionally, the 'recurse' parameter can be used to scan URLs under the given URL, the parameter 'inScopeOnly' can be used to constrain the scan to URLs that are in scope (ignored if a Context is specified), the parameter 'scanPolicyName' allows to specify the scan policy (if none is given it uses the default scan policy), the parameters 'method' and 'postData' allow to select a given request in conjunction with the given URL.
"""
params = {'apikey': apikey}
if url is not None:
params['url'] = url
if recurse is not None:
params['recurse'] = recurse
if inscopeonly is not None:
params['inScopeOnly'] = inscopeonly
if scanpolicyname is not None:
params['scanPolicyName'] = scanpolicyname
if method is not None:
params['method'] = method
if postdata is not None:
params['postData'] = postdata
if contextid is not None:
params['contextId'] = contextid
return six.next(six.itervalues(self.zap._request(self.zap.base + 'ascan/action/scan/', params)))
评论列表
文章目录