cobreak 0.0.6 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/README.md +0 -0
- data/bin/cbrdb +83 -0
- data/cobreak.gemspec +16 -9
- data/diccionario.txt +0 -0
- data/hash.txt +1 -0
- data/hola.txt +1398101 -0
- data/lib/cobreak.rb +0 -0
- data/lib/cobreak/binary.rb +10 -0
- data/lib/cobreak/{Cesar.rb → cesar.rb} +7 -12
- data/lib/cobreak/cifrado.rb +28 -26
- data/lib/cobreak/cobreak.rb +30 -147
- data/lib/cobreak/config/database.db +0 -0
- data/lib/cobreak/decifrado.rb +30 -26
- data/lib/cobreak/decrypt.rb +38 -105
- data/lib/cobreak/details.rb +0 -0
- data/lib/cobreak/encrypt.rb +30 -47
- data/lib/cobreak/force.rb +187 -202
- data/lib/cobreak/force_brute.rb +16 -39
- data/lib/cobreak/force_chars.rb +54 -0
- data/lib/cobreak/function_db.rb +0 -1
- data/lib/cobreak/function_hash.rb +0 -2
- data/lib/cobreak/hash/hash.db +1 -0
- data/lib/cobreak/info_author.rb +0 -0
- data/lib/cobreak/list_all.rb +6 -6
- data/lib/cobreak/optionpr.rb +42 -12
- data/lib/cobreak/run.rb +0 -0
- data/lib/cobreak/show/md4.db +1 -0
- data/lib/cobreak/show/md5.db +1 -0
- data/lib/cobreak/show/ripemd160.db +1 -0
- data/lib/cobreak/show/sha1.db +1 -0
- data/lib/cobreak/show/sha224.db +1 -0
- data/lib/cobreak/show/sha256.db +1 -0
- data/lib/cobreak/show/sha384.db +1 -0
- data/lib/cobreak/show/sha512.db +1 -0
- data/lib/cobreak/version.rb +1 -1
- data/outputs.txt +17 -0
- data/prueba.txt +4 -0
- metadata +172 -17
- data/LICENSE +0 -700
data/lib/cobreak/details.rb
CHANGED
File without changes
|
data/lib/cobreak/encrypt.rb
CHANGED
@@ -3,53 +3,36 @@ 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
|
-
|
35
|
-
|
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
|
+
case encrypt.mode
|
11
|
+
when ('md4')
|
12
|
+
encrypt.crypt = OpenSSL::Digest::MD4.hexdigest(dato)
|
13
|
+
when ('md5')
|
14
|
+
encrypt.crypt = OpenSSL::Digest::MD5.hexdigest(dato)
|
15
|
+
when ('sha1')
|
16
|
+
encrypt.crypt = OpenSSL::Digest::SHA1.hexdigest(dato)
|
17
|
+
when ('sha224')
|
18
|
+
encrypt.crypt = OpenSSL::Digest::SHA224.hexdigest(dato)
|
19
|
+
when ('sha256')
|
20
|
+
encrypt.crypt = OpenSSL::Digest::SHA256.hexdigest(dato)
|
21
|
+
when ('sha384')
|
22
|
+
encrypt.crypt = OpenSSL::Digest::SHA384.hexdigest(dato)
|
23
|
+
when ('sha512')
|
24
|
+
encrypt.crypt = OpenSSL::Digest::SHA512.hexdigest(dato)
|
25
|
+
when ('ripemd160')
|
26
|
+
encrypt.crypt = OpenSSL::Digest::RIPEMD160.hexdigest(dato)
|
27
|
+
else "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Type Hash Not Found"
|
28
|
+
end
|
29
|
+
unless (encrypt.crypt.nil?)
|
30
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Encrypted Text: #{encrypt.crypt}"
|
31
|
+
$datBas::database(encrypt.crypt)
|
32
|
+
DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{encrypt.mode}.db"))
|
33
|
+
else
|
34
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Not Encrypt Text..."
|
35
|
+
end
|
53
36
|
end
|
54
37
|
end
|
55
38
|
EnCrypt = Encrypt.new
|
data/lib/cobreak/force.rb
CHANGED
@@ -1,227 +1,212 @@
|
|
1
|
-
require 'sequel'
|
2
|
-
require 'ostruct'
|
3
1
|
require 'cobreak/function_hash'
|
4
2
|
class Forze_brute
|
3
|
+
attr_accessor :hash_input, :type_hash, :crypt, :min_chr, :max_chr, :charact, :word, :wordlist, :result, :out, :verbose, :crack
|
5
4
|
def initialize(author = 'BreakerBox')
|
6
5
|
@author = author
|
6
|
+
@result = nil
|
7
|
+
@crack = nil
|
8
|
+
@crypt = nil
|
9
|
+
@dict = nil
|
10
|
+
@word = nil
|
7
11
|
end
|
8
12
|
def verify(dato, word = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'hash', 'hash.db'))
|
9
13
|
hash_db = Sequel.sqlite
|
10
14
|
hash_db.create_table? :datahash do
|
11
15
|
String :ori
|
12
|
-
String :
|
16
|
+
String :hash
|
13
17
|
end
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
18
|
+
begin
|
19
|
+
IO.foreach(word) {|lin|
|
20
|
+
lin = lin.chomp
|
21
|
+
hash_db[:datahash] << {ori:lin, hash:dato}
|
22
|
+
}
|
23
|
+
rescue Errno::ENOENT
|
24
|
+
return
|
25
|
+
end
|
26
|
+
ha = hash_db[:datahash].filter(ori:dato).map(:hash)
|
19
27
|
arr = Array.new
|
20
28
|
arr << dato
|
21
29
|
if (ha == arr)
|
22
|
-
puts "\e[1;32m[\e[
|
23
|
-
puts "\e[1;32m[\e[
|
30
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash already existing in the database: #{dato}"
|
31
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m show the hash using --show, see the help parameter for more information\e[0m"
|
24
32
|
exit
|
25
33
|
end
|
26
34
|
end
|
27
|
-
def
|
28
|
-
verify(dato)
|
35
|
+
def word(dato, wordlist, type, out, verbose = false)
|
29
36
|
forzebrute = OpenStruct.new
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
44
|
-
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
|
37
|
+
@hash_input = dato
|
38
|
+
@type_hash = type
|
39
|
+
@out = out
|
40
|
+
@verbose = verbose
|
41
|
+
@wordlist = wordlist
|
42
|
+
File.foreach(File.join(Gem.path[1], "gems","cobreak-#{CoBreak.version}" , "lib", "cobreak", "config", "database.db"), mode: 'r'){|booleano|
|
43
|
+
forzebrute.booleano = booleano
|
44
|
+
if (booleano.eql?('true'))
|
45
|
+
verify(dato)
|
46
|
+
end
|
143
47
|
}
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
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
|
48
|
+
if (type_hash.downcase.eql?('md4'))
|
49
|
+
@crypt = OpenSSL::Digest::MD4.new
|
50
|
+
elsif (type_hash.downcase.eql?('md5'))
|
51
|
+
@crypt = OpenSSL::Digest::MD5.new
|
52
|
+
elsif (type_hash.downcase.eql?('sha1'))
|
53
|
+
@crypt = OpenSSL::Digest::SHA1.new
|
54
|
+
elsif (type_hash.downcase.eql?('sha224'))
|
55
|
+
@crypt = OpenSSL::Digest::SHA224.new
|
56
|
+
elsif (type_hash.downcase.eql?('sha256'))
|
57
|
+
@crypt = OpenSSL::Digest::SHA256.new
|
58
|
+
elsif (type_hash.downcase.eql?('sha384'))
|
59
|
+
@crypt = OpenSSL::Digest::SHA384.new
|
60
|
+
elsif (type_hash.downcase.eql?('sha512'))
|
61
|
+
@crypt = OpenSSL::Digest::SHA512.new
|
62
|
+
elsif (type_hash.downcase.eql?('ripemd160'))
|
63
|
+
@crypt = OpenSSL::Digest::RIPEMD160.new
|
167
64
|
end
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
65
|
+
lin = 0
|
66
|
+
forzebrute.time = Time.now
|
67
|
+
begin
|
68
|
+
if (verbose)
|
69
|
+
thread = Thread.new do
|
70
|
+
dict = File.open(wordlist, mode: 'r')
|
71
|
+
while word = dict.gets
|
72
|
+
lin += 1
|
73
|
+
$word = word
|
74
|
+
if (crypt.hexdigest(word.chomp).eql?(hash_input))
|
75
|
+
@result = word
|
76
|
+
verbose = false
|
77
|
+
thread.kill
|
78
|
+
end
|
79
|
+
end
|
80
|
+
verbose = 'no'
|
81
|
+
end
|
82
|
+
else
|
83
|
+
dict = File.open(wordlist, mode: 'r')
|
84
|
+
while word = dict.gets
|
85
|
+
lin += 1
|
86
|
+
begin
|
87
|
+
if (crypt.hexdigest(word.chomp).eql?(hash_input.chomp))
|
88
|
+
@result = word
|
89
|
+
verbose = false
|
90
|
+
break
|
91
|
+
end
|
92
|
+
rescue
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
while (verbose == true)
|
97
|
+
STDOUT.flush
|
98
|
+
begin
|
99
|
+
print "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{$word.chomp}" + " " *30
|
100
|
+
rescue
|
101
|
+
end
|
102
|
+
sleep(0.1)
|
103
|
+
end
|
104
|
+
if (verbose == false)
|
105
|
+
puts "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{result}"
|
106
|
+
puts "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Number of lines: #{lin}"
|
107
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash Cracking in #{Time.now - forzebrute.time} seconds"
|
108
|
+
else
|
109
|
+
puts "\r\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Not Cracking Text: #{hash_input}"
|
110
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Time: #{Time.now - forzebrute.time} seconds\e[0m"
|
111
|
+
end
|
112
|
+
if (forzebrute.booleano.eql?('true'))
|
113
|
+
$datBas::database(crypt.hexdigest(wordlist.chomp))
|
114
|
+
DB::database(result, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{type_hash}.db"))
|
115
|
+
end
|
116
|
+
if !(result.nil?)
|
117
|
+
if !(out.nil?)
|
118
|
+
File.open(out, mode: 'a'){|out|
|
119
|
+
out.puts "=================================================="
|
120
|
+
out.puts "software: CoBreak #{CoBreak.version}"
|
121
|
+
out.puts "Type Hash: #{type_hash}\n"
|
122
|
+
out.puts "#{result.chomp}:#{crypt.hexdigest(result)}"
|
123
|
+
out.puts "=================================================="
|
124
|
+
}
|
125
|
+
end
|
126
|
+
end
|
127
|
+
rescue Interrupt
|
128
|
+
puts "\n\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Interrupt mode"
|
129
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Password Not Cracked"
|
130
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Number of Lines: #{lin}"
|
131
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Wait Time: #{Time.now - forzebrute.time} seconds\e[0m"
|
191
132
|
exit
|
192
133
|
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
134
|
end
|
200
|
-
def
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
135
|
+
def chars(dato, range, char, type, out, verbose = false)
|
136
|
+
bool = File.open(File.join(Gem.path[1], "gems","cobreak-#{CoBreak.version}" , "lib", "cobreak", "config", "database.db"))
|
137
|
+
bool = bool.readlines[0].to_s.chomp
|
138
|
+
if (bool.eql?('true'))
|
139
|
+
verify(dato)
|
140
|
+
end
|
141
|
+
forzechars = OpenStruct.new
|
142
|
+
forzechars.dato = dato
|
143
|
+
forzechars.range = range
|
144
|
+
forzechars.char = char.chars
|
145
|
+
forzechars.type = type
|
146
|
+
forzechars.out = out
|
147
|
+
forzechars.verbose = verbose
|
148
|
+
forzechars.cont = Array.new
|
149
|
+
forzechars.result = nil
|
150
|
+
if (forzechars.type.downcase.eql?('md4'))
|
151
|
+
forzechars.crypt = OpenSSL::Digest::MD4.new
|
152
|
+
elsif (forzechars.type.downcase.eql?('md5'))
|
153
|
+
forzechars.crypt = OpenSSL::Digest::MD5.new
|
154
|
+
elsif (forzechars.type.downcase.eql?('sha1'))
|
155
|
+
forzechars.crypt = OpenSSL::Digest::SHA1.new
|
156
|
+
elsif (forzechars.type.downcase.eql?('sha224'))
|
157
|
+
forzechars.crypt = OpenSSL::Digest::SHA224.new
|
158
|
+
elsif (forzechars.type.downcase.eql?('sha256'))
|
159
|
+
forzechars.crypt = OpenSSL::Digest::SHA256.new
|
160
|
+
elsif (forzechars.type.downcase.eql?('sha384'))
|
161
|
+
forzechars.crypt = OpenSSL::Digest::SHA384.new
|
162
|
+
elsif (forzechars.type.downcase.eql?('sha512'))
|
163
|
+
forzechars.crypt = OpenSSL::Digest::SHA512.new
|
164
|
+
elsif (forzechars.type.downcase.eql?('ripemd160'))
|
165
|
+
forzechars.crypt = OpenSSL::Digest::RIPEMD160.new
|
166
|
+
end
|
167
|
+
lin = 0
|
168
|
+
begin
|
169
|
+
forzechars.time = Time.now
|
170
|
+
for range in (forzechars.range[0].to_i..forzechars.range[1].to_i).to_a
|
171
|
+
for chars in forzechars.char.repeated_permutation(range).map(&:join)
|
172
|
+
lin += 1
|
173
|
+
if (forzechars.verbose.eql?(true))
|
174
|
+
print "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{chars}"
|
175
|
+
end
|
176
|
+
if (forzechars.crypt.hexdigest(chars).eql?(forzechars.dato))
|
177
|
+
forzechars.result = chars
|
178
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{chars}"
|
179
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Number of Lines: #{lin}"
|
180
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash Cracking in #{Time.now - forzechars.time} seconds"
|
181
|
+
if bool.eql?('true')
|
182
|
+
$datBas::database(forzechars.crypt.hexdigest(chars))
|
183
|
+
DB::database(chars, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{forzechars.type}.db"))
|
184
|
+
end
|
185
|
+
if !(forzechars.out.nil?)
|
186
|
+
File.open(forzechars.out, mode: 'a'){|out|
|
187
|
+
out.puts "=================================================="
|
188
|
+
out.puts "software: CoBreak #{CoBreak.version}"
|
189
|
+
out.puts "Type Hash: #{forzechars.type}\n"
|
190
|
+
out.puts "#{chars}:#{forzechars.crypt.hexdigest(chars)}"
|
191
|
+
out.puts "=================================================="
|
192
|
+
}
|
193
|
+
end
|
194
|
+
break
|
195
|
+
end
|
196
|
+
end
|
218
197
|
end
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
198
|
+
rescue Interrupt
|
199
|
+
puts "\n\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Interrupt mode"
|
200
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Password Not Cracked"
|
201
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Number of Lines: #{lin}"
|
202
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Wait Time: #{Time.now - forzechars.time} seconds\e[0m"
|
203
|
+
exit
|
204
|
+
end
|
205
|
+
if (forzechars.result.nil?)
|
206
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Not Cracking Text: #{forzechars.dato}"
|
207
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Time: #{Time.now - forzechars.time}\e[0m"
|
208
|
+
exit
|
209
|
+
end
|
225
210
|
end
|
226
211
|
end
|
227
|
-
ForzeBrute = Forze_brute.new
|
212
|
+
ForzeBrute = Forze_brute.new
|