using REST with python, can not specify checks
Hi,
I am using arachni as a REST service to scan hosts.
I've created a minimalistic python script that feeds the json to
the REST api:
#!/usr/bin/env python
# see the documentation how to use more options in the JSON call
# https://github.com/Arachni/arachni/wiki/REST-API
import json
import urllib2
URL='http://testhtml5.vulnweb.com'
SCAN_OPTS=['xss*,sql_injection*,csrf']
#SCAN_OPTS=['*'] # do every check
data = {
'url': URL, 'checks' : SCAN_OPTS
}
req = urllib2.Request('http://172.17.0.2:7331/scans')
req.add_header('Content-Type', 'application/json')
response = urllib2.urlopen(req, json.dumps(data))
The variable SCAN_OPTS works when I am using ['*'] but whenever
I try to make it work for the xss*,sql_injection*,csrf checks it
borks..
I tried different syntaxes but I am missing something here.
Whenever I request the report I see: "checks" : [],
Can you help me out what the correct form of checks should be with JSON and Python? I am a bit stuck here and tried multiple formats of the array of checks :(
Thanks for any help and for such a great and flexible product! :)
Michiel
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Tasos Laskos on 01 Dec, 2016 01:27 PM
Hello,
That option expects an array of check names or patterns, not an array containing a single CSV for checks (because then the option wouldn't need to be an array).
Try:
Cheers
Tasos Laskos closed this discussion on 01 Dec, 2016 01:27 PM.
Michiel re-opened this discussion on 01 Dec, 2016 01:37 PM
2 Posted by Michiel on 01 Dec, 2016 01:37 PM
Ha, thanks!
That seems to do the trick:
But I get no results:
And I know that website should spit out some results ;)
Should I specify more arguments in the json options? default is everything right?
Support Staff 3 Posted by Tasos Laskos on 01 Dec, 2016 01:39 PM
You're missing the
audit
option, right now you're not auditing any elements, just crawling, see: https://github.com/Arachni/arachni/wiki/REST-API#example-clientTasos Laskos closed this discussion on 14 Dec, 2016 02:14 PM.