raddant 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9b6630f6a07418a95e743b7f7af4ee6f2b302c41
4
+ data.tar.gz: 47a5f5535270ce0f7b0abc53965966d30c682648
5
+ SHA512:
6
+ metadata.gz: 061f8526d66a7365a3ed4f31b07af0e4c6a0ba5af166c3392e419c08d3d78f6b715cc14be905fec5ee3c3746719ff79486483951aefdf3ec6624f4dec01b6680
7
+ data.tar.gz: 26749f9ffa6343a55b3db5b3802c7f453915422d14417a14c26b933a1b73d8fa24e1e88d0af979a36c417c918ca36e97c48b5b7731c04ff1c1db169ad6a63527
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 tduehr
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ = raddant
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to raddant
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 tduehr. See LICENSE.txt for
18
+ further details.
19
+
@@ -0,0 +1,40 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rake'
4
+ require 'rake/clean'
5
+
6
+ CLEAN.add 'tmp'
7
+ CLOBBER.add 'pkg', "doc", '.yardoc'
8
+
9
+ require 'jeweler'
10
+ Jeweler::Tasks.new do |gem|
11
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
12
+ gem.name = "raddant"
13
+ gem.homepage = "http://github.com/tduehr/raddant"
14
+ gem.license = "MIT"
15
+ gem.summary = %Q{File fuzzer}
16
+ gem.description = %Q{Wrapper for radamsa - a mutation based file format fuzzer}
17
+ gem.email = "td@matasano.com"
18
+ gem.authors = ["tduehr"]
19
+ gem.add_development_dependency "yard", "~> 0.6.0"
20
+ gem.add_development_dependency "jeweler", "~> 1.6.4"
21
+ end
22
+ Jeweler::RubygemsDotOrgTasks.new
23
+
24
+ require 'rake/testtask'
25
+ Rake::TestTask.new(:test) do |test|
26
+ test.libs << 'lib' << 'test'
27
+ test.pattern = 'test/**/test_*.rb'
28
+ test.verbose = true
29
+ end
30
+
31
+ task :default => :test
32
+
33
+ require 'yard'
34
+ YARD::Rake::YardocTask.new do |yard|
35
+ yard.options << "--embed-mixins"
36
+ end
37
+ YARD::Rake::YardocTask.new(:todo) do |yard|
38
+ yard.options.concat ['--query', '@todo']
39
+ yard.options << "--list"
40
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.6
@@ -0,0 +1,88 @@
1
+ require 'tempfile'
2
+ require 'digest/sha2'
3
+
4
+ class Raddant
5
+ include Enumerable
6
+ class << self
7
+ attr_accessor :bin
8
+ end
9
+
10
+
11
+ self.bin = 'radamsa'
12
+
13
+ attr_accessor :indat, :seek, :polymerase, :muxers, :muxer_polymerase
14
+ attr_accessor :count, :seed, :fuzzers, :generators, :temp_file, :out_file
15
+
16
+ def self.fuzz(file, opts={}, &block)
17
+ self.new(file, opts, block)
18
+ end
19
+
20
+ def initialize(str = "", opts={}, &block)
21
+ @indat = str
22
+ @count = opts[:count] || 0
23
+ @start_seed = opts[:seed]
24
+ @seed = @start_seed || Digest::SHA512.hexdigest(File.read("/dev/urandom",512))
25
+ @seek = opts[:seek]
26
+ @fuzzers = opts[:fuzzers]
27
+ @generators = opts[:generators]
28
+ @polymerase = opts[:polymerase]
29
+ @muxers = opts[:muxers]
30
+ @muxer_polymerase = opts[:muxer_polymerase]
31
+ self.each(block) if block_given?
32
+ end
33
+
34
+ def next?
35
+ (@count && @count < 1) ? false : true
36
+ end
37
+
38
+ def fuzz_once dat
39
+ self.indat = dat
40
+ self.next
41
+ end
42
+
43
+ def each
44
+ cnt = @count
45
+ sd = @seed
46
+ @seed = @start_seed || @seed
47
+ eret = []
48
+ while( self.next?) do
49
+ yield self.next
50
+ eret << @seed if @count
51
+ end
52
+ @count = cnt
53
+ @seed = sd
54
+ eret
55
+ end
56
+
57
+ def next
58
+ ret = execute
59
+ @count = @count - 1
60
+ @seed = Digest::SHA512.hexdigest(@seed)
61
+ ret
62
+ end
63
+
64
+ private
65
+ def execute
66
+ @out_file = Tempfile.new("raddant")
67
+ @out_file.close
68
+ args = ["-s", @seed.to_i(16).to_s, "-o", @out_file.path]
69
+ @temp_file = Tempfile.new("raddant")
70
+ @temp_file.open
71
+ @temp_file.write @indat
72
+ @temp_file.close
73
+ args += ["-f", [@fuzzers].flatten.join(",")] if @fuzzers
74
+ args += ["-g", [@generators].flatten.join(",")] if @generators
75
+ args += ["-p", [@polymerase].flatten.join(",")] if @polymerase
76
+ args += ["-m", [@muxers].flatten.join(",")] if @muxers
77
+ args += ["-P", [@muxer_polymerase].flatten.join(",")] if @muxer_polymerase
78
+ args += ["-S", @seek] if @seek
79
+ args << @temp_file.path
80
+
81
+ raise "radamsa didn't work: #{$?}" unless system(self.class.bin, *args)
82
+ @temp_file.close!
83
+ @out_file.open
84
+ ret = @out_file.read
85
+ @out_file.close!
86
+ ret
87
+ end
88
+ end
@@ -0,0 +1,52 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: raddant 0.0.6 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "raddant"
9
+ s.version = "0.0.6"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["tduehr"]
14
+ s.date = "2016-11-03"
15
+ s.description = "Wrapper for radamsa - a mutation based file format fuzzer"
16
+ s.email = "td@matasano.com"
17
+ s.extra_rdoc_files = [
18
+ "LICENSE.txt",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ "LICENSE.txt",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "lib/raddant.rb",
28
+ "raddant.gemspec",
29
+ "test/helper.rb",
30
+ "test/test_raddant.rb"
31
+ ]
32
+ s.homepage = "http://github.com/tduehr/raddant"
33
+ s.licenses = ["MIT"]
34
+ s.rubygems_version = "2.5.1"
35
+ s.summary = "File fuzzer"
36
+
37
+ if s.respond_to? :specification_version then
38
+ s.specification_version = 4
39
+
40
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
41
+ s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
42
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
43
+ else
44
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
45
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
46
+ end
47
+ else
48
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
49
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
50
+ end
51
+ end
52
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'raddant'
8
+
9
+ class Test::Unit::TestCase
10
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestRaddant < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: raddant
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.6
5
+ platform: ruby
6
+ authors:
7
+ - tduehr
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-11-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: yard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.6.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.6.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: jeweler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.6.4
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.6.4
41
+ description: Wrapper for radamsa - a mutation based file format fuzzer
42
+ email: td@matasano.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files:
46
+ - LICENSE.txt
47
+ - README.rdoc
48
+ files:
49
+ - ".document"
50
+ - LICENSE.txt
51
+ - README.rdoc
52
+ - Rakefile
53
+ - VERSION
54
+ - lib/raddant.rb
55
+ - raddant.gemspec
56
+ - test/helper.rb
57
+ - test/test_raddant.rb
58
+ homepage: http://github.com/tduehr/raddant
59
+ licenses:
60
+ - MIT
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.5.1
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: File fuzzer
82
+ test_files: []