cobreaktws 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.vscode/settings.json +10 -0
- data/Gemfile +18 -0
- data/README.md +72 -0
- data/bin/cbrdb +95 -0
- data/bin/cobreak +11 -0
- data/cobreak.gemspec +28 -0
- data/ext/cobreak/cobreak.c +17 -0
- data/ext/cobreak/cobreak_cipher.c +341 -0
- data/ext/cobreak/cobreak_cipher.h +10 -0
- data/ext/cobreak/cobreak_gcrypt.c +556 -0
- data/ext/cobreak/cobreak_gcrypt.h +14 -0
- data/ext/cobreak/cobreak_openmp.c +9 -0
- data/ext/cobreak/cobreak_openmp.h +14 -0
- data/ext/cobreak/cobreak_openssl.c +438 -0
- data/ext/cobreak/cobreak_openssl.h +21 -0
- data/ext/cobreak/cobreak_ruby.h +24 -0
- data/ext/cobreak/extconf.rb +27 -0
- data/lib/cobreak/binary.rb +10 -0
- data/lib/cobreak/cesar.rb +30 -0
- data/lib/cobreak/cifrado.rb +30 -0
- data/lib/cobreak/cobreak_opt.rb +77 -0
- data/lib/cobreak/config/database.db +0 -0
- data/lib/cobreak/decifrado.rb +30 -0
- data/lib/cobreak/decrypt.rb +98 -0
- data/lib/cobreak/details.rb +19 -0
- data/lib/cobreak/encrypt.rb +114 -0
- data/lib/cobreak/force.rb +226 -0
- data/lib/cobreak/force_brute.rb +62 -0
- data/lib/cobreak/force_chars.rb +54 -0
- data/lib/cobreak/function_db.rb +26 -0
- data/lib/cobreak/function_hash.rb +28 -0
- data/lib/cobreak/hash/hash.db +1 -0
- data/lib/cobreak/info_author.rb +20 -0
- data/lib/cobreak/list_all.rb +41 -0
- data/lib/cobreak/optionpr.rb +148 -0
- data/lib/cobreak/run.rb +9 -0
- data/lib/cobreak/version.rb +5 -0
- data/lib/cobreak.rb +4 -0
- metadata +185 -0
@@ -0,0 +1,98 @@
|
|
1
|
+
require 'cobreak/version'
|
2
|
+
require 'cobreak/cobreak'
|
3
|
+
class Decrypt
|
4
|
+
def show(mode, dato)
|
5
|
+
decrypt = OpenStruct.new
|
6
|
+
decrypt.mode = mode
|
7
|
+
decrypt.wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{decrypt.mode}.db")
|
8
|
+
#decrypt.wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "MD5.db")
|
9
|
+
dbs = Sequel.sqlite
|
10
|
+
dbs = Sequel.sqlite
|
11
|
+
dbs.create_table? :hashes do
|
12
|
+
String :original
|
13
|
+
String :hash
|
14
|
+
end
|
15
|
+
case decrypt.mode
|
16
|
+
when ('md4')
|
17
|
+
decrypt.crypt = OpenSSL::Digest::MD4.new
|
18
|
+
when ('md5')
|
19
|
+
decrypt.crypt = OpenSSL::Digest::MD5.new
|
20
|
+
when ('sha1')
|
21
|
+
decrypt.crypt = OpenSSL::Digest::SHA1.new
|
22
|
+
when ('sha224')
|
23
|
+
decrypt.crypt = OpenSSL::Digest::SHA224.new
|
24
|
+
when ('sha256')
|
25
|
+
decrypt.crypt = OpenSSL::Digest::SHA256.new
|
26
|
+
when ('sha384')
|
27
|
+
decrypt.crypt = OpenSSL::Digest::SHA384.new
|
28
|
+
when ('sha512')
|
29
|
+
decrypt.crypt = OpenSSL::Digest::SHA512.new
|
30
|
+
when ('ripemd160')
|
31
|
+
decrypt.crypt = OpenSSL::Digest::RIPEMD160.new
|
32
|
+
end
|
33
|
+
File.foreach(decrypt.wordlist) {|line|
|
34
|
+
line.chomp!
|
35
|
+
if(decrypt.mode.downcase=='md4')
|
36
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::MD4.hexdigest(line)}
|
37
|
+
elsif(decrypt.mode.downcase=='md5')
|
38
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::MD5.hexdigest(line)}
|
39
|
+
elsif(decrypt.mode.downcase=='half-md5')
|
40
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::HALF_MD5.hexdigest(line)}
|
41
|
+
elsif(decrypt.mode.downcase=='sha1')
|
42
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::SHA1.hexdigest(line)}
|
43
|
+
elsif(decrypt.mode.downcase=='sha2-224')
|
44
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::SHA2_224.hexdigest(line)}
|
45
|
+
elsif(decrypt.mode.downcase=='sha2-256')
|
46
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::SHA2_256.hexdigest(line)}
|
47
|
+
elsif(decrypt.mode.downcase=='sha2-384')
|
48
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::SHA2_384.hexdigest(line)}
|
49
|
+
elsif(decrypt.mode.downcase=='sha2-512')
|
50
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::SHA2_512.hexdigest(line)}
|
51
|
+
elsif(decrypt.mode.downcase=='sha3-224')
|
52
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::SHA3_224.hexdigest(line)}
|
53
|
+
elsif(decrypt.mode.downcase=='sha3-256')
|
54
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::SHA3_256.hexdigest(line)}
|
55
|
+
elsif(decrypt.mode.downcase=='sha3-384')
|
56
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::SHA3_384.hexdigest(line)}
|
57
|
+
elsif(decrypt.mode.downcase=='sha3-512')
|
58
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::SHA3_512.hexdigest(line)}
|
59
|
+
elsif(decrypt.mode.downcase=='ripemd-160')
|
60
|
+
dbs[:hashes] << {original:line, hash:CoBreak::OpenSSL::RIPEMD_160.hexdigest(line)}
|
61
|
+
elsif(decrypt.mode.downcase=='tiger-160')
|
62
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::TIGER_160.hexdigest(line)}
|
63
|
+
elsif(decrypt.mode.downcase=='double-sha1')
|
64
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::DOUBLE_SHA1.hexdigest(line)}
|
65
|
+
elsif(decrypt.mode.downcase=='blake2s-128')
|
66
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::BLAKE2S_128.hexdigest(line)}
|
67
|
+
elsif(decrypt.mode.downcase=='blake2s-160')
|
68
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::BLAKE2S_160.hexdigest(line)}
|
69
|
+
elsif(decrypt.mode.downcase=='blake2s-224')
|
70
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::BLAKE2S_224.hexdigest(line)}
|
71
|
+
elsif(decrypt.mode.downcase=='blake2s-256')
|
72
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::BLAKE2S_256.hexdigest(line)}
|
73
|
+
elsif(decrypt.mode.downcase=='blake2b-160')
|
74
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::BLAKE2B_160.hexdigest(line)}
|
75
|
+
elsif(decrypt.mode.downcase=='blake2b-256')
|
76
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::BLAKE2B_256.hexdigest(line)}
|
77
|
+
elsif(decrypt.mode.downcase=='blake2b-384')
|
78
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::BLAKE2B_384.hexdigest(line)}
|
79
|
+
elsif(decrypt.mode.downcase=='blake2b-512')
|
80
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::BLAKE2B_512.hexdigest(line)}
|
81
|
+
elsif(decrypt.mode.downcase=='whirlpool')
|
82
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::WHIRLPOOL.hexdigest(line)}
|
83
|
+
elsif(decrypt.mode.downcase=='gost-streebog-256')
|
84
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::GOST_STREEBOG_256.hexdigest(line)}
|
85
|
+
elsif(decrypt.mode.downcase=='gost-streebog-512')
|
86
|
+
dbs[:hashes] << {original:line, hash:CoBreak::GCrypt::GOST_STREEBOG_512.hexdigest(line)}
|
87
|
+
end
|
88
|
+
}
|
89
|
+
decrypt.pass = dbs[:hashes].filter(hash:dato).map(:original)
|
90
|
+
unless (decrypt.pass.empty?)
|
91
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Type Hash: #{decrypt.mode}"
|
92
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash Found: #{decrypt.pass.join(',')}\e[0m"
|
93
|
+
else
|
94
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Hash Not Found in Database...\e[0m"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
DeCrypt = Decrypt.new
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module CoBreak
|
2
|
+
class Details
|
3
|
+
def self.info()
|
4
|
+
return "The CoBreak script is an cipher and cryptography tool made with the purpose of facilitating the encryption of data or others, it includes parameters to brute force the hashes through dictionaries"
|
5
|
+
end
|
6
|
+
def self.dependecias()
|
7
|
+
return %w(gcrypt openmp openssl sequel sqlite3)
|
8
|
+
end
|
9
|
+
def self.date()
|
10
|
+
return "2020-5-25"
|
11
|
+
end
|
12
|
+
def self.cipher()
|
13
|
+
return %w(base64 base32 base16 ascii85 cesar binary)
|
14
|
+
end
|
15
|
+
def self.crypt()
|
16
|
+
return %w(MD4 MD5 HALF-MD5 SHA1 SHA2-224 SHA2-256 SHA2-384 SHA2-512 SHA3-224 SHA3-256 SHA3-384 SHA3-512 RIPEMD-160 TIGER-160 DOUBLE-SHA1 BLAKE2S-128 BLAKE2S-160 BLAKE2B-160 BLAKE2S-224 BLAKE2S-256 BLAKE2B-256 BLAKE2B-384 BLAKE2B-512 WHIRLPOOL GOST-STREEBOG-256 GOST-STREEBOG-512 SHAKE-128)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,114 @@
|
|
1
|
+
require 'cobreak/function_db'
|
2
|
+
require 'cobreak/function_hash'
|
3
|
+
require 'cobreak/cobreak'
|
4
|
+
require 'cobreak/version'
|
5
|
+
|
6
|
+
class Encrypt
|
7
|
+
def show(mode, dato)
|
8
|
+
bool = File.open(File.join(Gem.path[1], "gems","cobreak-#{CoBreak.version}" , "lib", "cobreak", "config", "database.db"))
|
9
|
+
bool = bool.readlines[0].to_s.chomp
|
10
|
+
encrypt = OpenStruct.new
|
11
|
+
encrypt.mode = mode.downcase
|
12
|
+
encrypt.dato = dato
|
13
|
+
case encrypt.mode
|
14
|
+
when ('md4')
|
15
|
+
encrypt.crypt = CoBreak::OpenSSL::MD4.hexdigest(dato)
|
16
|
+
out_db = 'MD4'
|
17
|
+
when ('md5')
|
18
|
+
encrypt.crypt = CoBreak::OpenSSL::MD5.hexdigest(dato)
|
19
|
+
out_db = 'MD5'
|
20
|
+
when ('half-md5')
|
21
|
+
encrypt.crypt = CoBreak::OpenSSL::HALF_MD5.hexdigest(dato)
|
22
|
+
out_db = 'HALF-MD5'
|
23
|
+
when ('sha1')
|
24
|
+
encrypt.crypt = CoBreak::OpenSSL::SHA1.hexdigest(dato)
|
25
|
+
out_db = 'SHA1'
|
26
|
+
when ('sha2-224')
|
27
|
+
encrypt.crypt = CoBreak::OpenSSL::SHA2_224.hexdigest(dato)
|
28
|
+
out_db = 'SHA2-224'
|
29
|
+
when ('sha2-256')
|
30
|
+
encrypt.crypt = CoBreak::OpenSSL::SHA2_256.hexdigest(dato)
|
31
|
+
out_db = 'SHA2-256'
|
32
|
+
when ('sha2-384')
|
33
|
+
encrypt.crypt = CoBreak::OpenSSL::SHA2_384.hexdigest(dato)
|
34
|
+
out_db = 'SHA2-384'
|
35
|
+
when ('sha2-512')
|
36
|
+
encrypt.crypt = CoBreak::OpenSSL::SHA2_512.hexdigest(dato)
|
37
|
+
out_db = 'SHA2-512'
|
38
|
+
when ('sha3-224')
|
39
|
+
encrypt.crypt = CoBreak::OpenSSL::SHA3_224.hexdigest(dato)
|
40
|
+
out_db = 'SHA3-224'
|
41
|
+
when ('sha3-256')
|
42
|
+
encrypt.crypt = CoBreak::OpenSSL::SHA3_256.hexdigest(dato)
|
43
|
+
out_db = 'SHA3-256'
|
44
|
+
when ('sha3-384')
|
45
|
+
encrypt.crypt = CoBreak::OpenSSL::SHA3_384.hexdigest(dato)
|
46
|
+
out_db = 'SHA3-384'
|
47
|
+
when ('sha3-512')
|
48
|
+
encrypt.crypt = CoBreak::OpenSSL::SHA3_512.hexdigest(dato)
|
49
|
+
out_db = 'SHA3-512'
|
50
|
+
when ('ripemd-160')
|
51
|
+
encrypt.crypt = CoBreak::OpenSSL::RIPEMD_160.hexdigest(dato)
|
52
|
+
out_db = 'RIPEMD-160'
|
53
|
+
when ('SHAKE-128')
|
54
|
+
encrypt.crypt = CoBreak::GCrypt::SHAKE_128.hexdigest(dato)
|
55
|
+
out_db = 'SHAKE-128'
|
56
|
+
when ('gost-streebog-256')
|
57
|
+
encrypt.crypt = CoBreak::GCrypt::GOST_STREEBOG_256.hexdigest(dato)
|
58
|
+
out_db = 'GOST-STREEBOG-256'
|
59
|
+
when ('gost-streebog-512')
|
60
|
+
encrypt.crypt = CoBreak::GCrypt::GOST_STREEBOG_512.hexdigest(dato)
|
61
|
+
out_db = 'GOST-STREEBOG-512'
|
62
|
+
when ('tiger-160')
|
63
|
+
encrypt.crypt = CoBreak::GCrypt::TIGER_160.hexdigest(dato)
|
64
|
+
out_db = 'TIGER-160'
|
65
|
+
when ('double-sha1')
|
66
|
+
encrypt.crypt = CoBreak::GCrypt::DOUBLE_SHA1.hexdigest(dato)
|
67
|
+
out_db = 'DOUBLE-SHA1'
|
68
|
+
when ('blake2s-128')
|
69
|
+
encrypt.crypt = CoBreak::GCrypt::BLAKE2S_128.hexdigest(dato)
|
70
|
+
out_db = 'BLAKE2S-128'
|
71
|
+
when ('blake2s-160')
|
72
|
+
encrypt.crypt = CoBreak::GCrypt::BLAKE2S_160.hexdigest(dato)
|
73
|
+
out_db = 'BLAKE2S-160'
|
74
|
+
when ('blake2b-160')
|
75
|
+
encrypt.crypt = CoBreak::GCrypt::BLAKE2B_160.hexdigest(dato)
|
76
|
+
out_db = 'BLAKE2B-160'
|
77
|
+
when ('blake2s-224')
|
78
|
+
encrypt.crypt = CoBreak::GCrypt::BLAKE2S_224.hexdigest(dato)
|
79
|
+
out_db = 'BLAKE2S-224'
|
80
|
+
when ('blake2s-256')
|
81
|
+
encrypt.crypt = CoBreak::GCrypt::BLAKE2S_256.hexdigest(dato)
|
82
|
+
out_db = 'BLAKE2S-256'
|
83
|
+
when ('blake2b-256')
|
84
|
+
encrypt.crypt = CoBreak::GCrypt::BLAKE2B_256.hexdigest(dato)
|
85
|
+
out_db = 'BLAKE2B-256'
|
86
|
+
when ('blake2b-384')
|
87
|
+
encrypt.crypt = CoBreak::GCrypt::BLAKE2B_384.hexdigest(dato)
|
88
|
+
out_db = 'BLAKE2B-384'
|
89
|
+
when ('blake2b-512')
|
90
|
+
encrypt.crypt = CoBreak::GCrypt::BLAKE2B_512.hexdigest(dato)
|
91
|
+
out_db = 'BLAKE2B-512'
|
92
|
+
when ('whirlpool')
|
93
|
+
encrypt.crypt = CoBreak::GCrypt::WHIRLPOOL.hexdigest(dato)
|
94
|
+
out_db = 'WHIRLPOOL'
|
95
|
+
else "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Type Hash Not Found"
|
96
|
+
end
|
97
|
+
unless (encrypt.crypt.nil?)
|
98
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Encrypted Text: #{encrypt.crypt}"
|
99
|
+
begin
|
100
|
+
if bool.eql?('true')
|
101
|
+
$datBas::database(encrypt.crypt)
|
102
|
+
DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{out_db}.db"))
|
103
|
+
puts "\n\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash Saved In The Database"
|
104
|
+
end
|
105
|
+
rescue Errno::EACCES
|
106
|
+
puts "\n\n\e[1;31m[\e[1;37m✘\e[1;31m]\e[1;37m Access Denied"
|
107
|
+
puts "\e[1;31m[\e[1;37m✘\e[1;31m]\e[1;37m You need root privileges to save the hash to the database"
|
108
|
+
end
|
109
|
+
else
|
110
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Not Encrypt Text..."
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
EnCrypt = Encrypt.new
|
@@ -0,0 +1,226 @@
|
|
1
|
+
require 'cobreak/function_hash'
|
2
|
+
require 'cobreak/cobreak'
|
3
|
+
class Forze_brute
|
4
|
+
attr_accessor :hash_input, :type_hash, :crypt, :min_chr, :max_chr, :charact, :word, :wordlist, :result, :out, :verbose, :crack
|
5
|
+
def initialize(author = 'BreakerTW')
|
6
|
+
@author = author
|
7
|
+
@result = nil
|
8
|
+
@crack = nil
|
9
|
+
@crypt = nil
|
10
|
+
@dict = nil
|
11
|
+
@word = nil
|
12
|
+
end
|
13
|
+
def verify(dato, word = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'hash', 'hash.db'))
|
14
|
+
hash_db = Sequel.sqlite
|
15
|
+
hash_db.create_table? :datahash do
|
16
|
+
String :ori
|
17
|
+
String :hash
|
18
|
+
end
|
19
|
+
begin
|
20
|
+
IO.foreach(word) {|lin|
|
21
|
+
lin = lin.chomp
|
22
|
+
hash_db[:datahash] << {ori:lin, hash:dato}
|
23
|
+
}
|
24
|
+
rescue Errno::ENOENT
|
25
|
+
return
|
26
|
+
end
|
27
|
+
ha = hash_db[:datahash].filter(ori:dato).map(:hash)
|
28
|
+
arr = Array.new
|
29
|
+
arr << dato
|
30
|
+
if (ha == arr)
|
31
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash already existing in the database: #{dato}"
|
32
|
+
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"
|
33
|
+
exit
|
34
|
+
end
|
35
|
+
end
|
36
|
+
def word(dato, wordlist, type, out, verbose = false)
|
37
|
+
begin
|
38
|
+
raise Errno::EACCES, "\e[1;31m[\e[1;37m✘\e[1;31m]\e[1;37m root privileges needed" if `whoami`.chomp != "root"
|
39
|
+
rescue Errno::EACCES => e
|
40
|
+
puts e.message
|
41
|
+
exit
|
42
|
+
end
|
43
|
+
forzebrute = OpenStruct.new
|
44
|
+
@hash_input = dato
|
45
|
+
@type_hash = type
|
46
|
+
@out = out
|
47
|
+
@verbose = verbose
|
48
|
+
@wordlist = wordlist
|
49
|
+
File.foreach(File.join(Gem.path[1], "gems","cobreak-#{CoBreak.version}" , "lib", "cobreak", "config", "database.db"), mode: 'r'){|booleano|
|
50
|
+
forzebrute.booleano = booleano
|
51
|
+
if (booleano.eql?('true'))
|
52
|
+
verify(dato)
|
53
|
+
end
|
54
|
+
}
|
55
|
+
if (type_hash.downcase.eql?('md4'))
|
56
|
+
@crypt = OpenSSL::Digest::MD4.new
|
57
|
+
elsif (type_hash.downcase.eql?('md5'))
|
58
|
+
@crypt = OpenSSL::Digest::MD5.new
|
59
|
+
elsif (type_hash.downcase.eql?('sha1'))
|
60
|
+
@crypt = OpenSSL::Digest::SHA1.new
|
61
|
+
elsif (type_hash.downcase.eql?('sha224'))
|
62
|
+
@crypt = OpenSSL::Digest::SHA224.new
|
63
|
+
elsif (type_hash.downcase.eql?('sha256'))
|
64
|
+
@crypt = OpenSSL::Digest::SHA256.new
|
65
|
+
elsif (type_hash.downcase.eql?('sha384'))
|
66
|
+
@crypt = OpenSSL::Digest::SHA384.new
|
67
|
+
elsif (type_hash.downcase.eql?('sha512'))
|
68
|
+
@crypt = OpenSSL::Digest::SHA512.new
|
69
|
+
elsif (type_hash.downcase.eql?('ripemd160'))
|
70
|
+
@crypt = OpenSSL::Digest::RIPEMD160.new
|
71
|
+
end
|
72
|
+
lin = 0
|
73
|
+
forzebrute.time = Time.now
|
74
|
+
begin
|
75
|
+
if (verbose)
|
76
|
+
thread = Thread.new do
|
77
|
+
dict = File.open(wordlist, mode: 'r')
|
78
|
+
while word = dict.gets
|
79
|
+
lin += 1
|
80
|
+
$word = word
|
81
|
+
if (crypt.hexdigest(word.chomp).eql?(hash_input))
|
82
|
+
@result = word
|
83
|
+
verbose = false
|
84
|
+
thread.kill
|
85
|
+
end
|
86
|
+
end
|
87
|
+
verbose = 'no'
|
88
|
+
end
|
89
|
+
else
|
90
|
+
dict = File.open(wordlist, mode: 'r')
|
91
|
+
while word = dict.gets
|
92
|
+
lin += 1
|
93
|
+
begin
|
94
|
+
if (crypt.hexdigest(word.chomp).eql?(hash_input.chomp))
|
95
|
+
@result = word
|
96
|
+
verbose = false
|
97
|
+
break
|
98
|
+
end
|
99
|
+
rescue
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
while (verbose == true)
|
104
|
+
STDOUT.flush
|
105
|
+
begin
|
106
|
+
print "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{$word.chomp}" + " " *30
|
107
|
+
rescue
|
108
|
+
end
|
109
|
+
sleep(0.1)
|
110
|
+
end
|
111
|
+
if (verbose == false)
|
112
|
+
puts "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{result}"
|
113
|
+
puts "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Number of lines: #{lin}"
|
114
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash Cracking in #{Time.now - forzebrute.time} seconds"
|
115
|
+
else
|
116
|
+
puts "\r\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Not Cracking Text: #{hash_input}"
|
117
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Time: #{Time.now - forzebrute.time} seconds\e[0m"
|
118
|
+
end
|
119
|
+
if (forzebrute.booleano.eql?('true'))
|
120
|
+
$datBas::database(crypt.hexdigest(wordlist.chomp))
|
121
|
+
DB::database(result, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{out_db}.db"))
|
122
|
+
end
|
123
|
+
if !(result.nil?)
|
124
|
+
if !(out.nil?)
|
125
|
+
File.open(out, mode: 'a'){|out|
|
126
|
+
out.puts "=================================================="
|
127
|
+
out.puts "software: CoBreak #{CoBreak.version}"
|
128
|
+
out.puts "Type Hash: #{type_hash}\n"
|
129
|
+
out.puts "#{result.chomp}:#{crypt.hexdigest(result)}"
|
130
|
+
out.puts "=================================================="
|
131
|
+
}
|
132
|
+
end
|
133
|
+
end
|
134
|
+
rescue Interrupt
|
135
|
+
puts "\n\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Interrupt mode"
|
136
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Password Not Cracked"
|
137
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Number of Lines: #{lin}"
|
138
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Wait Time: #{Time.now - forzebrute.time} seconds\e[0m"
|
139
|
+
exit
|
140
|
+
end
|
141
|
+
end
|
142
|
+
def chars(dato, range, char, type, out, verbose = false)
|
143
|
+
begin
|
144
|
+
raise Errno::EACCES, "\e[1;31m[\e[1;37m✘\e[1;31m]\e[1;37m root privileges needed" if `whoami`.chomp != "root"
|
145
|
+
rescue Errno::EACCES => e
|
146
|
+
puts e.message
|
147
|
+
exit
|
148
|
+
end
|
149
|
+
bool = File.open(File.join(Gem.path[1], "gems","cobreak-#{CoBreak.version}" , "lib", "cobreak", "config", "database.db"))
|
150
|
+
bool = bool.readlines[0].to_s.chomp
|
151
|
+
if (bool.eql?('true'))
|
152
|
+
verify(dato)
|
153
|
+
end
|
154
|
+
forzechars = OpenStruct.new
|
155
|
+
forzechars.dato = dato
|
156
|
+
forzechars.range = range
|
157
|
+
forzechars.char = char.chars
|
158
|
+
forzechars.type = type
|
159
|
+
forzechars.out = out
|
160
|
+
forzechars.verbose = verbose
|
161
|
+
forzechars.cont = Array.new
|
162
|
+
forzechars.result = nil
|
163
|
+
if (forzechars.type.downcase.eql?('md4'))
|
164
|
+
forzechars.crypt = OpenSSL::Digest::MD4.new
|
165
|
+
elsif (forzechars.type.downcase.eql?('md5'))
|
166
|
+
forzechars.crypt = OpenSSL::Digest::MD5.new
|
167
|
+
elsif (forzechars.type.downcase.eql?('sha1'))
|
168
|
+
forzechars.crypt = OpenSSL::Digest::SHA1.new
|
169
|
+
elsif (forzechars.type.downcase.eql?('sha224'))
|
170
|
+
forzechars.crypt = OpenSSL::Digest::SHA224.new
|
171
|
+
elsif (forzechars.type.downcase.eql?('sha256'))
|
172
|
+
forzechars.crypt = OpenSSL::Digest::SHA256.new
|
173
|
+
elsif (forzechars.type.downcase.eql?('sha384'))
|
174
|
+
forzechars.crypt = OpenSSL::Digest::SHA384.new
|
175
|
+
elsif (forzechars.type.downcase.eql?('sha512'))
|
176
|
+
forzechars.crypt = OpenSSL::Digest::SHA512.new
|
177
|
+
elsif (forzechars.type.downcase.eql?('ripemd160'))
|
178
|
+
forzechars.crypt = OpenSSL::Digest::RIPEMD160.new
|
179
|
+
end
|
180
|
+
lin = 0
|
181
|
+
begin
|
182
|
+
forzechars.time = Time.now
|
183
|
+
for range in (forzechars.range[0].to_i..forzechars.range[1].to_i).to_a
|
184
|
+
for chars in forzechars.char.repeated_permutation(range).map(&:join)
|
185
|
+
lin += 1
|
186
|
+
if (forzechars.verbose.eql?(true))
|
187
|
+
print "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{chars}"
|
188
|
+
end
|
189
|
+
if (forzechars.crypt.hexdigest(chars).eql?(forzechars.dato))
|
190
|
+
forzechars.result = chars
|
191
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{chars}"
|
192
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Number of Lines: #{lin}"
|
193
|
+
puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash Cracking in #{Time.now - forzechars.time} seconds"
|
194
|
+
if bool.eql?('true')
|
195
|
+
forzechars.type = forzechars.type.downcase
|
196
|
+
$datBas::database(forzechars.crypt.hexdigest(chars))
|
197
|
+
DB::database(chars, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{forzechars.type}.db"))
|
198
|
+
end
|
199
|
+
if !(forzechars.out.nil?)
|
200
|
+
File.open(forzechars.out, mode: 'a'){|out|
|
201
|
+
out.puts "=================================================="
|
202
|
+
out.puts "software: CoBreak #{CoBreak.version}"
|
203
|
+
out.puts "Type Hash: #{forzechars.type}\n"
|
204
|
+
out.puts "#{chars}:#{forzechars.crypt.hexdigest(chars)}"
|
205
|
+
out.puts "=================================================="
|
206
|
+
}
|
207
|
+
end
|
208
|
+
return 0
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
rescue Interrupt
|
213
|
+
puts "\n\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Interrupt mode"
|
214
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Password Not Cracked"
|
215
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Number of Lines: #{lin}"
|
216
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Wait Time: #{Time.now - forzechars.time} seconds\e[0m"
|
217
|
+
exit
|
218
|
+
end
|
219
|
+
if (forzechars.result.nil?)
|
220
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Not Cracking Text: #{forzechars.dato}"
|
221
|
+
puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Time: #{Time.now - forzechars.time}\e[0m"
|
222
|
+
exit
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
226
|
+
ForzeBrute = Forze_brute.new
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#!/bin/env ruby
|
2
|
+
require 'ruby_figlet'
|
3
|
+
require 'cobreak/version'
|
4
|
+
using RubyFiglet
|
5
|
+
module CoBreak
|
6
|
+
class BruteForze
|
7
|
+
def initialize(options)
|
8
|
+
@options = options
|
9
|
+
@hash = %w[MD4 MD5 SHA1 SHA224 SHA256 SHA384 SHA512 RIPEMD160]
|
10
|
+
end
|
11
|
+
begin
|
12
|
+
require 'cobreak/force'
|
13
|
+
rescue LoadError => e
|
14
|
+
puts e.message
|
15
|
+
abort "reinstall gem new"
|
16
|
+
end
|
17
|
+
def banner_wordlist()
|
18
|
+
puts "\e[0;31m"
|
19
|
+
puts "cobreak".art("Bloody")
|
20
|
+
puts "\e[0m"
|
21
|
+
puts "\e[1;32m╭─[\e[37m CoBreak: #{CoBreak.version}"
|
22
|
+
if (File.exists?(@options.wordlist.to_s))
|
23
|
+
puts "\e[1;32m├─[\e[37m Wordlist: #{File.expand_path(@options.wordlist)}"
|
24
|
+
else
|
25
|
+
puts "\e[1;31m├─[\e[37m WordList Not Found"
|
26
|
+
end
|
27
|
+
if (@hash.include?(@options.bruteforce.to_s.upcase))
|
28
|
+
puts "\e[1;32m├─[\e[37m Type Hash: #{@options.bruteforce.upcase}"
|
29
|
+
else
|
30
|
+
puts "\e[1;31m├─[\e[37m Type Hash Not Found"
|
31
|
+
end
|
32
|
+
unless (@options.algo.nil?) or (@options.algo.empty?)
|
33
|
+
puts "\e[1;32m╰─[\e[37m Hash: #{@options.algo}\n\n"
|
34
|
+
else
|
35
|
+
puts "\e[1;31m╰─[\e[37m Hash Not Found"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
def wordlist()
|
39
|
+
if (@options.wordlist.nil?) or (@options.wordlist.empty?) or ('-'.include?(@options.wordlist.to_s))
|
40
|
+
abort "\n"
|
41
|
+
end
|
42
|
+
if (@hash.include?(@options.bruteforce.to_s.upcase))
|
43
|
+
if (File.exists?(@options.algo.to_s))
|
44
|
+
begin
|
45
|
+
IO.foreach(@options.algo.to_s){|line|
|
46
|
+
line.chomp!
|
47
|
+
if (@hash.include?(@options.bruteforce.to_s.upcase))
|
48
|
+
ForzeBrute::word(line, @options.wordlist, @options.bruteforce.to_s, @options.out, @options.verbose)
|
49
|
+
end
|
50
|
+
}
|
51
|
+
rescue ArgumentError => e
|
52
|
+
puts e.message
|
53
|
+
end
|
54
|
+
else
|
55
|
+
if (@hash.include?(@options.bruteforce.upcase.to_s))
|
56
|
+
ForzeBrute::word(@options.algo.to_s, @options.wordlist, @options.bruteforce.to_s, @options.out, @options.verbose)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
require 'ruby_figlet'
|
3
|
+
using RubyFiglet
|
4
|
+
module CoBreak
|
5
|
+
class BruteChars
|
6
|
+
def initialize(options)
|
7
|
+
@options = options
|
8
|
+
@hash = %w[MD4 MD5 SHA1 SHA224 SHA256 SHA384 SHA512 RIPEMD160]
|
9
|
+
end
|
10
|
+
def banner_chars()
|
11
|
+
puts "\e[0;31m"
|
12
|
+
puts "cobreak".art("Bloody")
|
13
|
+
puts "\e[0m"
|
14
|
+
puts "\e[1;32m╭─[\e[1;37m CoBreak: #{CoBreak.version}"
|
15
|
+
unless (@options.range.nil?)
|
16
|
+
puts "\e[32m├─[\e[1;37m Range: #{@options.range[0]} #{@options.range[1]}"
|
17
|
+
else
|
18
|
+
puts "\e[31m├─[\e[1;37m Range Not Found"
|
19
|
+
end
|
20
|
+
unless (@options.chars.nil?) or (@options.chars.empty?)
|
21
|
+
puts "\e[32m├─[\e[1;37m Characters: #{@options.chars}"
|
22
|
+
else
|
23
|
+
puts "\e[31m├─[\e[1;37m Characters Not Found"
|
24
|
+
end
|
25
|
+
if (@hash.include?(@options.bruteforce.to_s.upcase))
|
26
|
+
puts "\e[32m├─[\e[1;37m Type Hash: #{@options.bruteforce.upcase}"
|
27
|
+
else
|
28
|
+
puts "\e[31m├─[\e[1;37m Type Hash Not Found"
|
29
|
+
end
|
30
|
+
unless (@options.algo.nil?) or (@options.algo.empty?)
|
31
|
+
puts "\e[32m╰─[\e[1;37m Hash: #{@options.algo}\n\n"
|
32
|
+
else
|
33
|
+
puts "\e[31m╰─[\e[1;37m Hash Not Found"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
def chars()
|
37
|
+
# if (@options.range.empty?) or (@options.chars.nil?) or (@param.algo.nil?)
|
38
|
+
# abort "\n"
|
39
|
+
# end
|
40
|
+
if (@hash.include?(@options.bruteforce.upcase))
|
41
|
+
if (File.exists?(@options.algo.to_s))
|
42
|
+
IO.foreach(@options.algo){|line|
|
43
|
+
line.chomp!
|
44
|
+
ForzeBrute::chars(line, @options.range, @options.chars, @options.bruteforce, @options.out, @options.verbose)
|
45
|
+
}
|
46
|
+
else
|
47
|
+
if (@hash.include?(@options.bruteforce.upcase))
|
48
|
+
ForzeBrute::chars(@options.algo, @options.range, @options.chars, @options.bruteforce, @options.out, @options.verbose)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'sequel'
|
2
|
+
class DataBase
|
3
|
+
$db = Sequel.sqlite
|
4
|
+
$db.create_table? :database do
|
5
|
+
String :text_db
|
6
|
+
end
|
7
|
+
def initialize(alg = nil)
|
8
|
+
@alg = alg
|
9
|
+
end
|
10
|
+
def database(alg, var1)
|
11
|
+
if File.exists?(var1) == false
|
12
|
+
FileUtils.touch(var1)
|
13
|
+
end
|
14
|
+
IO.foreach(var1) {|line|
|
15
|
+
line.chomp!
|
16
|
+
$db[:database] << {text_db:line}
|
17
|
+
}
|
18
|
+
if ($db[:database].filter(text_db:alg).map(:text_db)).include?(alg) == true
|
19
|
+
exit
|
20
|
+
end
|
21
|
+
File.open(var1, mode: 'a'){|lin|
|
22
|
+
lin.puts alg
|
23
|
+
}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
DB = DataBase.new
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'cobreak/version'
|
2
|
+
require 'fileutils'
|
3
|
+
class BaseDato
|
4
|
+
$db = Sequel.sqlite
|
5
|
+
$db.create_table? :database do
|
6
|
+
String :text_db
|
7
|
+
end
|
8
|
+
def initialize(alg = nil)
|
9
|
+
@alg = alg
|
10
|
+
end
|
11
|
+
def database(alg)
|
12
|
+
var1 = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'hash', 'hash.db')
|
13
|
+
if File.exists?(var1) == false
|
14
|
+
FileUtils.touch(var1)
|
15
|
+
end
|
16
|
+
IO.foreach(var1) {|line|
|
17
|
+
line.chomp!
|
18
|
+
$db[:database] << {text_db:line}
|
19
|
+
}
|
20
|
+
if ($db[:database].filter(text_db:alg).map(:text_db)).include?(alg) == true
|
21
|
+
exit
|
22
|
+
end
|
23
|
+
File.open(var1, mode: 'a'){|lin|
|
24
|
+
lin.puts alg
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
$datBas = BaseDato.new
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module CoBreak
|
2
|
+
class Author
|
3
|
+
def self.author()
|
4
|
+
return "BreakerTW"
|
5
|
+
end
|
6
|
+
def self.email()
|
7
|
+
return "breakerhtb@gmail.com"
|
8
|
+
end
|
9
|
+
def self.date()
|
10
|
+
return "2020-5-25"
|
11
|
+
end
|
12
|
+
def self.telegram()
|
13
|
+
return "@BreakerBox"
|
14
|
+
end
|
15
|
+
def self.group()
|
16
|
+
group = "https://t.me/Black0utx"
|
17
|
+
return group
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|