Skip to content

Instantly share code, notes, and snippets.

@fadyosman
Created May 2, 2020 18:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save fadyosman/2e83028d8378c76c972ffd5a54419958 to your computer and use it in GitHub Desktop.
Save fadyosman/2e83028d8378c76c972ffd5a54419958 to your computer and use it in GitHub Desktop.
import sys
import requests
if len(sys.argv) < 3:
print("Usage : python3 zapcrawl.py urls.txt ZAP_API_KEY")
exit(0)
urlsfile = open(sys.argv[1], 'r')
urls = urlsfile.readlines()
api_key = sys.argv[2]
# Strips the newline character
for url in urls:
zap_api = "http://localhost:8080/JSON/spider/action/scan/?apikey=%s&url=%s&contextName=&recurse=" % (api_key.strip(), url.strip())
requests.get(url = zap_api)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment