yara-normalize 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f56ffeec6846ec1ae4d2aea3bfa6cc89ca9643d4b31211b39e8381025377a2ff
4
+ data.tar.gz: 50aa592ac824fa3ee427f90c8279b92dc79c6dae1c4254b585e54df8c9a31ba3
5
+ SHA512:
6
+ metadata.gz: 6e9513389ae6008ae04f6b9c9ed4940c3ed5e49181930064c3c43fec3772ec7dde919cac1bab5ad7e979b1cdd1146d6e4220273f83131efa368d388f08069137
7
+ data.tar.gz: b9d19eb5019b239d877da6b6c42622b98cc214c407a6d4315f87ecd69b81140f42f80f8a2831b5cdf1c708b07caade83e2abe52e60f0bf15aff960707dc1274b
data/.document CHANGED
File without changes
data/Gemfile CHANGED
@@ -6,9 +6,9 @@ source "http://rubygems.org"
6
6
  # Add dependencies to develop your gem here.
7
7
  # Include everything needed to run rake, tests, features, etc.
8
8
  group :development do
9
- gem "shoulda", ">= 0"
10
- gem "rdoc", "~> 3.12"
11
- gem "bundler", "~> 1.1.5"
12
- gem "jeweler", "~> 1.8.4"
13
- gem "rcov", ">= 0"
9
+ gem "shoulda", ">= 4"
10
+ gem "rdoc", "~> 6.4"
11
+ gem "bundler", "~> 2.3"
12
+ gem "jeweler", "~> 2.3.9"
13
+ gem "test-unit", "~> 3.5.3"
14
14
  end
data/Gemfile.lock CHANGED
@@ -1,35 +1,88 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (3.2.8)
5
- i18n (~> 0.6)
6
- multi_json (~> 1.0)
7
- git (1.2.5)
8
- i18n (0.6.0)
9
- jeweler (1.8.4)
10
- bundler (~> 1.0)
4
+ activesupport (7.0.2.4)
5
+ concurrent-ruby (~> 1.0, >= 1.0.2)
6
+ i18n (>= 1.6, < 2)
7
+ minitest (>= 5.1)
8
+ tzinfo (~> 2.0)
9
+ addressable (2.4.0)
10
+ builder (3.2.4)
11
+ concurrent-ruby (1.1.10)
12
+ descendants_tracker (0.0.4)
13
+ thread_safe (~> 0.3, >= 0.3.1)
14
+ faraday (0.9.2)
15
+ multipart-post (>= 1.2, < 3)
16
+ git (1.11.0)
17
+ rchardet (~> 1.8)
18
+ github_api (0.16.0)
19
+ addressable (~> 2.4.0)
20
+ descendants_tracker (~> 0.0.4)
21
+ faraday (~> 0.8, < 0.10)
22
+ hashie (>= 3.4)
23
+ mime-types (>= 1.16, < 3.0)
24
+ oauth2 (~> 1.0)
25
+ hashie (5.0.0)
26
+ highline (2.0.3)
27
+ i18n (1.10.0)
28
+ concurrent-ruby (~> 1.0)
29
+ jeweler (2.3.9)
30
+ builder
31
+ bundler
11
32
  git (>= 1.2.5)
33
+ github_api (~> 0.16.0)
34
+ highline (>= 1.6.15)
35
+ nokogiri (>= 1.5.10)
36
+ psych
12
37
  rake
13
38
  rdoc
14
- json (1.7.5)
15
- multi_json (1.3.6)
16
- rake (0.9.2.2)
17
- rcov (1.0.0)
18
- rdoc (3.12)
19
- json (~> 1.4)
20
- shoulda (3.1.1)
21
- shoulda-context (~> 1.0)
22
- shoulda-matchers (~> 1.2)
23
- shoulda-context (1.0.0)
24
- shoulda-matchers (1.2.0)
25
- activesupport (>= 3.0.0)
39
+ semver2
40
+ jwt (2.3.0)
41
+ mime-types (2.99.3)
42
+ minitest (5.15.0)
43
+ multi_json (1.15.0)
44
+ multi_xml (0.6.0)
45
+ multipart-post (2.1.1)
46
+ nokogiri (1.13.4-x86_64-linux)
47
+ racc (~> 1.4)
48
+ oauth2 (1.4.8)
49
+ faraday (>= 0.8, < 3.0)
50
+ jwt (>= 1.0, < 3.0)
51
+ multi_json (~> 1.3)
52
+ multi_xml (~> 0.5)
53
+ rack (>= 1.2, < 3)
54
+ power_assert (2.0.1)
55
+ psych (4.0.3)
56
+ stringio
57
+ racc (1.6.0)
58
+ rack (2.2.3)
59
+ rake (13.0.6)
60
+ rchardet (1.8.0)
61
+ rdoc (6.4.0)
62
+ psych (>= 4.0.0)
63
+ semver2 (3.4.2)
64
+ shoulda (4.0.0)
65
+ shoulda-context (~> 2.0)
66
+ shoulda-matchers (~> 4.0)
67
+ shoulda-context (2.0.0)
68
+ shoulda-matchers (4.5.1)
69
+ activesupport (>= 4.2.0)
70
+ stringio (3.0.1)
71
+ test-unit (3.5.3)
72
+ power_assert
73
+ thread_safe (0.3.6)
74
+ tzinfo (2.0.4)
75
+ concurrent-ruby (~> 1.0)
26
76
 
