Arachni gets stuck after running a login_script

tester's Avatar

tester

16 Sep, 2016 11:27 PM

While using the login_script plugin, Arachni appears to hang after all of the login steps are complete. I verified all steps were complete by taking screenshots and writing the cookies to a file. The console does not output the usual "Login Script: Login was successful" nor does it display the cookies, when the login_script plugin actually finishes properly.

This issue is being encountered with two internal applications, but Arachni works well for an internet-facing app. The strange thing is that I was able to run multiple scans against both apps already. I tried running on both OSX and Windows, and even tried the latest nightly. It might also be worth noting that the scans run approximately 1 out of 15 attempts.

Any ideas on what might be wrong or how I can troubleshoot further?

Here is what I captured in the log:

[!] [browser#spawn_phantomjs:1277] Browser: Spawning PhantomJS...
[!] [browser#spawn_phantomjs:1290] Browser: Attempt #0, chose port number 59846
[!] [browser#spawn_phantomjs:1294] Browser: Spawning process: /Users/myUser/Desktop/arachni-1.4-0.5.10/bin/../system/usr/bin/phantomjs
[!] [browser#spawn_phantomjs:1315] Browser: Process spawned, waiting for it to boot-up...
[!] [browser#spawn_phantomjs:1329] Browser: Boot-up complete.
[!] [browser#spawn_phantomjs:1337] Browser: 16913: Started
PID: 16914
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
16913: Working
PhantomJS is launching GhostDriver...
[INFO  - 2016-09-16T21:30:53.297Z] GhostDriver - Main - running on port 59846


[!] [browser#spawn_phantomjs:1341] Browser: PhantomJS is ready. [!] [session#login_from_sequence:321] Session: Logging in via sequence: #<Proc:0x007ff38d4e3c60@/Users/myUser/Desktop/arachni-1.4-0.5.10/system/gems/gems/arachni-1.4/components/plugins/login_script.rb:38>
  1. Support Staff 1 Posted by Tasos Laskos on 17 Sep, 2016 09:58 AM

    Tasos Laskos's Avatar

    Hello,

    Does this happen at the beginning (i.e. the first time the script runs) or during the scan (i.e. after a logout)?
    Also, a more detailed debugging output (--output-debug=3) using the nightlies would help.

    Cheers

  2. 2 Posted by tester on 19 Sep, 2016 08:34 PM

    tester's Avatar

    Hi Tasos. Sorry for the delay. I reran the scans on Saturday and Sunday without any issues. However when I ran them on Monday I ran in to the issues again. Not sure if this points to internal/network (not Arachni) issues...

    Below are selected details from the logs. Not sure I will be able to share the complete set of logs, but let me know if you need anything else to help troubleshoot.

    arachni scan initiated
    login_script starts

    All steps in login script are completed
    - Verified PhantomJS authenticates successfully (screenshots and cookies saved to files) - Arachni does not display "Login script: Execution completed." nor the cookies

    dozens of seemingly residual requests/responses for application being tested

     [!!!] [http/proxy_server/connection#handle_response:169] SSLInterceptor: Sending response.
     [!!!] [http/proxy_server/connection#on_flush:200] SSLInterceptor: Response sent.
     [!!!] [http/proxy_server/tunnel#on_read:47] Tunnel: <- Forwarding 165 bytes to client.
     [!!] [browser#wait_for_timers:1118] Browser: ...done.
     [!!] [browser#wait_for_pending_requests:1400] Browser: Waiting for 3 requests to complete...


    =!=!=!=!=long wait=!=!=!=!=


    [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached
    Long pause (one order of several minutes)...
     [!!!] [http/proxy_server/connection#initialize:33] Connection: Starting new connection: 70184012892840
    [!!!] [http/proxy_server/connection#initialize:38] Connection: Incoming request. [!!!] [http/proxy_server/connection#initialize:51] Connection: Request received: CONNECT redacted-appHost:443


    =!=!=!=!=!=!=!=!=!= =!=!=!=!=Additional requests/responses to application being tested=!=!=!=!= =!=!=!=!=!=!=!=!=!=


    [!!!] [http/proxy_server/connection#handle_response:169] SSLInterceptor: Sending response. [!!!] [http/proxy_server/connection#on_flush:200] SSLInterceptor: Response sent. [!!!] [http/proxy_server/tunnel#on_read:47] Tunnel: <- Forwarding 693 bytes to client. [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached [!!!] [http/proxy_server/ssl_interceptor#on_close:34] SSLInterceptor: Closed because: [Arachni::Reactor::Connection::Error::Closed] end of file reached
    Nothing more is output...

    When I do a Ctrl + c...

    [*] Aborting...
     [~] Please wait while the system cleans up.
     [!!] [http/proxy_server#shutdown:68] ProxyServer: Shutting down..
     [!!] [http/proxy_server#shutdown:68] ProxyServer: Shutting down..
     [!!!] [http/proxy_server/connection#on_close:178] Connection: Closed because: [NilClass] 
     [!!] [http/proxy_server#shutdown:73] ProxyServer: Shutdown.
     ```
    
  3. Support Staff 3 Posted by Tasos Laskos on 20 Sep, 2016 07:51 AM

    Tasos Laskos's Avatar

    Were you using the nightlies?

  4. 4 Posted by tester on 25 Sep, 2016 12:55 PM

    tester's Avatar

    Hi Tasos. The issue seems to have been resolved using the nightlies. I suspect it was due to issues related to the application itself.

    It's weird... the login script was working using v1.4-0.5.10, but not the nightly. Now it's only working with the nightlies. Thanks again for your support.

  5. Support Staff 5 Posted by Tasos Laskos on 25 Sep, 2016 12:56 PM

    Tasos Laskos's Avatar

    Strange but fair enough.

  6. Tasos Laskos closed this discussion on 25 Sep, 2016 12:56 PM.

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