authentication using login_script

Oliver Mc's Avatar

Oliver Mc

26 Aug, 2016 12:48 PM

Hello,
I'm trying to authenticate on my SPA. My script is attached, and a text file containing the command i'm running (creds been changed), as well as the terminal output. Essentially, I'm receiving the following error:

 [-] [utilities#exception_jail:428] Session: [Selenium::WebDriver::Error::UnknownError] Error Message => ''null' is not an object (evaluating 'document.getElementById( 'username' ).value = 'username'')'
 caused by Request => {"headers":{"Accept":"application/json","Accept-Encoding":"gzip;q=1.0,deflate;q=0.6,identity;q=0.3","Connection":"close","Content-Length":"193","Content-Type":"application/json; charset=utf-8","Host":"127.0.0.1:53090","User-Agent":"Ruby"},"httpVersion":"1.1","method":"POST","post":"{\"script\":\"  document.getElementById( 'username' ).value = 'username';\\n  document.getElementById( 'password' ).value = 'password';\\n\\n  document.getElementById( 'login' ).submit();\",\"args\":[]}","url":"/execute","urlParsed":{"anchor":"","query":"","file":"execute","directory":"/","path":"/execute","relative":"/execute","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/execute","queryKey":{},"chunks":["execute"]},"urlOriginal":"/session/b41fca60-6b8a-11e6-bf78-e9dfaedf5657/execute"} (ReqHand)
  1. 1 Posted by Oliver Mc on 26 Aug, 2016 01:03 PM

    Oliver Mc's Avatar

    Do any of arachni's plugins allow xpath input for login forms? I believe this may be the issue.

  2. Support Staff 2 Posted by Tasos Laskos on 26 Aug, 2016 06:10 PM

    Tasos Laskos's Avatar

    I can't know for sure without access but if the page loads asynchronously the given fields may not be there when the script runs.
    A more robust approach would be to use a Ruby login script, in which case you can script it using the Watir WebDriver API.

  3. Tasos Laskos closed this discussion on 22 Sep, 2016 09:14 AM.

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