Login_script could be able to login successfully, but session check was not able to use any cookies

jingxus's Avatar

jingxus

13 Feb, 2018 03:25 AM

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.

  1. Support Staff 1 Posted by Tasos Laskos on 04 May, 2018 09:06 AM

    Tasos Laskos's Avatar

    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.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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