27
77
  PLATFORMS
28
- ruby
78
+ x86_64-linux
29
79
 
30
80
  DEPENDENCIES
31
- bundler (~> 1.1.5)
32
- jeweler (~> 1.8.4)
33
- rcov
34
- rdoc (~> 3.12)
35
- shoulda
81
+ bundler (~> 2.3)
82
+ jeweler (~> 2.3.9)
83
+ rdoc (~> 6.4)
84
+ shoulda (>= 4)
85
+ test-unit (~> 3.5.3)
86
+
87
+ BUNDLED WITH
88
+ 2.3.12
data/LICENSE.txt CHANGED
File without changes
data/README.rdoc CHANGED
@@ -7,7 +7,7 @@ This modules takes just the strings from the strings section, sorts them, then g
7
7
  Then, in the conditions section, reorder the boolean expression to make groups first and then replace all variables
8
8
  with $a $b $c, etc. Then hash the result of this.
9
9
 
10
- Then, the signature ID is the concatenation of the sha1 sum of the sorted strings and the sha1 sum of the normalized conditions.
10
+ Then, the signature ID is the concatenation of the truncated md5 sum of the sorted strings and the truncated md5 sum of the normalized conditions. E.g., yn01:488085c947cb22ed:d936fceffe.
11
11
 
12
12
  == Usage
13
13
 
data/Rakefile CHANGED
@@ -21,24 +21,16 @@ Jeweler::Tasks.new do |gem|
21
21
  gem.description = %Q{To enable consistent comparisons between yara rules (signature), a uniform hashing standard was needed.}
22
22
  gem.email = "rubygems@chrislee.dhs.org"
23
23
  gem.authors = ["chrislee35"]
24
- gem.signing_key = "#{File.dirname(__FILE__)}/../gem-private_key.pem"
25
- gem.cert_chain = ["#{File.dirname(__FILE__)}/../gem-public_cert.pem"]
24
+ #gem.signing_key = "#{File.dirname(__FILE__)}/../gem-private_key.pem"
25
+ #gem.cert_chain = ["#{File.dirname(__FILE__)}/../gem-public_cert.pem"]
26
26
  end
27
27
  Jeweler::RubygemsDotOrgTasks.new
28
28
 
29
29
  require 'rake/testtask'
30
30
  Rake::TestTask.new(:test) do |test|
31
- test.libs << 'lib' << 'test'
32
- test.pattern = 'test/**/test_*.rb'
33
- test.verbose = true
34
- end
35
-
36
- require 'rcov/rcovtask'
37
- Rcov::RcovTask.new do |test|
38
31
  test.libs << 'test'
39
- test.pattern = 'test/**/test_*.rb'
32
+ test.pattern = FileList['test/test*.rb']
40
33
  test.verbose = true
41
- test.rcov_opts << '--exclude "gems/*"'
42
34
  end
43
35
 
44
36
  task :default => :test
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
data/bin/yaratool CHANGED
@@ -2,22 +2,18 @@
2
2
  require 'rubygems'
3
3
  require 'yara-normalize'
4
4
 
5
- if __FILE__ == $0
6
- count = duplicates = 0
7
- hashes = {}
8
- ARGV.each do |file|
9
- buf = open(file).read
10
- YaraTools::Splitter.split(buf).each do |rule|
11
- count += 1
12
- #puts rule.normalize
13
- hash = rule.hash
14
- puts "#{rule.name} #{hash} #{rule.normalized_strings.join("%")}"
15
- if hashes[hash]
16
- duplicate += 1
17
- end
18
- hashes[hash] = rule
19
- end
20
- end
21
- puts "Count: #{count}, Duplicates: #{duplicates}"
5
+ count = duplicates = 0
6
+ hashes = {}
7
+ ARGV.each do |file|
8
+ buf = open(file).read
9
+ YaraTools::Splitter.split(buf).each do |rule|
10
+ count += 1
11
+ hash = rule.hash
12
+ puts "#{rule.name} #{hash} #{rule.normalized_strings.join("%")}"
13
+ if hashes[hash]
14
+ duplicates += 1
15
+ end
16
+ hashes[hash] = rule
17
+ end
22
18
  end
