cobreak 0.0.3 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -20
- data/cobreak.gemspec +16 -11
- 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 -29
- data/lib/cobreak/optionpr.rb +36 -9
- data/lib/cobreak/show/md4.db +0 -6
- data/lib/cobreak/show/md5.db +0 -14
- data/lib/cobreak/show/ripemd160.db +0 -1
- data/lib/cobreak/show/sha1.db +0 -3
- data/lib/cobreak/show/sha224.db +0 -1
- data/lib/cobreak/show/sha256.db +0 -1
- data/lib/cobreak/show/sha384.db +0 -1
- data/lib/cobreak/show/sha512.db +0 -1
- data/lib/cobreak/version.rb +1 -1
- metadata +65 -10
- data/dicc.txt +0 -1
- data/hola.txt +0 -1397760
- data/prueba.txt +0 -2
data/lib/cobreak/decrypt.rb
CHANGED
@@ -2,109 +2,42 @@ require 'openssl'
|
|
2
2
|
require 'sequel'
|
3
3
|
require 'cobreak/version'
|
4
4
|
class Decrypt
|
5
|
-
def
|
6
|
-
|
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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
42
|
-
puts dbs[:hashes].filter(hash:dato).map(:original)
|
43
|
-
end
|
44
|
-
def sha224(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha224.db'))
|
45
|
-
dbs = Sequel.sqlite
|
46
|
-
dbs.create_table? :hashes do
|
47
|
-
String :original
|
48
|
-
String :hash
|
49
|
-
end
|
50
|
-
IO.foreach(wordlist) {|line|
|
51
|
-
line.chomp!
|
52
|
-
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA224.hexdigest(line)}
|
53
|
-
}
|
54
|
-
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
55
|
-
puts dbs[:hashes].filter(hash:dato).map(:original)
|
56
|
-
end
|
57
|
-
def sha256(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha256.db'))
|
58
|
-
dbs = Sequel.sqlite
|
59
|
-
dbs.create_table? :hashes do
|
60
|
-
String :original
|
61
|
-
String :hash
|
62
|
-
end
|
63
|
-
IO.foreach(wordlist) {|line|
|
64
|
-
line.chomp!
|
65
|
-
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA256.hexdigest(line)}
|
66
|
-
}
|
67
|
-
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
68
|
-
puts dbs[:hashes].filter(hash:dato).map(:original)
|
69
|
-
end
|
70
|
-
def sha384(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha384.db'))
|
71
|
-
dbs = Sequel.sqlite
|
72
|
-
dbs.create_table? :hashes do
|
73
|
-
String :original
|
74
|
-
String :hash
|
75
|
-
end
|
76
|
-
IO.foreach(wordlist) {|line|
|
77
|
-
line.chomp!
|
78
|
-
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA384.hexdigest(line)}
|
79
|
-
}
|
80
|
-
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
81
|
-
puts dbs[:hashes].filter(hash:dato).map(:original)
|
82
|
-
end
|
83
|
-
def sha512(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha512.db'))
|
84
|
-
dbs = Sequel.sqlite
|
85
|
-
dbs.create_table? :hashes do
|
86
|
-
String :original
|
87
|
-
String :hash
|
88
|
-
end
|
89
|
-
IO.foreach(wordlist) {|line|
|
90
|
-
line.chomp!
|
91
|
-
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA512.hexdigest(line)}
|
92
|
-
}
|
93
|
-
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
94
|
-
puts dbs[:hashes].filter(hash:dato).map(:original)
|
95
|
-
end
|
96
|
-
def ripemd160(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'ripemd160.db'))
|
97
|
-
dbs = Sequel.sqlite
|
98
|
-
dbs.create_table? :hashes do
|
99
|
-
String :original
|
100
|
-
String :hash
|
101
|
-
end
|
102
|
-
IO.foreach(wordlist) {|line|
|
103
|
-
line.chomp!
|
104
|
-
dbs[:hashes] << {original:line, hash:OpenSSL::Digest::RIPEMD160.hexdigest(line)}
|
105
|
-
}
|
106
|
-
print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
|
107
|
-
puts dbs[:hashes].filter(hash:dato).map(:original)
|
5
|
+
def show(mode, dato)
|
6
|
+
decrypt = OpenStruct.new
|
7
|
+
decrypt.mode = mode.downcase
|
8
|
+
decrypt.wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{decrypt.mode}.db")
|
9
|
+
dbs = Sequel.sqlite
|
10
|
+
dbs.create_table? :hashes do
|
11
|
+
String :original
|
12
|
+
String :hash
|
13
|
+
end
|
14
|
+
if (decrypt.mode.eql?('md4'))
|
15
|
+
decrypt.hash = OpenSSL::Digest::MD4.new
|
16
|
+
elsif (decrypt.mode.eql?('md5'))
|
17
|
+
decrypt.hash = OpenSSL::Digest::MD5.new
|
18
|
+
elsif (decrypt.mode.eql?('sha1'))
|
19
|
+
decrypt.hash = OpenSSL::Digest::SHA1.new
|
20
|
+
elsif (decrypt.mode.eql?('sha224'))
|
21
|
+
decrypt.hash = OpenSSL::Digest::SHA224.new
|
22
|
+
elsif (decrypt.mode.eql?('sha256'))
|
23
|
+
decrypt.hash = OpenSSL::Digest::SHA256.new
|
24
|
+
elsif (decrypt.mode.eql?('sha384'))
|
25
|
+
decrypt.hash = OpenSSL::Digest::SHA384.new
|
26
|
+
elsif (decrypt.mode.eql?('sha512'))
|
27
|
+
decrypt.hash = OpenSSL::Digest::SHA512.new
|
28
|
+
elsif (decrypt.mode.eql?('ripemd160'))
|
29
|
+
decrypt.hash = OpenSSL::Digest::RIPEMD160.new
|
30
|
+
end
|
31
|
+
File.foreach(decrypt.wordlist) {|line|
|
32
|
+
line.chomp!
|
33
|
+
dbs[:hashes] << {original:line, hash:decrypt.hash.hexdigest(line)}
|
34
|
+
}
|
35
|
+
decrypt.pass = dbs[:hashes].filter(hash:dato).map(:original)
|
36
|
+
unless (decrypt.pass.empty?)
|
37
|
+
puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Found: #{decrypt.pass.join(',')}"
|
38
|
+
else
|
39
|
+
puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Hash Not Found in Database..."
|
40
|
+
end
|
108
41
|
end
|
109
42
|
end
|
110
43
|
DeCrypt = Decrypt.new
|
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.hash)
|
55
|
+
DB::database(forzebrute.crypt.hexdigest(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.dato)
|
95
|
+
DB::database(forzechars.crypt.hexdigest(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
|
+
|