Open ioquatix opened 4 years ago
Okay, I got this working.
One thing I'd like to know, is if we can make this slightly more ergonomic. Here is what my script looks like:
#!/usr/bin/env ruby
require 'socket'
require_relative '../../lib/protocol/http1'
def test
sockets = Socket.pair(Socket::PF_UNIX, Socket::SOCK_STREAM)
client = Protocol::HTTP1::Connection.new(sockets.first)
server = Protocol::HTTP1::Connection.new(sockets.last)
sockets.first.write($stdin.read)
sockets.first.close
begin
host, method, path, version, headers, body = server.read_request
body = server.read_request_body(method, headers)
rescue Protocol::HTTP1::InvalidRequest
# Ignore.
end
end
if ENV["_"] =~ /afl/
require 'kisaten'
Kisaten.crash_at [Exception], [], Signal.list['USR1']
while Kisaten.loop 1000
test
end
else
test
end
First question: Is there a better check than ENV["_"] =~ /afl/
?
Hi, I meet the same problem "No instrumentation detected" as you. Can I know how you solved it? Thanks very much.
The full working example is here: https://github.com/socketry/protocol-http1/blob/e6a9235102986a7a5462aea251f2fc9cdc00d65b/fuzz/request/bake.rb#L8
Thanks for your reply. I got this error solved!
Here is my test
script.rb
:I have one file in the input directory:
number.txt
containing a valid integer.Here is the output of
afl-fuzz -i input/ -o output/ -t 1000 -m 1000 -- ruby script.rb @@