Z
Zed Shaw
Hello Everyone,
Another release of RFuzz to announce:
http://rfuzz.rubyforge.org/
DESCRIPTION
RFuzz is an HTTP client library that you can use in combination with a
random junk generator to conduct fuzzing tests against any HTTP server
(or web app). It's not limited to fuzzing, as the HTTP client can work
as a Net/HTTP replacement, and you can easily just make regular
requests.
Fuzzing is where you try to give a web application lots of randomly
generated unexpected inputs in an attempt to break it and find new areas
to write unit tests. It compliments other testing methods. See
http://en.wikipedia.org/wiki/Fuzzing for additional information.
This is the library I'll be using in my RubyConf talk.
CHANGES
The 0.7 release fixes a bad bug in the request headers, fixes a rare
chunked encoding error, and adds a new example that uses the fresh
RFuzz::Browser class. Look at examples/cl_watcher.rb for a simple
script that I'm using to watch apartment listings on craigslist.
This release *also supports win32 precompiled binaries*.
INSTALL
Everyone should be able to install it with:
sudo gem install rfuzz
Or on window just "gem install rfuzz". Windows people pick the win32
version as it's the one that's precompiled.
EXAMPLE REST CLIENT
This example is from the samples page:
http://rfuzz.rubyforge.org/sample.html
class RESTClientError < Exception; end
class RESTClient
def initialize(host,port, base="")
@host, @port = host, port
@base = base
@client = RFuzz::HttpClient.new(host,port)
end
def target_uri(symbol)
uri = @base + "/" + symbol.to_s.tr("_","/")
end
def method_missing(symbol, *args)
res = @client.get(target_uri(symbol), :query => (args[0] || {}))
raise_error_if(res.http_status != "200",
"Invalid Status #{res.http_status} from server
#{@host}:#{@port}")
return REXML:
ocument.new(res.http_body).root
end
def raise_error_if(test, msg)
raise RESTClientError.new(msg) if test
end
end
This example just takes simple:
client.users_find :name => "joe"
And translates them to:
GET /users/find?name=joe
Requests on the fly and then returns an REXML docroot.
Enjoy!
Another release of RFuzz to announce:
http://rfuzz.rubyforge.org/
DESCRIPTION
RFuzz is an HTTP client library that you can use in combination with a
random junk generator to conduct fuzzing tests against any HTTP server
(or web app). It's not limited to fuzzing, as the HTTP client can work
as a Net/HTTP replacement, and you can easily just make regular
requests.
Fuzzing is where you try to give a web application lots of randomly
generated unexpected inputs in an attempt to break it and find new areas
to write unit tests. It compliments other testing methods. See
http://en.wikipedia.org/wiki/Fuzzing for additional information.
This is the library I'll be using in my RubyConf talk.
CHANGES
The 0.7 release fixes a bad bug in the request headers, fixes a rare
chunked encoding error, and adds a new example that uses the fresh
RFuzz::Browser class. Look at examples/cl_watcher.rb for a simple
script that I'm using to watch apartment listings on craigslist.
This release *also supports win32 precompiled binaries*.
INSTALL
Everyone should be able to install it with:
sudo gem install rfuzz
Or on window just "gem install rfuzz". Windows people pick the win32
version as it's the one that's precompiled.
EXAMPLE REST CLIENT
This example is from the samples page:
http://rfuzz.rubyforge.org/sample.html
class RESTClientError < Exception; end
class RESTClient
def initialize(host,port, base="")
@host, @port = host, port
@base = base
@client = RFuzz::HttpClient.new(host,port)
end
def target_uri(symbol)
uri = @base + "/" + symbol.to_s.tr("_","/")
end
def method_missing(symbol, *args)
res = @client.get(target_uri(symbol), :query => (args[0] || {}))
raise_error_if(res.http_status != "200",
"Invalid Status #{res.http_status} from server
#{@host}:#{@port}")
return REXML:
end
def raise_error_if(test, msg)
raise RESTClientError.new(msg) if test
end
end
This example just takes simple:
client.users_find :name => "joe"
And translates them to:
GET /users/find?name=joe
Requests on the fly and then returns an REXML docroot.
Enjoy!