Skip to content

Instantly share code, notes, and snippets.

@yeukhon
Created August 5, 2013 16:07
Show Gist options
  • Select an option

  • Save yeukhon/6157129 to your computer and use it in GitHub Desktop.

Select an option

Save yeukhon/6157129 to your computer and use it in GitHub Desktop.
run ./zap.sh -dir /tmp/zap then quit, and edit config.xml under /tmp/zap/ to change mode from standard to protect or safe then restart using the same command
from zapv2 import ZAPv2 as zap
import time
target = "http://testfire.net"
z = zap(proxies={'http': 'http://127.0.0.1:8080'})
z.urlopen(target)
time.sleep(5)
print 'start..'
def progress(obj):
while True:
p = int(obj.status)
if p < 100:
print p
time.sleep(5)
else:
time.sleep(3)
break
z.spider.scan(target)
progress(z.spider)
z.ascan.scan(target)
progress(z.ascan)
import pprint
pprint.pprint(z.core.alerts(), indent=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment