cobreak 0.0.4 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cobreak.gemspec +7 -8
- data/lib/cobreak/binary.rb +10 -0
- data/lib/cobreak/{Cesar.rb → cesar.rb} +5 -10
- data/lib/cobreak/cifrado.rb +28 -26
- data/lib/cobreak/cobreak.rb +30 -147
- data/lib/cobreak/decifrado.rb +28 -26
- data/lib/cobreak/decrypt.rb +36 -103
- data/lib/cobreak/encrypt.rb +28 -47
- data/lib/cobreak/force.rb +69 -189
- data/lib/cobreak/force_brute.rb +3 -31
- data/lib/cobreak/force_chars.rb +65 -0
- data/lib/cobreak/hash/hash.db +0 -0
- data/lib/cobreak/optionpr.rb +36 -9
- data/lib/cobreak/show/md4.db +0 -0
- data/lib/cobreak/show/md5.db +0 -0
- data/lib/cobreak/show/ripemd160.db +0 -0
- data/lib/cobreak/show/sha1.db +0 -0
- data/lib/cobreak/show/sha224.db +0 -0
- data/lib/cobreak/show/sha256.db +0 -0
- data/lib/cobreak/show/sha384.db +0 -0
- data/lib/cobreak/show/sha512.db +0 -0
- data/lib/cobreak/version.rb +1 -1
- metadata +42 -18
data/lib/cobreak/encrypt.rb
CHANGED
@@ -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
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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
|
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
|
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
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
#
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
64
|
+
def chars(dato, range, char, type)
|
151
65
|
verify(dato)
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
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
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
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
|
+
|
data/lib/cobreak/force_brute.rb
CHANGED
@@ -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::
|
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.
|
61
|
-
ForzeBrute::
|
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
|