23
-
19
+ puts "Count: #{count}, Duplicates: #{duplicates}"
@@ -8,19 +8,21 @@ module YaraTools
8
8
  ruletext = ruletext.gsub(/[\r\n]+/,"\n").gsub(/^\s*\/\/.*$/,'')
9
9
  @original = ruletext
10
10
  @lookup_table = {}
11
- @next_replacement = 'a'
11
+ @next_replacement = 0
12
12
 
13
- if ruletext =~ /rule\s+([\w\_\-]+)(\s*:\s*(\w[\w\s]+\w))?\s*\{\s*(meta:\s*(.*?))?strings:\s*(.*?)\s*condition:\s*(.*?)\s*\}/m
14
- name,_,tags,ifmeta,meta,strings,condition = $~.captures
13
+ if ruletext =~ /rule\s+([\w\-]+)(\s*:\s*(\w[\w\s]+\w))?\s*\{\s*(meta:\s*(.*?))?strings:\s*(.*?)\s*condition:\s*(.*?)\s*\}/m
14
+ name,_,tags,_,meta,strings,condition = $~.captures
15
15
  @name = name
16
16
  @tags = tags.strip.split(/[,\s]+/) if tags
17
17
  @meta = {}
18
- meta.split(/\n/).each do |m|
19
- k,v = m.strip.split(/\s*=\s*/,2)
20
- if v
21
- @meta[k] = v
22
- end
23
- end
18
+ if meta
19
+ meta.split(/\n/).each do |m|
20
+ k,v = m.strip.split(/\s*=\s*/,2)
21
+ if v
22
+ @meta[k] = v
23
+ end
24
+ end
25
+ end
24
26
  @normalized_strings = []
25
27
  @strings = strings.split(/\n/).map do |s|
26
28
  # strip off the spaces from the edges and then replace the first = with ' = '.
@@ -33,7 +35,7 @@ module YaraTools
33
35
  hexstr = $1.gsub(/\s+/,'').downcase.scan(/../).join(" ")
34
36
  s = s.gsub(/= \{([0-9a-fA-F\s]+)\}/, "= { #{hexstr} }")
35
37
  end
36
- key, val = s.split(/ = /,2)
38
+ _, val = s.split(/ = /,2)
37
39
  if val
38
40
  @normalized_strings << val
39
41
  else
