cobreak 0.0.6 → 0.0.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a09c670a9a5b9b5953e1fafba85d2467a1fbaccdd16ffc837be34f6aed0fd6a9
4
- data.tar.gz: e31a4eec8f7859a2ebacc40d39aab1fd949653adb8a72259a592b0b42e9a248c
3
+ metadata.gz: 6f3aa9bece5d8c3accb9660d8b0bbc6efc962d1b334c86fdf426c18479f7537a
4
+ data.tar.gz: 66eff273559279aefe72ae90eae0523c481dc723d6647c8b8523539adc5cd977
5
5
  SHA512:
6
- metadata.gz: 0c4424194967159ad8b6fb0c4c7afe84b6a2dd74a1a710e4d1b8ad2240a50438ed5cdbe95971fd663bca7fce8ea247e1f67d8d46da0b97cf7deb03c8cf78ba7b
7
- data.tar.gz: 34b789efd4187eb4ff551c71744a42a5d8d291c6482fcd4d10adf51bea0e0ee445e3a16e49333af9d3838b426649ba2118977ef7be2ec6d4ac4361a751c000fb
6
+ metadata.gz: 2347f91a8a197f04557ab9a4b0ec3c29faa3f3d0778bf1045fe4c5d65e32b46ac9bf76ad761592e3c3174c3111140d1280a3270b6103477808e3157e6817d420
7
+ data.tar.gz: 92e4cd9f4f1d873ff71a4e04320f3b3ede2aeaeef8fdc0b7a967467bb41400164b04791b6a093b4ef67c10e6511d55d78f0f524f35798a8f9ca13aa73ca05418
data/cobreak.gemspec CHANGED
@@ -1,18 +1,17 @@
1
1
  Gem::Specification.new do |info|
2
2
  info.name = 'cobreak'
3
- info.version = '0.0.6'
3
+ info.version = '0.0.8'
4
4
  info.executables << "cobreak"
5
5
  info.description = "The CoBreak script is an cipher and cryptography tool"
6
- info.add_development_dependency "Digest"
7
- info.add_development_dependency "sequel"
8
- info.add_development_dependency "sqlite3"
9
- # info.extensions << 'Gemfile'
6
+ info.add_development_dependency "bundler", "~> 1.5"
7
+ info.add_development_dependency "Digest", "~> 3.0.0"
8
+ info.add_development_dependency "sequel", "~> 5.44.0"
9
+ info.add_development_dependency "sqlite3", "~> 1.4.2"
10
10
  info.authors = ["BreakerBox"]
11
11
  info.email = 'breakerhtb@gmail.com'
12
12
  info.summary = "Force Brute, Cipher, Cryptography"
13
- info.files = Dir["{lib}/**/*", "bin/*", "*.gemspec", "*.txt", "Gemfile", "LICENSE", "*.md"]
14
- info.homepage = 'https://rubygeminfo.org/breakerbox/cobreak'
15
- info.metadata = {"source_code_uri" => "https://github.com/BreakerBox/CoBreak"}
13
+ info.files = Dir["{lib}/**/*.rb"] + Dir["{lib}/**/show/*.db", "{lib}/**/hash/hash.db", "bin/*.rb", "*.gemspec", "diccionario.txt", "Gemfile", "LICENSE", "*.md"]
14
+ info.homepage = 'https://github.com/BreakerBox/CoBreak'
16
15
  info.license = 'MIT'
17
16
  info.post_install_message = "thanks for installing my gem"
18
17
  end
@@ -0,0 +1,10 @@
1
+ module CoBreak
2
+ class Binary
3
+ def self.binary(dato)
4
+ return dato.unpack("B*").join('')
5
+ end
6
+ def self.hexbinary(dato)
7
+ return [dato].pack("B*")
8
+ end
9
+ end
10
+ end
@@ -1,16 +1,13 @@
1
1
  class CesarCifrado
