Skip to content
Snippets Groups Projects
Commit 8105d877 authored by Zitnik, Anze's avatar Zitnik, Anze
Browse files

"Smarter" waiting for w3af to load.

parent ab50dcde
No related branches found
No related tags found
No related merge requests found
44c44
15a16
> import psutil
44c45
< proc = subprocess.Popen([cmd])
---
> proc = subprocess.Popen([cmd, "--no-ssl"])
51c51
48a50,56
> max_wait=60
> time1=time.time()
> while True:
> if 5000 in [i.laddr.port for i in psutil.Process(proc.pid).connections() if i.status=='LISTEN']:
> break
> if time.time()-time1 > max_wait:
> raise Exception("w3af wait timeout")
51c59
< conn = Connection('http://127.0.0.1:5000/')
---
> conn = Connection('http://127.0.0.1:5000/', timeout=20)
76c76
< main()
\ No newline at end of file
---
> main()
......@@ -4,17 +4,20 @@
< proc = subprocess.Popen([cmd,'-daemon'])
---
> proc = subprocess.Popen([cmd,'-daemon', '-config', 'api.disablekey=true'])
84,85c85,94
84,85c85,92
< print 'Waiting for ZAP to load, 10 seconds ...'
< time.sleep(10)
---
> print 'Waiting for ZAP to load...'
> max_wait=60
> import time
> import psutil
> time1=time.time()
> while True:
> if 8080 in [i.laddr.port for i in psutil.Process(proc.pid).connections() if i.status=='LISTEN']:
> break
> if time.time()-time1 > max_wait:
> raise Exception("ZAP wait timeout")
132c139
< main()
\ No newline at end of file
---
> main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment