cobreak 0.0.4 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,53 +3,34 @@ require 'cobreak/function_db'
3
3
  require 'cobreak/function_hash'
4
4
  require 'cobreak/version'
5
5
  class Encrypt
6
- def md4(dato)
7
- md4 = OpenSSL::Digest::MD4.hexdigest(dato)
8
- puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + md4
9
- $datBas::database(md4)
10
- DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md4.db'))
11
- end
12
- def md5(dato)
13
- md5 = OpenSSL::Digest::MD5.hexdigest(dato)
14
- puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + md5
15
- DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md5.db'))
16
- $datBas::database(md5)
17
- end
18
- def sha1(dato)
19
- sha1 = OpenSSL::Digest::SHA1.hexdigest(dato)
20
- puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + sha1
21
- DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha1.db'))
22
- $datBas::database(sha1)
23
- end
24
- def sha224(dato)
25
- sha224 = OpenSSL::Digest::SHA224.hexdigest(dato)
26
- puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + sha224
27
- DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha224.db'))
28
- $datBas::database(sha224)
29
- end
30
- def sha256(dato)
31
- sha256 = OpenSSL::Digest::SHA256.hexdigest(dato)
32
- puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + sha256
33
- DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha256.db'))
34
- $datBas::database(sha256)
35
- end
36
- def sha384(dato)
37
- sha384 = OpenSSL::Digest::SHA384.hexdigest(dato)
38
- puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + sha384
39
- DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', '384.db'))
40
- $datBas::database(sha384)
41
- end
42
- def sha512(dato)
43
- sha512 = OpenSSL::Digest::SHA512.hexdigest(dato)
44
- puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + sha512
45
- DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha512.db'))
46
- $datBas::database(sha512)
47
- end
48
- def ripemd160(dato)
49
- ripemd160 = OpenSSL::Digest::RIPEMD160.hexdigest(dato)
50
- puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: " + ripemd160
51
- DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'ripemd160.db'))
52
- $datBas::database(ripemd160)
6
+ def show(mode, dato)
7
+ encrypt = OpenStruct.new
8
+ encrypt.mode = mode.downcase
9
+ encrypt.dato = dato
10
+ if (encrypt.mode.eql?('md4'))
11
+ encrypt.crypt = OpenSSL::Digest::MD4.hexdigest(dato)
12
+ elsif (encrypt.mode.eql?('md5'))
13
+ encrypt.crypt = OpenSSL::Digest::MD5.hexdigest(dato)
14
+ elsif (encrypt.mode.eql?('sha1'))
15
+ encrypt.crypt = OpenSSL::Digest::SHA1.hexdigest(dato)
16
+ elsif (encrypt.mode.eql?('sha224'))
17
+ encrypt.crypt = OpenSSL::Digest::SHA224.hexdigest(dato)
18
+ elsif (encrypt.mode.eql?('sha256'))
19
+ encrypt.crypt = OpenSSL::Digest::SHA256.hexdigest(dato)
20
+ elsif (encrypt.mode.eql?('sha384'))
21
+ encrypt.crypt = OpenSSL::Digest::SHA384.hexdigest(dato)
22
+ elsif (encrypt.mode.eql?('sha512'))
23
+ encrypt.crypt = OpenSSL::Digest::SHA512.hexdigest(dato)
24
+ elsif (encrypt.mode.eql?('ripemd160'))
25
+ encrypt.crypt = OpenSSL::Digest::RIPEMD160.hexdigest(dato)
26
+ end
27
+ unless (encrypt.crypt.nil?)
28
+ puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: #{encrypt.crypt}"
29
+ $datBas::database(encrypt.crypt)
30
+ DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md4.db'))
31
+ else
32
+ puts "\n\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Encrypt Text..."
33
+ end
53
34
  end
54
35
  end
55
36
  EnCrypt = Encrypt.new
data/lib/cobreak/force.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'sequel'
2
- require 'ostruct'
3
1
  require 'cobreak/function_hash'
4
2
  class Forze_brute
5
3
  def initialize(author = 'BreakerBox')
@@ -20,208 +18,90 @@ class Forze_brute
20
18
  arr << dato
21
19
  if (ha == arr)
22
20
  puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash already existing in the database: #{dato}"
23
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m decrypt the hash using --decrypt, see the help parameter for more information"
21
+ puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m show the hash using --show, see the help parameter for more information"
24
22
  exit
25
23
  end
26
24
  end
27
- def md4(dato, wordlist)
25
+ def word(dato, wordlist, type)
28
26
  verify(dato)
29
27
  forzebrute = OpenStruct.new
30
- forzebrute.time = Time.now
31
28
  forzebrute.hash = dato
29
+ forzebrute.type = type
32
30
  forzebrute.wordlist = wordlist
33
- require 'openssl'
34
- File.foreach(forzebrute.wordlist) {|line|
35
- line.chomp!
36
- forzebrute.md4 = OpenSSL::Digest::MD4.hexdigest(line)
37
- if (forzebrute.md4 == forzebrute.hash)
38
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
39
- puts line
40
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzebrute.time} seconds"
41
- $datBas::database(forzebrute.hash)
42
- DB::database(forzebrute.md4, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md4.db'))
43
- exit
31
+ if (forzebrute.type.downcase.eql?('md4'))
32
+ forzebrute.crypt = OpenSSL::Digest::MD4.new
33
+ elsif (forzebrute.type.downcase.eql?('md5'))
34
+ forzebrute.crypt = OpenSSL::Digest::MD5.new
35
+ elsif (forzebrute.type.downcase.eql?('sha1'))
36
+ forzebrute.crypt = OpenSSL::Digest::SHA1.new
37
+ elsif (forzebrute.type.downcase.eql?('sha224'))
38
+ forzebrute.crypt = OpenSSL::Digest::SHA224.new
39
+ elsif (forzebrute.type.downcase.eql?('sha256'))
40
+ forzebrute.crypt = OpenSSL::Digest::SHA256.new
41
+ elsif (forzebrute.type.downcase.eql?('sha384'))
42
+ forzebrute.crypt = OpenSSL::Digest::SHA384.new
43
+ elsif (forzebrute.type.downcase.eql?('sha512'))
44
+ forzebrute.crypt = OpenSSL::Digest::SHA512.new
45
+ elsif (forzebrute.type.downcase.eql?('ripemd160'))
46
+ forzebrute.crypt = OpenSSL::Digest::RIPEMD160.new
44
47
  end
45
- }
46
- if true
47
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Decrypted Text: #{dato}"
48
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Time: #{Time.now - forzebrute.time} seconds"
49
- end
50
- end
51
- def md5(dato, wordlist)
52
- # verify(dato)
53
- forzebrute = OpenStruct.new
54
- forzebrute.hash = dato
55
- forzebrute.wordlist = wordlist
56
- require 'digest/md5'
57
- forzebrute.time = Time.now
58
- File.foreach(forzebrute.wordlist) {|line|
59
- line.chomp!
60
- forzebrute.md5 = Digest::MD5.hexdigest(line)
61
- if (forzebrute.md5 == forzebrute.hash)
62
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
63
- puts line
64
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzebrute.time} seconds"
65
- $datBas::database(forzebrute.hash)
66
- DB::database(forzebrute.md5, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md5.db'))
67
- exit
68
- end
69
- }
70
- if true
71
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Decrypted Text: #{dato}"
72
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Time: #{Time.now - forzebrute.time} seconds"
73
- exit
74
- end
75
- end
76
- def sha1(dato, wordlist)
77
- verify(dato)
78
- forzebrute = OpenStruct.new
79
- forzebrute.time = Time.now
80
- forzebrute.hash = dato
81
- forzebrute.wordlist = wordlist
82
- require 'digest/sha1'
83
- File.foreach(forzebrute.wordlist) {|line|
84
- line.chomp!
85
- forzebrute.sha1 = Digest::SHA1.hexdigest(line)
86
- if (forzebrute.sha1 == forzebrute.hash)
87
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
88
- puts line
89
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzebrute.time} seconds"
90
- $datBas::database(forzebrute.hash)
91
- DB::database(forzebrute.sha1, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha1.db'))
92
- exit
93
- end
94
- }
95
- if true
96
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Decrypted Text: #{dato}"
97
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Time: #{Time.now - forzebrute.time} seconds"
98
- end
99
- end
100
- def sha224(dato, wordlist)
101
- verify(dato)
102
- forzebrute = OpenStruct.new
103
- forzebrute.time = Time.now
104
- forzebrute.hash = dato
105
- forzebrute.wordlist = wordlist
106
- require 'digest/sha224'
107
- File.foreach(forzebrute.wordlist) {|line|
108
- line.chomp!
109
- forzebrute.sha224 = Digest::SHA224.hexdigest(line)
110
- if (forzebrute.sha224 == forzebrute.hash)
111
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
112
- puts line
113
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzebrute.time} seconds"
114
- $datBas::database(forzebrute.hash)
115
- DB::database(forzebrute.sha224, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha224.db'))
116
- exit
117
- end
118
- }
119
- if true
120
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Decrypted Text: #{dato}"
121
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Time: #{Time.now - forzebrute.time} seconds"
122
- exit
123
- end
124
- end
125
- def sha256(dato, wordlist)
126
- verify(dato)
127
- forzebrute = OpenStruct.new
128
- forzebrute.time = Time.now
129
- forzebrute.hash = dato
130
- forzebrute.wordlist = wordlist
131
- require 'digest/sha256'
132
- File.foreach(forzebrute.wordlist) {|line|
133
- line.chomp!
134
- forzebrute.sha256 = Digest::SHA256.hexdigest(line)
135
- if (forzebrute.sha256 == forzebrute.hash)
136
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
137
- puts line
138
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzebrute.time} seconds"
139
- $datBas::database(forzebrute.hash)
140
- DB::database(forzebrute.sha256, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha256.db'))
141
- exit
142
- end
143
- }
48
+ forzebrute.time = Time.now
49
+ File.foreach(forzebrute.wordlist) {|line|
50
+ line.chomp!
51
+ if (forzebrute.crypt.hexdigest(line).eql?(forzebrute.hash))
52
+ puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: " + line
53
+ puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzebrute.time} seconds"
54
+ $datBas::database(forzebrute.crypt.hexdigest(line))
55
+ DB::database(line, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{forzebrute.type}.db"))
56
+ exit
57
+ end
58
+ }
144
59
  if true
145
60
  puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Decrypted Text: #{dato}"
146
61
  puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Time: #{Time.now - forzebrute.time} seconds"
147
- exit
148
62
  end
149
63
  end
150
- def sha384(dato, wordlist)
64
+ def chars(dato, range, char, type)
151
65
  verify(dato)
152
- forzebrute = OpenStruct.new
153
- forzebrute.time = Time.now
154
- forzebrute.hash = dato
155
- forzebrute.wordlist = wordlist
156
- require 'digest/sha384'
157
- File.foreach(forzebrute.wordlist) {|line|
158
- line.chomp!
159
- forzebrute.sha384 = Digest::SHA384.hexdigest(line)
160
- if (forzebrute.sha384 == forzebrute.hash)
161
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
162
- puts line
163
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzebrute.time} seconds"
164
- $datBas::database(forzebrute.hash)
165
- DB::database(forzebrute.sha384, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha384.db'))
166
- exit
167
- end
168
- }
169
- if true
170
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Decrypted Text: #{forzebrute.hash}"
171
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Time: #{Time.now - forzebrute.time} seconds"
172
- exit
173
- end
174
- end
175
- def sha512(dato, wordlist)
176
- verify(dato)
177
- forzebrute = OpenStruct.new
178
- forzebrute.time = Time.now
179
- forzebrute.hash = dato
180
- forzebrute.wordlist = wordlist
181
- require 'digest/sha512'
182
- File.foreach(forzebrute.wordlist) {|line|
183
- line.chomp!
184
- forzebrute.sha512 = Digest::SHA512.hexdigest(line)
185
- if (forzebrute.sha512 == forzebrute.hash)
186
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
187
- puts line
188
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzebrute.time} seconds"
189
- $datBas::database(forzebrute.hash)
190
- DB::database(forzebrute.sha512, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha512.db'))
191
- exit
192
- end
193
- }
194
- if true
195
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Decrypted Text: #{forzebrute.hash}"
196
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Time: #{Time.now - forzebrute.time} seconds"
197
- exit
198
- end
199
- end
200
- def ripemd160(dato, wordlist)
201
- verify(dato)
202
- verify(dato)
203
- forzebrute = OpenStruct.new
204
- forzebrute.time = Time.now
205
- forzebrute.hash = dato
206
- forzebrute.wordlist = wordlist
207
- require 'digest/rmd160'
208
- File.foreach(forzebrute.wordlist) {|line|
209
- line.chomp!
210
- forzebrute.ripemd160 = Digest::RMD160.hexdigest(line)
211
- if (forzebrute.ripemd160 == forzebrute.hash)
212
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
213
- puts line
214
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzebrute.time} seconds"
215
- $datBas::database(forzebrute.hash)
216
- DB::database(forzebrute.ripemd160, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'ripemd160.db'))
217
- exit
66
+ forzechars = OpenStruct.new
67
+ forzechars.dato = dato
68
+ forzechars.range = range
69
+ forzechars.char = char.chars
70
+ forzechars.type = type
71
+ if (forzechars.type.downcase.eql?('md4'))
72
+ forzechars.crypt = OpenSSL::Digest::MD4.new
73
+ elsif (forzechars.type.downcase.eql?('md5'))
74
+ forzechars.crypt = OpenSSL::Digest::MD5.new
75
+ elsif (forzechars.type.downcase.eql?('sha1'))
76
+ forzechars.crypt = OpenSSL::Digest::SHA1.new
77
+ elsif (forzechars.type.downcase.eql?('sha224'))
78
+ forzechars.crypt = OpenSSL::Digest::SHA224.new
79
+ elsif (forzechars.type.downcase.eql?('sha256'))
80
+ forzechars.crypt = OpenSSL::Digest::SHA256.new
81
+ elsif (forzechars.type.downcase.eql?('sha384'))
82
+ forzechars.crypt = OpenSSL::Digest::SHA384.new
83
+ elsif (forzechars.type.downcase.eql?('sha512'))
84
+ forzechars.crypt = OpenSSL::Digest::SHA512.new
85
+ elsif (forzechars.type.downcase.eql?('ripemd160'))
86
+ forzechars.crypt = OpenSSL::Digest::RIPEMD160.new
87
+ end
88
+ forzechars.time = Time.now
89
+ for range in (forzechars.range[0].to_i..forzechars.range[1].to_i).to_a
90
+ for chars in forzechars.char.repeated_permutation(range).map(&:join)
91
+ if (forzechars.crypt.hexdigest(chars.chomp)) == (forzechars.dato)
92
+ puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: #{chars}"
93
+ puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzechars.time} seconds"
94
+ $datBas::database(forzechars.crypt.hexdigest(chars))
95
+ DB::database(chars, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{forzechars.type}.db"))
96
+ exit
97
+ end
218
98
  end
219
- }
220
- if true
221
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Decrypted Text: #{forzebrute.hash}"
222
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Time: #{Time.now - forzebrute.time} seconds"
223
- exit
224
- end
99
+ end
100
+ if true
101
+ puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Decrypted Text..."
102
+ puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Time: #{Time.now - forzechars.time}"
103
+ end
225
104
  end
226
105
  end
227
106
  ForzeBrute = Forze_brute.new
107
+
@@ -39,40 +39,12 @@ module CoBreak
39
39
  IO.foreach(@options.algo.to_s){|line|
40
40
  line.chomp!
41
41
  if (@options.bruteforce.to_s.downcase.eql?('md4'))
42
- ForzeBrute::md4(line, @options.wordlist)
43
- elsif (@options.bruteforce.to_s.downcase.eql?('md5'))
44
- ForzeBrute::md5(line, @options.wordlist)
45
- elsif (@options.bruteforce.to_s.downcase.eql?('sha1'))
46
- ForzeBrute::sha1(line, @options.wordlist)
47
- elsif (@options.bruteforce.to_s.downcase.eql?('sha224'))
48
- ForzeBrute::sha224(line, @options.wordlist)
49
- elsif (@options.bruteforce.to_s.downcase.eql?('sha256'))
50
- ForzeBrute::sha256(line, @options.wordlist)
51
- elsif (@options.bruteforce.to_s.downcase.eql?('sha384'))
52
- ForzeBrute::sha384(line, @options.wordlist)
53
- elsif (@options.bruteforce.to_s.downcase.eql?('sha512'))
54
- ForzeBrute::sha512(line, @options.wordlist)
55
- elsif (@options.bruteforce.to_s.downcase.eql?('ripemd160'))
56
- ForzeBrute::ripemd160(line, @options.wordlist)
42
+ ForzeBrute::word(line, @options.wordlist, @options.bruteforce.to_s)
57
43
  end
58
44
  }
59
45
  else
