Passing Login Credentials when using the Arachni GEM
Hi Guys,
I have written a bunch of scripts using the Arachni GEM for launching scans, so far I have been using the opts.cookie_string option to pass a cookie string to enable Arachni to login into an application. Now, I have a need to provide the credentials (just like the auto-login feature). I was thinking I could pass credentials to Session(https://github.com/Arachni/arachni/blob/master/lib/arachni/session.rb) as opts. Would that work ? If not how can set the site credentials through my script. My script goes along these lines:
include Arachni
scanner = Framework.new
scanner.opts.url = target
scanner.opts.cookie_string = params[:cookie_string]
scanner.opts.audit = params[:audit_options]
scanner.opts.link_count_limit = params[:link_count]
scanner.opts.depth_limit = params[:depth_limit]
scanner.opts.redirect_limit = params[:redirect_limit]
scanner.opts.follow_subdomains = params[:follow_subdomains]
scanner.run
Basically I make a hash of all the required params and I want to pass the username and password through these params.
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 14 May, 2013 05:14 PM
Hey,
You can either just use the auto-login plugin:
Or, if you need finer control, use the
Session
class directly, you can checkout the code of theautologin
plugin for hints as to how to do it.See also:
2 Posted by arhn7 on 14 May, 2013 05:17 PM
Sounds good. Thanks again for your prompt response. :)
Support Staff 3 Posted by Tasos Laskos on 14 May, 2013 05:25 PM
No problem, let me know if you run into any issues.
Also, it might interest you to know that you can do the same thing like so:
I think it looks cleaned that way.
Tasos Laskos closed this discussion on 14 May, 2013 05:25 PM.