login_script and web app
Good day!
I have problem with login script. I want login in WEB APP. On Ruby (NET::Http) auth response looks like this:
require 'uri'
require 'net/http'
url = URI("https://API_URL")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request.body = "user%5Bemail%5D=XXX&user%5Bpassword%5D=XXX&remember_me=true"
response = http.request(request)
puts response.read_body
But I can't understand, how I can refactor this code snippet to Arachni Ruby syntax.
With best regards,
Me!
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
Support Staff 1 Posted by Tasos Laskos on 02 Aug, 2016 12:58 PM
Hello,
Did you check the relevant article?
http://support.arachni-scanner.com/kb/general-use/logging-in-and-ma...
2 Posted by yuri.komarov on 02 Aug, 2016 01:05 PM
Of course
Main problem for me is that APP_API Content-type is "x-www-form-urlencoded". That why i can't generate login_script.
Now I try to use this code snippet:
And see error in console
Support Staff 3 Posted by Tasos Laskos on 02 Aug, 2016 01:08 PM
Try:
You may need to un-encode the
:body
, I'm not sure.4 Posted by yuri.komarov on 02 Aug, 2016 02:04 PM
Support Staff 5 Posted by Tasos Laskos on 02 Aug, 2016 02:06 PM
You forgot the username after
/home/
.6 Posted by yuri.komarov on 02 Aug, 2016 02:13 PM
Oh, God... My mistake
Support Staff 7 Posted by Tasos Laskos on 02 Aug, 2016 02:14 PM
You've got a syntax error in the script, the error points you to the location.
8 Posted by yuri.komarov on 02 Aug, 2016 02:20 PM
What the problem is? (((
Support Staff 9 Posted by Tasos Laskos on 02 Aug, 2016 02:22 PM
You forgot the commas after the
}
in the request options.Also, you know you can't use the example
framework.options.session
options, right?You need to set your own.
Tasos Laskos closed this discussion on 08 Aug, 2016 09:59 AM.