60
- if (@options.bruteforce.to_s.downcase.eql?('md4'))
61
- ForzeBrute::md4(@options.algo.to_s, @options.wordlist)
62
- elsif (@options.bruteforce.to_s.downcase.eql?('md5'))
63
- ForzeBrute::md5(@options.algo.to_s, @options.wordlist)
64
- elsif (@options.bruteforce.to_s.downcase.eql?('sha1'))
65
- ForzeBrute::sha1(@options.algo.to_s, @options.wordlist)
66
- elsif (@options.bruteforce.to_s.downcase.eql?('sha224'))
67
- ForzeBrute::sha224(@options.algo.to_s, @options.wordlist)
68
- elsif (@options.bruteforce.to_s.downcase.eql?('sha256'))
69
- ForzeBrute::sha256(@options.algo.to_s, @options.wordlist)
70
- elsif (@options.bruteforce.to_s.downcase.eql?('sha384'))
71
- ForzeBrute::sha384(@options.algo.to_s, @options.wordlist)
72
- elsif (@options.bruteforce.to_s.downcase.eql?('sha512'))
73
- ForzeBrute::sha512(@options.algo.to_s, @options.wordlist)
74
- elsif (@options.bruteforce.to_s.downcase.eql?('ripemd160'))
75
- ForzeBrute::ripemd160(@options.algo.to_s, @options.wordlist)
46
+ if (@hash.include?(@options.bruteforce.upcase))
47
+ ForzeBrute::word(@options.algo.to_s, @options.wordlist, @options.bruteforce.to_s)
76
48
  end
77
49
  end
78
50
  end
@@ -0,0 +1,65 @@
1
+ require 'ostruct'
2
+ module CoBreak
3
+ class BruteChars
4
+ def initialize(options)
5
+ @options = options
6
+ @hash = %w[MD4 MD5 SHA1 SHA224 SHA256 SHA384 SHA512 RIPEMD160]
7
+ end
8
+ def banner_chars()
9
+ puts "\e[32m╭─[\e[0m CoBreak: #{CoBreak.version}"
10
+ unless (@options.range.nil?)
11
+ puts "\e[32m├─[\e[0m Range: #{@options.range[0]} #{@options.range[1]}"
12
+ else
13
+ puts "\e[31m├─[\e[0m Range Not Found"
14
+ end
15
+ unless (@options.chars.nil?) or (@options.chars.empty?)
16
+ puts "\e[32m├─[\e[0m Characters: #{@options.chars}"
17
+ else
18
+ puts "\e[31m├─[\e[0m Characters Not Found"
19
+ end
20
+ if (@hash.include?(@options.bruteforce.to_s.upcase))
21
+ puts "\e[32m├─[\e[0m Type Hash: #{@options.bruteforce.upcase}"
22
+ else
23
+ puts "\e[31m├─[\e[0m Type Hash Not Found"
24
+ end
25
+ unless (@options.algo.nil?) or (@options.algo.empty?)
26
+ puts "\e[32m╰─[\e[0m Hash: #{@options.algo}\n\n"
27
+ else
28
+ puts "\e[31m╰─[\e[0m Hash Not Found"
29
+ end
30
+ end
31
+ def chars()
32
+ # if (@options.range.empty?) or (@options.chars.nil?) or (@param.algo.nil?)
33
+ # abort "\n"
34
+ # end"
35
+ if (@hash.include?(@options.bruteforce.upcase))
36
+ if (File.exists?(@options.algo.to_s))
37
+ IO.foreach(@options.algo){|line|
38
+ line.chomp!
39
+ if (@options.bruteforce.to_s.downcase.eql?('md4'))
40
+ ForzeBrute::md4(line, @options)
41
+ elsif (@options.bruteforce.to_s.downcase.eql?('md5'))
42
+ ForzeBrute::md5(line, @options)
43
+ elsif (@options.bruteforce.to_s.downcase.eql?('sha1'))
44
+ ForzeBrute::sha1(line, @options)
45
+ elsif (@options.bruteforce.to_s.downcase.eql?('sha224'))
46
+ ForzeBrute::sha224(line, @options)
47
+ elsif (@options.bruteforce.to_s.downcase.eql?('sha256'))
48
+ ForzeBrute::sha256(line, @options)
49
+ elsif (@options.bruteforce.to_s.downcase.eql?('sha384'))
50
+ ForzeBrute::sha384(line, @options)
51
+ elsif (@options.bruteforce.to_s.downcase.eql?('sha512'))
52
+ ForzeBrute::sha512(line, @options)
53
+ elsif (@options.bruteforce.to_s.downcase.eql?('ripemd160'))
54
+ ForzeBrute::ripemd160(line, @options)
55
+ end
56
+ }
57
+ else
58
+ if (@hash.include?(@options.bruteforce.upcase))
59
+ ForzeBrute::chars(@options.algo, @options.range, @options.chars, @options.bruteforce)
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end