Login_script could be able to login successfully, but session check was not able to use any cookies
I wrote a ruby script as a plugin. the code as:
browser = Watir::Browser.new :chrome
browser.goto 'http://example.com'
sleep(5)
form = browser.forms.first
print "Browser form : #{form}"
form.text_field( name: 'phoneEmailUsername' ).set '***'
form.text_field( name: 'phoneEmailUsername' ).focus()
form.text_field( name:'password' ).set '******'
form.text_field( name:'password' ).focus()
form.button( class: 'auth-button').click()
framework.options.session.check_url = browser.url
framework.options.session.check_pattern = />Logout</
I can see arachni open a chrome browser and login successfully, and then close the browser. However, it was not able to capture any cookies, so the session check still fail, anyone know the reason.
i also tried to delete the first line, use the default arachni browser, if use the default browser driver, no browser pop out, and check stail fail.
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 04 May, 2018 09:06 AM
The first line bypasses Arachni completely so it will never work like that, you need to use the browser that is provided.
If it still doesn't work, try running it as an external Ruby script but use PhantomJS not Chrome, and then verify that the login happens.
If so, then the issue is somewhere in Arachni, otherwise PhantomJS just doesn't support your webapp.