Using Mechanize with Login Scripts

Christian's Avatar

Christian

04 Dec, 2018 04:21 AM

I've been trying to get a login script working for one of the web applications for which the login interaction is a bit complex and required some extra steps, I was able to get it working successfully using the mechanize gem, and it works fine as a standalone, but when I try and run it from within the login script it throws a number of errors.
It seems to error out constantly on my require statement for mechanize, however the gem is installed under the correct arachni directory, and I can load it under the arachni_shell when I drop to irb, but it fails at run time with
[-] [components/plugins/login_script#prepare:59] Login script: [LoadError] cannot load such file -- mechanize It fails with the same error if I try and use backticks or exec to call the script as well.
Any advice on how I can use mechanize to obtain the cookies needed for a valid session and then load them into arachni?

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