zap-api-python icon indicating copy to clipboard operation
zap-api-python copied to clipboard

Client Spider Support

Open JohnnyIrvin opened this issue 10 months ago • 12 comments

#!/usr/bin/env python

from zapv2 import ZAPv2
import time


target = 'http://127.0.0.1' # Change to match the target URL you want to scan
apikey = 'changeme' # Change to match the API key set in ZAP, or use None if the API key is disabled


zap = ZAPv2(apikey=apikey)

print(f'Spidering target {target}')
scanid = zap.clientSpider.scan(url=target)

while (int(zap.clientSpider.status(scanid)) < 100):
    print(f"Spider progress %: {zap.clientSpider.status(scanid)}")
    time.sleep(2)
    
print('Spider completed')

Adds the client spider to the python api.

JohnnyIrvin avatar May 29 '25 14:05 JohnnyIrvin

Logo Checkmarx One – Scan Summary & Detailsa4ececca-f38c-4a73-ab4a-13411bcf5c9c

Great job, no security vulnerabilities found in this Pull Request

psiinon avatar May 29 '25 14:05 psiinon

@psiinon fixed commit signatures. no way for me to rerun job.

JohnnyIrvin avatar May 29 '25 14:05 JohnnyIrvin

You need to do all of them. Or squash it and do just one. https://github.com/zaproxy/zap-api-python/pull/143/checks?check_run_id=43121122608

kingthorin avatar May 29 '25 14:05 kingthorin

@kingthorin thank you for clarification.

should be fixed now.

any other changes required?

JohnnyIrvin avatar May 29 '25 15:05 JohnnyIrvin

@kingthorin or @psiinon -- Any update? Looking to move this forward.

JohnnyIrvin avatar May 30 '25 11:05 JohnnyIrvin

If you want to move this forward generate the implementation instead of hand write it.

thc202 avatar May 30 '25 11:05 thc202

The changelog should be updated.

thc202 avatar May 30 '25 11:05 thc202

@thc202

Where is the documentation to generate it automatically?

Where should I place example usage?

JohnnyIrvin avatar May 30 '25 16:05 JohnnyIrvin

The changelog should be updated.

What should it say?

JohnnyIrvin avatar May 30 '25 16:05 JohnnyIrvin

Read https://github.com/zaproxy/zap-api-python/blob/main/CONTRIBUTING.md and https://github.com/zaproxy/zap-api-python/blob/main/CHANGELOG.md

thc202 avatar May 30 '25 16:05 thc202

@thc202

Unable to get the build system to build the plugin to generate the api.

Spent less time writing this simple addition then it takes to get automation tools to run.

Maybe.. Will come back later.

JohnnyIrvin avatar May 30 '25 17:05 JohnnyIrvin

The changelog should be updated.

Added change log per request.

JohnnyIrvin avatar May 30 '25 18:05 JohnnyIrvin