Ticket #13 (closed enhancement: fixed)

Opened 3 months ago

Last modified 3 months ago

[PATCH] improve fuzzing extensibility (xss checking in this case)

Reported by: someone23 Assigned to: stu
Priority: major Component: tarantula
Keywords: Cc: someone23

Description

This patch depends on the patches in ticket:11 and ticket:12

This patch improves the form fuzzing ability of tarantula by allowing a crawler to have multiple "fuzzers" just as it can have multiple reporters and handlers. FormSubmission is the default fuzzer so everything works like before by default. For my needs I added XssFormSubmission and XssDocumentCheckerHandler which work together to perform rudimentary XSS checking while crawling.

I also added a times_to_crawl field to the crawler that defaults to 1. This is necessary so that the entire site gets crawled after fuzzed data has been submitted to every form, and no pages that could possibly contain bad data get missed.

Here's a small example of what I do in my tests:

    t = tarantula_crawler(self, :verbose => true)
    t.skip_uri_patterns << /session/ << /users/
    
    Relevance::Tarantula::XssFormSubmission.attacks = @attacks
    t.fuzzers = [Relevance::Tarantula::XssFormSubmission]
    
    t.handlers << Relevance::Tarantula::XssDocumentCheckerHandler.new(@attacks)
    
    t.times_to_crawl = 2
    t.crawl

where @attacks is an array of hashes, each hash of the form:

{
'name' => 'name of the XSS attack',
'code' => 'some text to submit that should be escaped by the app',
'desc' => 'description of the attack that will show up in reports'
}

I use http://ha.ckers.org/xss.html to get my list of attacks.

The crawler iterates over the fuzzers calling 'mutate' and passing in the form. The XssFormSubmission fuzzer will return an array of form_submissions each with all of the fields filled in from one attack (except selects, because of date_select issues).

I also had to comment out the xss-shield stuff as it defeated the purpose of XSS testing by modifying the app to escape strings in templates.

It's pretty basic right now, but hopefully it will be useful to others.

Attachments

tarantula_fuzzers.patch.txt (12.3 kB) - added by someone23 on 05/04/08 22:00:26.
improve tarantula fuzzing ability

Change History

05/04/08 22:00:26 changed by someone23

  • attachment tarantula_fuzzers.patch.txt added.

improve tarantula fuzzing ability

05/09/08 09:44:45 changed by jgehtland

  • status changed from new to closed.
  • resolution set to fixed.

Applied the patch in trunk.