@@ -51,8 +53,8 @@ module YaraTools
51
53
  condition.gsub(/[\$\#]\w+/) do |x|
52
54
  key = x[1,1000]
53
55
  if not @lookup_table[key]
54
- @lookup_table[key] = @next_replacement
55
- @next_replacement = (@next_replacement[0] + 1).chr
56
+ @lookup_table[key] = @next_replacement.to_s
57
+ @next_replacement += 1
56
58
  end
57
59
  x[0].chr+@lookup_table[key]
58
60
  end
@@ -100,7 +102,7 @@ module YaraTools
100
102
 
101
103
  class Splitter
102
104
  def Splitter.split(ruleset)
103
- rules = ruleset.gsub(/[\r\n]+/,"\n").gsub(/^\s*\/\/.*$/,'').scan(/(rule\s+([\w\_\-]+)(\s*:\s*(\w[\w\s]+\w))?\s*\{\s*(meta:\s*(.*?))?strings:\s*(.*?)\s*condition:\s*(.*?)\s*\})/m).map do |rule|
105
+ ruleset.gsub(/[\r\n]+/,"\n").gsub(/^\s*\/\/.*$/,'').scan(/(rule\s+([\w\-]+)(\s*:\s*(\w[\w\s]+\w))?\s*\{\s*(meta:\s*(.*?))?strings:\s*(.*?)\s*condition:\s*(.*?)\s*\})/m).map do |rule|
104
106
  YaraRule.new(rule[0])
105
107
  end
106
108
  end
File without changes
data/test/helper.rb CHANGED
@@ -7,11 +7,13 @@ rescue Bundler::BundlerError => e
7
7
  $stderr.puts "Run `bundle install` to install missing gems"
8
8
  exit e.status_code
9
9
  end
10
+
10
11
  require 'test/unit'
11
12
  require 'shoulda'
12
13
 
13
14
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
15
  $LOAD_PATH.unshift(File.dirname(__FILE__))
16
+
15
17
  require 'yara-normalize'
16
18
 
17
19
  class Test::Unit::TestCase
@@ -26,8 +26,9 @@ rule newIE0daymshtmlExec
26
26
  ($mshtmlExec_1 and $mshtmlExec_2 and $mshtmlExec_3) or ($mshtmlExec_4 and $mshtmlExec_5 and ($mshtmlExec_6 or $mshtmlExec_7))
27
27
  }
28
28
  EOS
29
+ puts sig
29
30
  yn = YaraTools::YaraRule.new(sig)
30
- assert_equal("yn01:3c0de1ad64681376:3ff75e9945", yn.hash)
31
+ assert_equal("yn01:66dd624d64a79f17:ecf1725295", yn.hash)
31
32
  assert_equal("newIE0daymshtmlExec", yn.name)
32
33
  assert_equal("\"redacted @ gmail.com\"", yn.meta['author'])
33
34
  assert_equal(["$mshtmlExec_1 = /document.execCommand(['\"]selectAll['\"])/ nocase fullword",
@@ -98,7 +99,7 @@ rule DataConversion__wide : IntegerParsing DataConversion {
98
99
  }
99
100
  EOS
100
101
  yn = YaraTools::YaraRule.new(sig)
101
- assert_equal("yn01:488085c947cb22ed:d936fceffe", yn.hash)
102
+ assert_equal("yn01:a5fd8576f2da34e2:d936fceffe", yn.hash)
102
103
  assert_equal("1", yn.meta['weight'])
103
104
  assert_equal("DataConversion__wide", yn.name)
104
105
  assert_equal(["IntegerParsing", "DataConversion"], yn.tags)
@@ -1,20 +1,20 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
3
+ # Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: yara-normalize 0.2.0 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
- s.name = %q{yara-normalize}
8
- s.version = "0.1.0"
8
+ s.name = "yara-normalize".freeze
9
+ s.version = "0.2.0"
9
10
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["chrislee35"]
12
- s.cert_chain = ["/Users/chris/Documents/projects/rubygems/yara-normalize/../gem-public_cert.pem"]
13
- s.date = %q{2012-10-29}
14
- s.default_executable = %q{yaratool}
15
- s.description = %q{To enable consistent comparisons between yara rules (signature), a uniform hashing standard was needed.}
16
- s.email = %q{rubygems@chrislee.dhs.org}
17
- s.executables = ["yaratool"]
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["chrislee35".freeze]
14
+ s.date = "2022-05-01"
15
+ s.description = "To enable consistent comparisons between yara rules (signature), a uniform hashing standard was needed.".freeze
16
+ s.email = "rubygems@chrislee.dhs.org".freeze
17
+ s.executables = ["yaratool".freeze]
18
18
  s.extra_rdoc_files = [
19
19
  "LICENSE.txt",
20
20
  "README.rdoc"
@@ -30,41 +30,31 @@ Gem::Specification.new do |s|
30
30
  "bin/yaratool",
31
31
  "lib/yara-normalize.rb",
32
32
  "lib/yara-normalize/yara-normalize.rb",
33
- "ruby_results.txt",
34
33
  "test/helper.rb",
35
34
  "test/test_yara-normalize.rb",
36
35
  "yara-normalize.gemspec"
37
36
  ]
38
- s.homepage = %q{http://github.com/chrislee35/yara-normalize}
39
- s.licenses = ["MIT"]
40
- s.require_paths = ["lib"]
41
- s.rubygems_version = %q{1.3.6}
42
- s.signing_key = %q{/Users/chris/Documents/projects/rubygems/yara-normalize/../gem-private_key.pem}
43
- s.summary = %q{Normalizes Yara Signatures into a repeatable hash even when non-transforming changes are made}
37
+ s.homepage = "http://github.com/chrislee35/yara-normalize".freeze
38
+ s.licenses = ["MIT".freeze]
39
+ s.rubygems_version = "3.2.3".freeze
40
+ s.summary = "Normalizes Yara Signatures into a repeatable hash even when non-transforming changes are made".freeze
44
41
 
45
42
  if s.respond_to? :specification_version then
46
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
47
- s.specification_version = 3
43
+ s.specification_version = 4
44
+ end
48
45
 
49
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
50
- s.add_development_dependency(%q<shoulda>, [">= 0"])
51
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
52
- s.add_development_dependency(%q<bundler>, ["~> 1.1.5"])
53
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
54
- s.add_development_dependency(%q<rcov>, [">= 0"])
55
- else
56
- s.add_dependency(%q<shoulda>, [">= 0"])
57
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
58
- s.add_dependency(%q<bundler>, ["~> 1.1.5"])
59
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
60
- s.add_dependency(%q<rcov>, [">= 0"])
61
- end
46
+ if s.respond_to? :add_runtime_dependency then
47
+ s.add_development_dependency(%q<shoulda>.freeze, [">= 4"])
48
+ s.add_development_dependency(%q<rdoc>.freeze, ["~> 6.4"])
49
+ s.add_development_dependency(%q<bundler>.freeze, ["~> 2.3"])
50
+ s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
51
+ s.add_development_dependency(%q<test-unit>.freeze, ["~> 3.5.3"])
62
52
  else
63
- s.add_dependency(%q<shoulda>, [">= 0"])
64
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
65
- s.add_dependency(%q<bundler>, ["~> 1.1.5"])
66
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
67
- s.add_dependency(%q<rcov>, [">= 0"])
53
+ s.add_dependency(%q<shoulda>.freeze, [">= 4"])
54
+ s.add_dependency(%q<rdoc>.freeze, ["~> 6.4"])
55
+ s.add_dependency(%q<bundler>.freeze, ["~> 2.3"])
56
+ s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
57
+ s.add_dependency(%q<test-unit>.freeze, ["~> 3.5.3"])
68
58
  end
69
59
  end
70
60
 
metadata CHANGED
@@ -1,120 +1,96 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: yara-normalize
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- - 0
9
- version: 0.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - chrislee35
13
8
  autorequire:
14
9
  bindir: bin
15
- cert_chain:
16
- - |
17
- -----BEGIN CERTIFICATE-----
18
- MIIDYjCCAkqgAwIBAgIBADANBgkqhkiG9w0BAQUFADBXMREwDwYDVQQDDAhydWJ5
19
- Z2VtczEYMBYGCgmSJomT8ixkARkWCGNocmlzbGVlMRMwEQYKCZImiZPyLGQBGRYD
20
- ZGhzMRMwEQYKCZImiZPyLGQBGRYDb3JnMB4XDTExMDIyNzE1MzAxOVoXDTEyMDIy
21
- NzE1MzAxOVowVzERMA8GA1UEAwwIcnVieWdlbXMxGDAWBgoJkiaJk/IsZAEZFghj
22
- aHJpc2xlZTETMBEGCgmSJomT8ixkARkWA2RoczETMBEGCgmSJomT8ixkARkWA29y
23
- ZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALNM1Hjs6q58sf7Jp64A
24
- vEY2cnRWDdFpD8UWpwaJK5kgSHOVgs+0mtszn+YlYjmx8kpmuYpyU4g9mNMImMQe
25
- ow8pVsL4QBBK/1Ozgdxrsptk3IiTozMYA+g2I/+WvZSEDu9uHkKe8pvMBEMrg7RJ
26
- IN7+jWaPnSzg3DbFwxwOdi+QRw33DjK7oFWcOaaBqWTUpI4epdi/c/FE1I6UWULJ
27
- ZF/Uso0Sc2Pp/YuVhuMHGrUbn7zrWWo76nnK4DTLfXFDbZF5lIXT1w6BtIiN6Ho9
28
- Rdr/W6663hYUo3WMsUSa3I5+PJXEBKmGHIZ2TNFnoFIRHha2fmm1HC9+BTaKwcO9
29
- PLcCAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQURzsNkZo2rv86Ftc+hVww
30
- RNICMrwwCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQBRRw/iNA/PdnvW
31
- OBoNCSr/IiHOGZqMHgPJwyWs68FhThnLc2EyIkuLTQf98ms1/D3p0XX9JsxazvKT
32
- W/in8Mm/R2fkVziSdzqChtw/4Z4bW3c+RF7TgX6SP5cKxNAfKmAPuItcs2Y+7bdS
33
- hr/FktVtT2iAmISRnlEbdaTpfl6N2ZWNT83khV6iOs5xRkX/+0e+GgAv9mE6nqr1
34
- AkuDXMhposxcnFZUrZ3UtMPEe/JnyP7Vv6pvr3qtZm8FidFZU91+rX/fwdyBU8RP
35
- /5l8uLWXXNt1wEbtu4N1I66LwTK2iRrQZE8XtlgZGbxYDFUkiurq3OafF2YwRs6W
36
- 6yhklP75
37
- -----END CERTIFICATE-----
38
-
39
- date: 2012-10-29 00:00:00 -04:00
40
- default_executable: yaratool
41
- dependencies:
42
- - !ruby/object:Gem::Dependency
43
- prerelease: false
44
- type: :development
10
+ cert_chain: []
11
+ date: 2022-05-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
45
14
  name: shoulda
46
- version_requirements: &id001 !ruby/object:Gem::Requirement
47
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
48
17
  - - ">="
49
- - !ruby/object:Gem::Version
50
- segments:
51
- - 0
52
- version: "0"
53
- requirement: *id001
54
- - !ruby/object:Gem::Dependency
55
- prerelease: false
18
+ - !ruby/object:Gem::Version
19
+ version: '4'
56
20
  type: :development
57
- name: rdoc
58
- version_requirements: &id002 !ruby/object:Gem::Requirement
59
- requirements:
60
- - - ~>
61
- - !ruby/object:Gem::Version
62
- segments:
63
- - 3
64
- - 12
65
- version: "3.12"
66
- requirement: *id002
67
- - !ruby/object:Gem::Dependency
68
21
  prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '6.4'
69
34
  type: :development
70
- name: bundler
71
- version_requirements: &id003 !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ~>
74
- - !ruby/object:Gem::Version
75
- segments:
76
- - 1
77
- - 1
78
- - 5
79
- version: 1.1.5
80
- requirement: *id003
81
- - !ruby/object:Gem::Dependency
82
35
  prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '6.4'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.3'
83
48
  type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.3'
55
+ - !ruby/object:Gem::Dependency
84
56
  name: jeweler
85
- version_requirements: &id004 !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ~>
88
- - !ruby/object:Gem::Version
89
- segments:
90
- - 1
91
- - 8
92
- - 4
93
- version: 1.8.4
94
- requirement: *id004
95
- - !ruby/object:Gem::Dependency
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.3.9
62
+ type: :development
96
63
  prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.3.9
69
+ - !ruby/object:Gem::Dependency
70
+ name: test-unit
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 3.5.3
97
76
  type: :development
98
- name: rcov
99
- version_requirements: &id005 !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- segments:
104
- - 0
105
- version: "0"
106
- requirement: *id005
107
- description: To enable consistent comparisons between yara rules (signature), a uniform hashing standard was needed.
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 3.5.3
83
+ description: To enable consistent comparisons between yara rules (signature), a uniform
84
+ hashing standard was needed.
108
85
  email: rubygems@chrislee.dhs.org
109
- executables:
86
+ executables:
110
87
  - yaratool
111
88
  extensions: []
112
-
113
- extra_rdoc_files:
89
+ extra_rdoc_files:
114
90
  - LICENSE.txt
115
91
  - README.rdoc
116
- files:
117
- - .document
92
+ files:
93
+ - ".document"
118
94
  - Gemfile
119
95
  - Gemfile.lock
120
96
  - LICENSE.txt
@@ -124,39 +100,31 @@ files:
124
100
  - bin/yaratool
125
101
  - lib/yara-normalize.rb
126
102
  - lib/yara-normalize/yara-normalize.rb
127
- - ruby_results.txt
128
103
  - test/helper.rb
129
104
  - test/test_yara-normalize.rb
130
105
  - yara-normalize.gemspec
131
- has_rdoc: true
132
106
  homepage: http://github.com/chrislee35/yara-normalize
133
- licenses:
107
+ licenses:
134
108
  - MIT
109
+ metadata: {}
135
110
  post_install_message:
136
111
  rdoc_options: []
137
-
138
- require_paths:
112
+ require_paths:
139
113
  - lib
140
- required_ruby_version: !ruby/object:Gem::Requirement
141
- requirements:
114
+ required_ruby_version: !ruby/object:Gem::Requirement
115
+ requirements:
142
116
  - - ">="
143
- - !ruby/object:Gem::Version
144
- segments:
145
- - 0
146
- version: "0"
147
- required_rubygems_version: !ruby/object:Gem::Requirement
148
- requirements:
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ required_rubygems_version: !ruby/object:Gem::Requirement
120
+ requirements:
149
121
  - - ">="
150
- - !ruby/object:Gem::Version
151
- segments:
152
- - 0
153
- version: "0"
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
154
124
  requirements: []
155
-
156
- rubyforge_project:
157
- rubygems_version: 1.3.6
125
+ rubygems_version: 3.2.3
158
126
  signing_key:
159
- specification_version: 3
160
- summary: Normalizes Yara Signatures into a repeatable hash even when non-transforming changes are made
127
+ specification_version: 4
128
+ summary: Normalizes Yara Signatures into a repeatable hash even when non-transforming
129
+ changes are made
161
130
  test_files: []
162
-
data/ruby_results.txt DELETED
@@ -1,24 +0,0 @@
1
- CF_DOC_CVE_2012_1535_original yn01:06420b6c243181e8:a7e7b4fe3a { 45 78 61 6d 70 6c 65 0b 63 72 65 61 74 65 4c 69 6e 65 73 09 68 65 61 70 53 70 72 61 79 08 68 65 78 54 6f 42 69 6e 07 6d 78 2e 63 6f 72 65 0a 49 46 6c 65 78 41 73 73 65 74 09 46 6f 6e 74 41 73 73 65 74 0a 66 6c 61 73 68 2e 74 65 78 74 } /*Example.createLines.heapSpray.hexToBin.mx.core.IFlexAsset.FontAsset.flash.text*/%{ 4d 61 69 6e 2f 70 72 69 76 61 74 65 3a } /*Main/private:*/%{ 53 00 69 00 6d 00 53 00 75 00 6e 00 } /*S.i.m.S.u.n*/%{ 57 6f 72 64 2e 44 6f 63 75 6d 65 6e 74 2e 38 } /*Word.Document.8*/%{ 66 6c 61 73 68 2e 64 69 73 70 6c 61 79 06 53 70 72 69 74 65 06 4f 62 6a 65 63 74 0f 45 76 65 6e 74 44 69 73 70 61 74 63 68 65 72 0d 44 69 73 70 6c 61 79 4f 62 6a 65 63 74 } /*flash.display.Sprite.Object.EventDispatcher.DisplayObject*/%{ 68 69 6a 6b 6c 6d 6e 6f } /*hijklmno strings */
2
- CF_DOC_CVE_2012_1535_shellcode yn01:aed85d99267c6173:4be571de0b "9090909090E947010000C28F36D8A0DF16D5B5F0DE78D00589E91B28BF56BEF71ED697165FFAA1665256D0541988A5D913E98E3A172B9BB28253A2E362577E574F52444C2E746D7000"
3
- CVE_2012_1535_SWF yn01:d0b0e41fbb90ee63:0c2737ef53 "Edit the world in hex"%"FontAsset"%"PSpop"%"createTextLine"%"heapSpray"%"hexToBin"%{ 46 57 53 }
4
- cf_exe_dropper_sfx yn01:32c758a1635b4d6e:9534ef77f9 ";The comment below contains SFX script commands"%"Setup=" ascii wide%"Silent=1" ascii wide%"WinRAR" ascii wide
5
- cf_hlp_malicious_help_file yn01:22be215570105ad6:2edd241969 "CreateThread" nocase%/RR\(.KERNEL32.DLL.,/ nocase%{ 3f 5f 03 00 }%{ 4c 4e 02 00 }
6
- cf_html_IE8_CVE_2012_4969 yn01:18d1ab9564026f79:a7e7b4fe3a "YMjf\\u0c08\\u0c0cKDogjsiIejengNEkoPDjfiJDIWUAzdfghjAAuUFGGBSIPPPUDFJKSOQJGH"%"document.execCommand(\\"
7
- cf_ie_cve_2012_1526 yn01:791760cc1bb44202:fa3fd96df1 /\.getElements?By/ nocase%/\.removeChild\(/ nocase%/document\..*?= ?null/ nocase%/mailto\:.{2000,}/ nocase fullword
8
- CF_JAVA_system_cmds yn01:9369881e5d91ae88:23497b0a75 "/bin/sh"%"Math.random"%"chmod"%"cmd.exe"%"indexOf" //usually used to get result of $fingerprint2%/(os.name|java.io.tmpdir)/%/* Payload */%/* System commands */%/get(Property|env)/%{ ca fe ba be }
9
- CF_JAVA_network_connectivity yn01:7c4e5171925f60dc:4ffbde1efc "ServerSocket"%"URLConnection" //URL class can also be used to access files in the local file system%"getMbeanServer" //used with MarshallObject%"host"%"lport"%"openConnection"%/* Network indicators */%/get(Input|Output)Stream/%/socket(lhost, lport)/%{ ca fe ba be }
10
- CF_JAVA_changing_security yn01:cf8a3ae054b77a6d:f6b1a6926b %"AccessController.doPrivileged"%"AllPermission"%"PrivilegedActionException"%"ProtectionDomain"%"file://"%/* Modifying local security : a class that allows applications to implement a security policy */%/[sg]etSecurityManager/%{ ca fe ba be }
11
- CF_JAVA_execute_write yn01:47d6a8c1cd7ca988:595f5c08f4 %%%"ArrayOfByte"%"Exception.printStackTrace"%"FileOutputStream" /*contains a byte stream with the serialized representation of an object given to its constructor*/%"HexDecode"%"InputStream"%"MarshalledObject"%"ObjectInputStream"%"OutputStreamWriter"%"Runtime.getRuntime"%"StringtoBytes"%"exec"%"getResourceAsStream"%"toByteArray"%"writeObject"%/* Exploit */%/* Loader indicators */%/* Local execution */%/arrayOf(Byte|String)/%/l(port|host)/%{ ca fe ba be }
12
- CF_JAVA_possible_exploit yn01:b58561333df5354e:e51d8cdbd7 %"ByteArrayInputStream"%"Character.digit"%"ProtectionDomain"%"String.charAt"%"StringBuilder"%"arrayOfByte"%"localPermissions"%"printStackTrace"%{ ca fe ba be }
13
- CF_PDF_CVE_2007_5659 yn01:ada07a590bb9b5b8:a7e7b4fe3a { 25 50 44 46 2d }%{ 65 70 61 63 73 65 6e 75 }%{ 6e 6f 69 74 63 6e 75 66 }%{ 79 61 72 70 73 }%{ 79 61 72 72 41 }
14
- CF_PDF_obfuscated_alphabetic_char_blackhole yn01:78654b53f1b3a0d3:c453df481f "%PDF-"%/[a-zA-Z]&#10[0-9];/%/[a-zA-Z]&#11[0-9];/%/[a-zA-Z]&#12[012];/%/[a-zA-Z]&#9[789];/
15
- CF_PDF_suspicious_js yn01:360cd6b36773334c:e0bbde6bd2 "%PDF-"%/(\(|\[)(.{1,4}(,|-)){64}/
16
- CF_RTF_ACTOR_CVE_2012_0158_tnauthor_John_Doe yn01:e82aa6a75f86469c:78c8a3f51c { 07 74 6e 61 75 74 68 6f 72 20 4a 6f 68 6e 20 44 6f 65 7d } /* tnauthor John Doe}*/
17
- CF_RTF_CVE_2012_1856 yn01:0bffc7a0c3656c46:aea71fc2f5 "0CF11E0A1B" nocase%"4d53436f6d63746c4c69622e546162537472697" nocase%"9665fb1e7c85d111b16a00c0f0283628" nocase%"D0CF11E0A1B11AE1" nocase%"D\x0a0\x0aC\x0aF" nocase%"MSComctlLib.TabStrip"%"{\\rt"%"}0105000002000000"%/objdata[[:space:].]{1,20}01.{0,1}05.{0,1}00.{0,1}00.{0,1}02.{0,1}00.{0,1}00.{0,1}00/
18
- CF_RTF_CVE_2010_3333 yn01:5d18fb7b42dfd5c0:3873ea4382 "\\shp " nocase%"\\shp\\" nocase%"\\sp \\" nocase%"\\sp\\" nocase%"pFragments" nocase%"{\\rt" /* RTF specs */ nocase
19
- CF_RTF_CVE_2010_3333_rare_ge_type yn01:5bbb6168467e0386:3873ea4382 "\\shp " nocase%"\\shp\\" nocase%"\\sp \\" nocase%"\\sp\\" nocase%"pFragments" nocase%"{\\ge" /* RTF specs */ nocase
20
- CF_RTF_CVE_2012_0158_var1_objocx yn01:dd9b4fb8c95de7f6:c32f773f84 "\\object" nocase%"\\objemb" nocase%"\\objocx" nocase%"{\\rt" /* RTF specs */ nocase%{ d0 cf 11 e0 a1 b1 1a e1 }
21
- CF_RTF_CVE_2012_0158_var2_MSComctlLib yn01:cbf14eb4327aae3e:19df01f1b8 "4C697374566965774374726C" nocase%"4D53436F6D63746C4C69622E" nocase%"54726565566965774374726C" nocase
22
- CF_RTF_CVE_2012_0158_var3_fchars yn01:5a65c8be3acd5373:a7e7b4fe3a /(\\\'[a-f0-9]{2}){30}/%{ 5c 2a 5c 66 63 68 61 72 73 }%{ 7b 5c 72 74 }
23
- CF_XDP_embedded_PDF yn01:d3a748381610c2e1:bd721f6929 "%PDF"%"</pdf>"%"<chunk>"%"<pdf xmlns="%"JVBERi0"
24
- Count: 23, Duplicates: 0
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
@@ -1,3 +0,0 @@
1
- ����:V��Cm�A�X��2�!�X&�[���F�UY�,�W�lDG���)D�5����iM؃�x��ا�pm{PE��ftX(p>��p u���Q�}�}�
2
- �Jr8[�٠ ;�q̮zE��W�&@�K@�}�����ؐ�t��ӊ{D�osϷ>�:��D��f�>+�Y�ʾ.e�M~՝��+'���3� �6����Ł*�@�Xsp����?������3��5�m�c*�n޻�_��6�
3
- ι�c�"�f�7�4���.�.z��