Tuesday, July 3, 2012

Introducing watirfall - An Automated Human Approach for Very Surgical Web Engagements


Decided to start working on a "smart" web-based class capable of behaving as if it were human.  This class can be used when a "surgical approach" is preferable during web security engagements.  This class currently works with the Firefox and Chrome browsers under both Linux and MacOSX.  It will allow you to drive a browser automatically, taking advantage of the built-in JavaScript engines found in the most popular browsers.  The following is an example of how to use it.

#!/usr/bin/env ruby
require './watirfall_config'
require './watirfall'

watirfall_config = WatirfallConfig.new
watirfall_config.as_firefox
wf = Watirfall.new(watirfall_config)
browser = wf.startup
browser.goto("http://www.ksl.com")
browser.text_field(:id => 'search_keyword').click
wf.type_as_human("watirfall") {|char| browser.text_field(:id => 'search_keyword').send_keys char}
browser.text_field(:id => 'search_keyword').send_keys :enter

If you feel you'd like to give this code a go, you can find it at https://github.com/ninp0/kore_kit/tree/master/lib/kore_kit/web/watirfall

For more information around driving this browser, the real sauce is found within watir-webdriver.

Cheers!

No comments:

Post a Comment