2
- attr_accessor :dato
3
- def initialize(dato = nil)
4
- @dato = dato
5
- end
6
2
  def cesar(dato, rotasiones, orientacion = 1)
3
+ cesar = OpenStruct.new
4
+ cesar.cad_rot = []
7
5
  alfa_mayus = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
8
6
  alfa_minus = "abcdefghijklmnopqrstuvwxyz"
9
7
  alf = 26
10
8
  lit_mayus = 65
11
9
  lit_minus = 97
12
10
  cad_rot = ""
13
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m CipherText: "
14
11
  for letra in dato.chars
15
12
  if !letra.match(/^[[:alpha:]]$/)
16
13
  cad_rot += letra
@@ -25,11 +22,9 @@ class CesarCifrado
25
22
  var_ascii = letra.ord
26
23
  rot_ver = rotasiones * orientacion
27
24
  new_pos = (var_ascii - limit + rot_ver) % alf
28
- cad_rot = alfabeto[new_pos]
29
- print cad_rot
25
+ cesar.cad_rot << alfabeto[new_pos]
30
26
  end
31
- puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Rotations Number: #{rotasiones}"
27
+ return cesar.cad_rot.join('')
32
28
  end
33
29
  end
34
- CifraCesar = CesarCifrado.new
35
- DecifraCesar = CesarCifrado.new
30
+ Cesar = CesarCifrado.new
@@ -2,31 +2,33 @@ require 'base64'
2
2
  require 'base32'
3
3
  require 'base16'
4
4
  require 'ascii85'
5
-
6
- class Cifrado
7
- attr_accessor :data
8
- def initialize(data = nil)
9
- @data = data
10
- end
11
- def base16(dato)
12
- bas16 = Base16.encode16(dato)
13
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{bas16}\e[0m"
14
- end
15
- def base32(dato)
16
- bas32 = Base32.encode(dato)
17
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{bas32}\e[0m"
18
- end
19
- def base64(dato)
20
- bas64 = Base64.encode64(dato)
21
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{bas64}"
22
- end
23
- def binary(dato)
24
- result = dato.unpack("B*").join('')
25
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{result}"
26
- end
27
- def ascii85(dato)
28
- asci85 = Ascii85.encode(dato)
29
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{asci85}"
5
+ require 'cobreak/cesar'
6
+ require 'cobreak/binary'
7
+ module CoBreak
8
+ class Cifrado
9
+ def self.cipher(mode, dato)
10
+ cipher = OpenStruct.new
11
+ cipher.mode = mode
12
+ cipher.dato = dato
13
+ if (cipher.mode.eql?('base16'))
14
+ cipher.result = Base16.encode16(dato)
15
+ elsif (cipher.mode.eql?('base32'))
16
+ cipher.result = Base32.encode(dato)
17
+ elsif (cipher.mode.eql?('base64'))
18
+ cipher.result = Base64.encode64(dato)
19
+ elsif (cipher.mode.eql?('ascii85'))
20
+ cipher.result = Ascii85.encode(dato)
21
+ elsif (cipher.mode.eql?('cesar'))
22
+ cipher.result = Cesar.cesar(dato, ARGV[0].to_i)
23
+ elsif (cipher.mode.eql?('binary'))
24
+ cipher.result = CoBreak::Binary.binary(dato)
25
+ end
26
+ unless (cipher.result.nil?) or (cipher.result.eql?(cipher.dato))
27
+ puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{cipher.result}"
28
+ puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Number Rotations: #{ARGV[0]}" if (cipher.mode.eql?('cesar'))
29
+ else
30
+ puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Cipher Text..."
31
+ end
32
+ end
30
33
  end
31
34
  end
32
- Cifra = Cifrado.new
@@ -8,7 +8,6 @@ module CoBreak
8
8
  begin
9
9
  require 'cobreak/cifrado'
10
10
  require 'cobreak/decifrado'
11
- require 'cobreak/Cesar'
12
11
  require 'cobreak/encrypt'
13
12
  require 'cobreak/decrypt'
14
13
  rescue LoadError => e
@@ -23,72 +22,25 @@ module CoBreak
23
22
  @options = $options
24
23
  @options.enc = "" if @options.enc.nil? == true
25
24
  @options.dec = "" if @options.dec.nil? == true
26
- if (@options.enc.casecmp?('base16')) or (@options.dec.casecmp?('base16'));
25
+ @options.cipher = %w[Base16 Base32 Base64 Ascii85 Binary Cesar]
26
+ if (@options.cipher.include?(@options.enc.capitalize)) or (@options.cipher.include?(@options.dec.capitalize));
27
27
  if (File.exists?(@options.algo));
28
28
  IO.foreach(@options.algo){|line|
29
- line.chomp!
30
- Cifra::base16(line.to_s) if (@options.enc.casecmp?('base16'))
31
- Decifra::base16(line.to_s) if (@options.dec.casecmp?('base16'))
29
+ line.chomp!
30
+ if (@options.cipher?(@options.enc.capitalize))
31
+ CoBreak::Cifrado.cipher(line.to_s)
32
+ end
33
+ if (@options.cipher.include?(@options.dec.capitalize))
34
+ CoBreak::Decifrado.cipher(line.to_s)
35
+ end
32
36
  }
33
- else;
34
- Cifra::base16(@options.algo.to_s) if (@options.enc.casecmp?('base16'))
35
- Decifra::base16(@options.algo.to_s) if (@options.dec.casecmp?('base16'))
36
- end
37
- elsif (@options.enc.casecmp?('base32')) or (@options.dec.casecmp?('base32'));
38
- if (File.exists?(@options.algo));
39
- IO.foreach(@options.algo){|line|
40
- line.chomp!
41
- Cifra::base32(line.to_s) if (@options.enc.casecmp?('base32'))
42
- Decifra::base32(line.to_s) if (@options.dec.casecmp('base32'))
43
- }
44
- else;
45
- Cifra::base32(@options.algo.to_s) if (@options.enc.casecmp?('base32'))
46
- Decifra::base32(@options.algo.to_s) if (@options.dec.casecmp?('base32'))
47
- end
48
- elsif (@options.enc.casecmp?('base64')) or (@options.dec.casecmp?('base64'));
49
- if (File.exists?(@options.algo));
50
- IO.foreach(@options.algo){|line|
51
- line.chomp!
52
- Cifra::base64(line.to_s) if (@options.enc.casecmp?('base64'))
53
- Decifra::base64(line.to_s) if (@options.dec.casecmp?('base64'))
54
- }
55
- else;
56
- Cifra::base64(@options.algo.to_s) if (@options.enc.casecmp?('base64'))
57
- Decifra::base64(@options.algo.to_s) if (@options.dec.casecmp?('base64'))
58
- end
59
- elsif (@options.enc.casecmp?('ascii85')) or (@options.dec.casecmp?('ascii85'));
60
- if (File.exists?(@options.algo));
61
- IO.foreach(@options.algo){|line|
62
- line.chomp!
63
- Cifra::ascii85(line.to_s) if (@options.enc.casecmp?('ascii85'))
64
- Decifra::ascii85(line.to_s) if (@options.dec.casecmp?('ascii85'))
65
- }
66
- else;
67
- Cifra::ascii85(@options.algo.to_s) if (@options.enc.casecmp?('ascii85'))
68
- Decifra::ascii85(@options.algo.to_s) if (@options.dec.casecmp?('ascii85'))
69
- end
70
- elsif (@options.enc.casecmp?('binary')) or (@options.dec.casecmp?('binary'));
71
- if (File.exists?(@options.algo));
72
- IO.foreach(@options.algo){|line|
73
- line.chomp!
74
- Cifra::binary(line.to_s) if (@options.enc.casecmp?('binary'))
75
- Decifra::binary(line.to_s) if (@options.dec.casecmp?('binary'))
76
- }
77
- else;
78
- Cifra::binary(@options.algo.to_s) if (@options.enc.casecmp?('binary'))
79
- Decifra::binary(@options.algo.to_s) if (@options.dec.casecmp?('binary'))
80
- end
81
- elsif (@options.enc.casecmp?('cesar')) or (@options.dec.casecmp?('cesar'));
82
- dat = ARGV[0]
83
- if (File.exists?(@options.algo));
84
- IO.foreach(@options.algo){|line|
85
- line.chomp!
86
- CifraCesar::cesar(line.to_s, dat.to_i) if (@options.enc.casecmp?('cesar'))
87
- DecifraCesar::cesar(line.to_s, dat.to_i, -1) if (@options.dec.casecmp?('cesar'))
88
- }
89
- else;
90
- CifraCesar::cesar(@options.algo.to_s, dat.to_i) if (@options.enc.casecmp?('cesar'))
91
- DecifraCesar::cesar(@options.algo.to_s, dat.to_i, -1) if (@options.dec.casecmp?('cesar'))
37
+ else
38
+ if (@options.cipher.include?(@options.enc.capitalize))
39
+ CoBreak::Cifrado::cipher(@options.enc, @options.algo.to_s)
40
+ end
41
+ if (@options.cipher.include?(@options.dec.capitalize))
42
+ CoBreak::Decifrado::cipher(@options.dec,@options.algo.to_s)
43
+ end
92
44
  end
93
45
  end
94
46
  end
@@ -98,94 +50,25 @@ module CoBreak
98
50
  @options = $options
99
51
  @options.encrypt = "" if @options.encrypt.nil? == true
100
52
  @options.decrypt = "" if @options.decrypt.nil? == true
101
- if (@options.encrypt.casecmp?("md4")) or (@options.decrypt.casecmp?("md4"));
102
- if (File.exists?(@options.algo));
103
- IO.foreach(@options.algo){|line|
104
- line.chomp!
105
- EnCrypt::md4(line) if (@options.encrypt.casecmp?("md4"))
106
- DeCrypt::md4(line) if (@options.decrypt.casecmp?("md4"))
107
- }
108
- else
109
- EnCrypt::md4(@options.algo) if (@options.encrypt.casecmp?("md4"))
110
- DeCrypt::md4(@options.algo) if (@options.decrypt.casecmp?("md4"))
111
- end
112
- elsif (@options.encrypt.casecmp?("md5")) or (@options.decrypt.casecmp?("md5"));
113
- if (File.exists?(@options.algo));
114
- IO.foreach(@options.algo){|line|
115
- line.chomp!
116
- EnCrypt::md5(line) if (@options.encrypt.casecmp?("md5"))
117
- DeCrypt::md5(line) if (@options.decrypt.casecmp?("md5"))
118
- }
119
- else
120
- EnCrypt::md5(@options.algo) if (@options.encrypt.casecmp?("md5"))
121
- DeCrypt::md5(@options.algo) if (@options.decrypt.casecmp?("md5"))
122
- end
123
- elsif (@options.encrypt.casecmp?("sha1")) or (@options.decrypt.casecmp?("sha1"))
124
- if (File.exists?(@options.algo));
125
- IO.foreach(@options.algo){|line|
126
- line.chomp!
127
- EnCrypt::sha1(line) if (@options.encrypt.casecmp?("sha1"))
128
- DeCrypt::sha1(line) if (@options.decrypt.casecmp?("sha1"))
129
- }
130
- else
131
- EnCrypt::sha1(@options.algo) if (@options.encrypt.casecmp?("sha1"))
132
- DeCrypt::sha1(@options.algo) if (@options.decrypt.casecmp?("sha1"))
133
- end
134
- elsif (@options.encrypt.casecmp?("sha224")) or (@options.decrypt.casecmp?("sha224"));
135
- if (File.exists?(@options.algo));
136
- IO.foreach(@options.algo){|line|
137
- line.chomp!
138
- EnCrypt::sha224(line) if (@options.encrypt.casecmp?("sha224"))
139
- DeCrypt::sha224(line) if (@options.decrypt.casecmp?("sha224"))
140
- }
141
- else
142
- EnCrypt::sha224(@options.algo) if (@options.encrypt.casecmp?("sha224"))
143
- DeCrypt::sha224(@options.algo) if (@options.decrypt.casecmp?("sha224"))
144
- end
145
- elsif (@options.encrypt.casecmp?("sha256")) or (@options.decrypt.casecmp?("sha256"));
146
- if (File.exists?(@options.algo));
147
- IO.foreach(@options.algo){|line|
148
- line.chomp!
149
- EnCrypt::sha256(line) if (@options.encrypt.casecmp?("sha256"))
150
- DeCrypt::sha256(line) if (@options.decrypt.casecmp?("sha256"))
151
- }
152
- else
153
- EnCrypt::sha256(@options.algo) if (@options.encrypt.casecmp?("sha256"))
154
- DeCrypt::sha256(@options.algo) if (@options.decrypt.casecmp?("sha256"))
155
- end
156
- elsif (@options.encrypt.casecmp?("sha384")) or (@options.decrypt.casecmp?("sha384"));
157
- if (File.exists?(@options.algo));
158
- IO.foreach(@options.algo){|line|
159
- line.chomp!
160
- EnCrypt::sha384(line) if (@options.encrypt.casecmp?("sha384"))
161
- DeCrypt::sha384(line) if (@options.decrypt.casecmp?("sha384"))
162
- }
163
- else
164
- EnCrypt::sha384(@options.algo) if (@options.encrypt.casecmp?("sha384"))
165
- DeCrypt::sha384(@options.algo) if (@options.decrypt.casecmp?("sha384"))
166
- end
167
- elsif (@options.encrypt.casecmp?("sha512")) or (@options.decrypt.casecmp?("sha512"));
168
- if (File.exists?(@options.algo));
169
- IO.foreach(@options.algo){|line|
170
- line.chomp!
171
- EnCrypt::sha512(line) if (@options.encrypt.casecmp?("sha512"))
172
- DeCrypt::sha512(line) if (@options.decrypt.casecmp?("sha512"))
173
- }
174
- else
175
- EnCrypt::sha512(@options.algo) if (@options.encrypt.casecmp?("sha512"))
176
- DeCrypt::sha512(@options.algo) if (@options.decrypt.casecmp?("sha512"))
177
- end
178
- elsif (@options.encrypt.casecmp?("ripemd160")) or (@options.decrypt.casecmp?("ripemd160"));
53
+ show = OpenStruct.new
54
+ show.hash = %w[MD4 MD5 SHA1 SHA224 SHA256 SHA384 SHA512 RIPEMD160]
55
+ if (show.hash.include?(@options.encrypt.upcase)) or (show.hash.include?(@options.decrypt.upcase));
179
56
  if (File.exists?(@options.algo));
180
57
  IO.foreach(@options.algo){|line|
181
- line.chomp!
182
- EnCrypt::ripemd160(line) if (@options.encrypt.casecmp?("ripemd160"))
183
- DeCrypt::ripemd160(line) if (@options.decrypt.casecmp?("ripemd160"))
58
+ line.chomp!
59
+ EnCrypt::show(@options.encrypt, line) if (show.hash.include?(@options.encrypt.upcase))
60
+ DeCrypt::show(@options.decrypt, line) if (show.hash.include?(@options.decrypt.upcase))
184
61
  }
185
62
  else
186
- EnCrypt::ripemd160(@options.algo) if (@options.encrypt.casecmp?("ripemd160"))
187
- DeCrypt::ripemd160(@options.algo) if (@options.decrypt.casecmp?("ripemd160"))
63
+ if (show.hash.include?(@options.encrypt.upcase))
64
+ EnCrypt::show(@options.encrypt, @options.algo)
65
+ end
66
+ if (show.hash.include?(@options.decrypt.upcase))
67
+ DeCrypt::show(@options.decrypt, @options.algo)
68
+ end
188
69
  end
70
+ else
71
+ abort "\e[31m[\e[0m✘\e[31m]\e[0m Invalid Hash Format"
189
72
  end
190
73
  end
191
74
  end
@@ -2,31 +2,33 @@ require 'base64'
2
2
  require 'base32'
3
3
  require 'base16'
4
4
  require 'ascii85'
5
-
6
- class Decifrado
7
- attr_accessor :data
8
- def initialize(data = nil)
9
- @data = data
10
- end
11
- def base16(dato)
12
- bas16 = Base16.decode16(dato)
13
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m DecipherText: #{bas16}\e[0m"
14
- end
15
- def base32(dato)
16
- bas32 = Base32.decode(dato)
17
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m DecipherText: #{bas32}\e[0m"
18
- end
19
- def base64(dato)
20
- bas64 = Base64.decode64(dato)
21
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m DecipherText: #{bas64}"
22
- end
23
- def binary(dato)
24
- result = [dato].pack("B*")
25
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m DecipherText: #{result}"
26
- end
27
- def ascii85(dato)
28
- asci85 = Ascii85.decode(dato)
29
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m DecipherText: #{asci85}"
5
+ require 'cobreak/cesar'
6
+ require 'cobreak/binary'
7
+ module CoBreak
8
+ class Decifrado
9
+ def self.cipher(mode, dato)
10
+ decipher = OpenStruct.new
11
+ decipher.mode = mode
12
+ decipher.dato = dato
13
+ if (decipher.mode.eql?('base16'))
14
+ decipher.result = Base16.decode16(decipher.dato)
15
+ elsif (decipher.mode.eql?('base32'))
16
+ decipher.result = Base32.decode(decipher.dato)
17
+ elsif (decipher.mode.eql?('base64'))
18
+ decipher.result = Base64.decode64(decipher.dato)
19
+ elsif (decipher.mode.eql?('ascii85'))
20
+ decipher.result = Ascii85.decode(decipher.dato)
21
+ elsif (decipher.mode.eql?('cesar'))
22
+ decipher.result = Cesar.cesar(decipher.dato, ARGV[0].to_i, -1)
23
+ elsif (decipher.mode.eql?('binary'))
24
+ decipher.result = CoBreak::Binary.hexbinary(decipher.dato)
25
+ end
26
+ unless (decipher.result.nil?) or (decipher.result.eql?(decipher.dato))
27
+ puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Ciphertext: #{decipher.result}"
28
+ puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Number Rotations: #{ARGV[0]}" if (decipher.mode.eql?('cesar'))
29
+ else
30
+ puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Cipher Text..."
31
+ end
32
+ end
30
33
  end
31
34
  end
32
- Decifra = Decifrado.new
@@ -2,109 +2,42 @@ require 'openssl'
2
2
  require 'sequel'
3
3
  require 'cobreak/version'
4
4
  class Decrypt
5
- def md4(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md4.db'))
6
- dbs = Sequel.sqlite
7
- dbs.create_table? :hashes do
8
- String :original
9
- String :hash
10
- end
11
- IO.foreach(wordlist) {|line|
12
- line.chomp!
13
- dbs[:hashes] << {original:line, hash:OpenSSL::Digest::MD4.hexdigest(line)}
14
- }
15
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
16
- puts dbs[:hashes].filter(hash:dato).map(:original)
17
- end
18
- def md5(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md5.db'))
19
- dbs = Sequel.sqlite
20
- dbs.create_table? :hashes do
21
- String :original
22
- String :hash
23
- end
24
- IO.foreach(wordlist) {|line|
25
- line.chomp!
26
- dbs[:hashes] << {original:line, hash:OpenSSL::Digest::MD5.hexdigest(line)}
27
- }
28
- print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: "
29
- puts dbs[:hashes].filter(hash:dato).map(:original)
30
- end
31
- def sha1(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha1.db'))
32
- dbs = Sequel.sqlite
33
- dbs.create_table? :hashes do
34
- String :original
35
- String :hash
36
- end
37
- IO.foreach(wordlist) {|line|
38
- line.chomp!
39
- dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA1.hexdigest(line)}
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
@@ -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')
@@ -24,204 +22,84 @@ class Forze_brute
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.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 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
+ exit
95
+ end
218
96
  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
97
+ end
98
+ if true
99
+ puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Decrypted Text..."
100
+ puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Time: #{Time.now - forzechars.time}"
101
+ end
225
102
  end
226
103
  end
227
104
  ForzeBrute = Forze_brute.new
105
+
@@ -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
@@ -1,6 +1,7 @@
1
1
  require 'optparse'
2
2
  require 'cobreak/cobreak'
3
3
  require 'cobreak/force_brute'
4
+ require 'cobreak/force_chars'
4
5
  require 'cobreak/version'
5
6
  require 'cobreak/list_all'
6
7
  module CoBreak
@@ -8,22 +9,22 @@ module CoBreak
8
9
  def self.optparse(options)
9
10
  begin
10
11
  OptionParser.new do|param|
11
- param.banner = "Usage: CoBreak.rb [--options] [text or file]"
12
+ param.banner = "Usage: CoBreak.rb [--mode] [--options] [text or file]"
12
13
  param.separator ''
13
14
  param.separator "Mode Cipher:"
14
- param.on('--encoding=[TYPE]', String, 'encoding parameter'){|en_co| options.enc = en_co}
15
- param.on('--decoding=[TYPE]', String, 'decoding parameter'){|de_co| options.dec = de_co}
15
+ param.on('--encoding=[TYPE]', String, 'encoding input text or file'){|en_co| options.enc = en_co}
16
+ param.on('--decoding=[TYPE]', String, 'decoding input text or file'){|de_co| options.dec = de_co}
16
17
  param.separator "Mode Cryptography"
17
18
  param.on('--encrypt=[FORMAT]', String, 'encrypt parameter'){|en_en| options.encrypt = en_en}
18
- param.on('--decrypt=[FORMAT]', String, 'decrypt parameter'){|de_en| options.decrypt = de_en}
19
19
  param.separator "Mode BruteForce"
20
20
  param.on('--bruteforce=[FORMAT]', String, 'brute force mode to crack a hash'){|modeforce| options.bruteforce = modeforce}
21
21
  param.separator ""
22
22
  param.separator "Options:"
23
23
  param.on('-l', '--list=TYPE or FORMAT', String, 'list cipher types of hash formats'){|lin| options.list = lin}
24
- param.on('-r', '--range MIN MAX', Integer, "word chars length"){|min| options.min = min}
25
- param.on('-c', '--chars CHARACTERS', 'character input to generate word lists'){|chars| options.chars = chars}
24
+ param.on('-r', '--range MIN MAX', Array, "word chars length"){|rang| options.range = rang}
25
+ param.on('-c', '--chars CHARACTERS', String, 'character input to generate word lists'){|chars| options.chars = chars}
26
26
  param.on('-w', '--wordlist=WORDLIST', 'Wordlist mode, read words from FILE or stadin (default: diccionario.txt)'){|wordlist| options.wordlist = wordlist}
27
+ param.on('--show=[FORMAT]', String, 'show decrypted specific hash'){|de_en| options.decrypt = de_en}
27
28
  param.on('-i', '--input FILE or TEXT', String, 'take file or text to carry out the process'){|alg| options.algo = alg}
28
29
  param.on_tail('-v', '--version', 'show version'){puts "CoBreak version #{CoBreak.version}"; exit}
29
30
  param.on_tail('-h', '--help', 'command to view help parameters'){puts param; exit}
@@ -45,15 +46,24 @@ module CoBreak
45
46
  end
46
47
  end
47
48
  CoBreak::Box.var(options)
48
- CoBreak::Box::Cipher.coding()
49
- CoBreak::Box::Cryptgraphy.crypt()
49
+ if !(options.enc.nil?) or !(options.dec.nil?)
50
+ CoBreak::Box::Cipher.coding()
51
+ end
52
+ if !(options.encrypt.nil?) or !(options.decrypt.nil?)
53
+ CoBreak::Box::Cryptgraphy.crypt()
54
+ end
50
55
  CoBreak::List.new(options)
51
56
  unless (options.wordlist.nil?) or (options.wordlist.empty?)
52
57
  bruteforce = CoBreak::BruteForze.new(options)
53
58
  bruteforce.banner_wordlist()
54
59
  bruteforce.wordlist
55
60
  end
61
+ unless (options.chars.nil?) or (options.chars.empty?)
62
+ options.range << ARGV[0].to_i
63
+ brutechars = CoBreak::BruteChars.new(options)
64
+ brutechars.banner_chars()
65
+ brutechars.chars()
66
+ end
56
67
  end
57
68
  end
58
69
  end
59
-
@@ -1,5 +1,5 @@
1
1
  module CoBreak
2
2
  def self.version()
3
- return '0.0.6'
3
+ return '0.0.8'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,57 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobreak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - BreakerBox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-30 00:00:00.000000000 Z
11
+ date: 2021-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: Digest
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - ">="
31
+ - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: '0'
33
+ version: 3.0.0
20
34
  type: :development
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - ">="
38
+ - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '0'
40
+ version: 3.0.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: sequel
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - ">="
45
+ - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '0'
47
+ version: 5.44.0
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - ">="
52
+ - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '0'
54
+ version: 5.44.0
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: sqlite3
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ">="
59
+ - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '0'
61
+ version: 1.4.2
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ">="
66
+ - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '0'
68
+ version: 1.4.2
55
69
  description: The CoBreak script is an cipher and cryptography tool
56
70
  email: breakerhtb@gmail.com
57
71
  executables:
@@ -66,7 +80,8 @@ files:
66
80
  - cobreak.gemspec
67
81
  - diccionario.txt
68
82
  - lib/cobreak.rb
69
- - lib/cobreak/Cesar.rb
83
+ - lib/cobreak/binary.rb
84
+ - lib/cobreak/cesar.rb
70
85
  - lib/cobreak/cifrado.rb
71
86
  - lib/cobreak/cobreak.rb
72
87
  - lib/cobreak/decifrado.rb
@@ -75,6 +90,7 @@ files:
75
90
  - lib/cobreak/encrypt.rb
76
91
  - lib/cobreak/force.rb
77
92
  - lib/cobreak/force_brute.rb
93
+ - lib/cobreak/force_chars.rb
78
94
  - lib/cobreak/function_db.rb
79
95
  - lib/cobreak/function_hash.rb
80
96
  - lib/cobreak/hash/hash.db
@@ -91,11 +107,10 @@ files:
91
107
  - lib/cobreak/show/sha384.db
92
108
  - lib/cobreak/show/sha512.db
93
109
  - lib/cobreak/version.rb
94
- homepage: https://rubygeminfo.org/breakerbox/cobreak
110
+ homepage: https://github.com/BreakerBox/CoBreak
95
111
  licenses:
96
112
  - MIT
97
- metadata:
98
- source_code_uri: https://github.com/BreakerBox/CoBreak
113
+ metadata: {}
99
114
  post_install_message: thanks for installing my gem
100
115
  rdoc_options: []
101
116
  require_paths: