cobreak 1.0.1 → 1.0.2

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.
data/lib/cobreak.rb CHANGED
File without changes
File without changes
data/lib/cobreak/cesar.rb CHANGED
@@ -2,8 +2,8 @@ class CesarCifrado
2
2
  def cesar(dato, rotasiones, orientacion = 1)
3
3
  cesar = OpenStruct.new
4
4
  cesar.cad_rot = []
5
- alfa_mayus = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
6
- alfa_minus = "abcdefghijklmnopqrstuvwxyz"
5
+ alfa_mayus = ('A'..'Z').to_a
6
+ alfa_minus = ('a'..'z').to_a
7
7
  alf = 26
8
8
  lit_mayus = 65
9
9
  lit_minus = 97
@@ -27,4 +27,4 @@ class CesarCifrado
27
27
  return cesar.cad_rot.join('')
28
28
  end
29
29
  end
30
- Cesar = CesarCifrado.new
30
+ Cesar = CesarCifrado.new
@@ -24,10 +24,10 @@ module CoBreak
24
24
  cipher.result = CoBreak::Binary.binary(dato)
25
25
  end
26
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'))
27
+ puts "\n\e[1;32m[\e[37m+\e[1;32m]\e[37m Ciphertext: #{cipher.result}"
28
+ puts "\e[1;32m[\e[37m+\e[1;32m]\e[37m Number Rotations: #{ARGV[0]}" if (cipher.mode.eql?('cesar'))
29
29
  else
30
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Cipher Text..."
30
+ puts "\e[1;31m[\e[37m+\e[1;31m]\e[37m Not Cipher Text..."
31
31
  end
32
32
  end
33
33
  end
@@ -51,24 +51,24 @@ module CoBreak
51
51
  @options.encrypt = "" if @options.encrypt.nil? == true
52
52
  @options.decrypt = "" if @options.decrypt.nil? == true
53
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));
54
+ show.crypt = %w[MD4 MD5 SHA1 SHA224 SHA256 SHA384 SHA512 RIPEMD160]
55
+ if (show.crypt.include?(@options.encrypt.upcase)) or (show.crypt.include?(@options.decrypt.upcase));
56
56
  if (File.exists?(@options.algo));
57
57
  IO.foreach(@options.algo){|line|
58
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))
59
+ EnCrypt::show(@options.encrypt, line) if (show.crypt.include?(@options.encrypt.upcase))
60
+ DeCrypt::show(@options.decrypt, line) if (show.crypt.include?(@options.decrypt.upcase))
61
61
  }
62
62
  else
63
- if (show.hash.include?(@options.encrypt.upcase))
63
+ if (show.crypt.include?(@options.encrypt.upcase))
64
64
  EnCrypt::show(@options.encrypt, @options.algo)
65
65
  end
66
- if (show.hash.include?(@options.decrypt.upcase))
66
+ if (show.crypt.include?(@options.decrypt.upcase))
67
67
  DeCrypt::show(@options.decrypt, @options.algo)
68
68
  end
69
69
  end
70
70
  else
71
- abort "\e[31m[\e[0m✘\e[31m]\e[0m Invalid Hash Format"
71
+ abort "\e[31m[\e[37m✘\e[31m]\e[37m Invalid Hash Format"
72
72
  end
73
73
  end
74
74
  end
File without changes
@@ -24,10 +24,12 @@ module CoBreak
24
24
  decipher.result = CoBreak::Binary.hexbinary(decipher.dato)
25
25
  end
26
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'))
27
+ puts "\n\e[1;32m[\e[37m+\e[1;32m]\e[37m DecipherText: #{decipher.result}"
28
+ if (decipher.mode.eql?('cesar'))
29
+ puts "\e[1;32m[\e[37m+\e[1;32m]\e[37m Number Rotations: #{ARGV[0]}"
30
+ end
29
31
  else
30
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Cipher Text..."
32
+ puts "\e[1;31m[\e[37m+\e[1;31m]\e[37m Not Cipher Text..."
31
33
  end
32
34
  end
33
35
  end
@@ -1,5 +1,3 @@
1
- require 'openssl'
2
- require 'sequel'
3
1
  require 'cobreak/version'
4
2
  class Decrypt
5
3
  def show(mode, dato)
@@ -11,32 +9,34 @@ class Decrypt
11
9
  String :original
12
10
  String :hash
13
11
  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
12
+ case decrypt.mode
13
+ when ('md4')
14
+ decrypt.crypt = OpenSSL::Digest::MD4.new
15
+ when ('md5')
16
+ decrypt.crypt = OpenSSL::Digest::MD5.new
17
+ when ('sha1')
18
+ decrypt.crypt = OpenSSL::Digest::SHA1.new
19
+ when ('sha224')
20
+ decrypt.crypt = OpenSSL::Digest::SHA224.new
21
+ when ('sha256')
22
+ decrypt.crypt = OpenSSL::Digest::SHA256.new
23
+ when ('sha384')
24
+ decrypt.crypt = OpenSSL::Digest::SHA384.new
25
+ when ('sha512')
26
+ decrypt.crypt = OpenSSL::Digest::SHA512.new
27
+ when ('ripemd160')
28
+ decrypt.crypt = OpenSSL::Digest::RIPEMD160.new
30
29
  end
31
30
  File.foreach(decrypt.wordlist) {|line|
32
31
  line.chomp!
33
- dbs[:hashes] << {original:line, hash:decrypt.hash.hexdigest(line)}
32
+ dbs[:hashes] << {original:line, hash:decrypt.crypt.hexdigest(line)}
34
33
  }
35
34
  decrypt.pass = dbs[:hashes].filter(hash:dato).map(:original)
36
35
  unless (decrypt.pass.empty?)
37
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Found: #{decrypt.pass.join(',')}"
36
+ puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Type Hash: #{decrypt.mode}"
37
+ puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash Found: #{decrypt.pass.join(',')}\e[0m"
38
38
  else
39
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Hash Not Found in Database..."
39
+ puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Hash Not Found in Database...\e[0m"
40
40
  end
41
41
  end
42
42
  end
File without changes
@@ -7,29 +7,31 @@ class Encrypt
7
7
  encrypt = OpenStruct.new
8
8
  encrypt.mode = mode.downcase
9
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)
10
+ case encrypt.mode
11
+ when ('md4')
12
+ encrypt.crypt = OpenSSL::Digest::MD4.hexdigest(dato)
13
+ when ('md5')
14
+ encrypt.crypt = OpenSSL::Digest::MD5.hexdigest(dato)
15
+ when ('sha1')
16
+ encrypt.crypt = OpenSSL::Digest::SHA1.hexdigest(dato)
17
+ when ('sha224')
18
+ encrypt.crypt = OpenSSL::Digest::SHA224.hexdigest(dato)
19
+ when ('sha256')
20
+ encrypt.crypt = OpenSSL::Digest::SHA256.hexdigest(dato)
21
+ when ('sha384')
22
+ encrypt.crypt = OpenSSL::Digest::SHA384.hexdigest(dato)
23
+ when ('sha512')
24
+ encrypt.crypt = OpenSSL::Digest::SHA512.hexdigest(dato)
25
+ when ('ripemd160')
26
+ encrypt.crypt = OpenSSL::Digest::RIPEMD160.hexdigest(dato)
27
+ else "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Type Hash Not Found"
26
28
  end
27
29
  unless (encrypt.crypt.nil?)
28
- puts "\n\e[1;32m[\e[0m+\e[1;32m]\e[0m Encrypted Text: #{encrypt.crypt}"
30
+ puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Encrypted Text: #{encrypt.crypt}"
29
31
  $datBas::database(encrypt.crypt)
30
- DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md4.db'))
32
+ DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{encrypt.mode}.db"))
31
33
  else
32
- puts "\n\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Encrypt Text..."
34
+ puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Not Encrypt Text..."
33
35
  end
34
36
  end
35
37
  end
data/lib/cobreak/force.rb CHANGED
@@ -1,73 +1,152 @@
1
1
  require 'cobreak/function_hash'
2
2
  class Forze_brute
3
+ attr_accessor :hash_input, :type_hash, :crypt, :min_chr, :max_chr, :charact, :word, :wordlist, :result, :out, :verbose, :crack
3
4
  def initialize(author = 'BreakerBox')
4
5
  @author = author
6
+ @result = nil
7
+ @crack = nil
8
+ @crypt = nil
9
+ @dict = nil
10
+ @word = nil
5
11
  end
6
12
  def verify(dato, word = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'hash', 'hash.db'))
7
13
  hash_db = Sequel.sqlite
8
14
  hash_db.create_table? :datahash do
9
15
  String :ori
10
- String :has
16
+ String :hash
11
17
  end
12
- IO.foreach(word) {|lin|
13
- lin = lin.chomp
14
- hash_db[:datahash] << {ori:lin, has:dato}
15
- }
16
- ha = hash_db[:datahash].filter(ori:dato).map(:has)
18
+ begin
19
+ IO.foreach(word) {|lin|
20
+ lin = lin.chomp
21
+ hash_db[:datahash] << {ori:lin, hash:dato}
22
+ }
23
+ rescue Errno::ENOENT
24
+ return
25
+ end
26
+ ha = hash_db[:datahash].filter(ori:dato).map(:hash)
17
27
  arr = Array.new
18
28
  arr << dato
19
29
  if (ha == arr)
20
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash already existing in the database: #{dato}"
21
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m show the hash using --show, see the help parameter for more information"
30
+ puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash already existing in the database: #{dato}"
31
+ puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m show the hash using --show, see the help parameter for more information\e[0m"
22
32
  exit
23
33
  end
24
34
  end
25
- def word(dato, wordlist, type)
26
- verify(dato)
35
+ def word(dato, wordlist, type, out, verbose = false)
27
36
  forzebrute = OpenStruct.new
28
- forzebrute.hash = dato
29
- forzebrute.type = type
30
- forzebrute.wordlist = wordlist
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
37
+ @hash_input = dato
38
+ @type_hash = type
39
+ @out = out
40
+ @verbose = verbose
41
+ @wordlist = wordlist
42
+ File.foreach(File.join(Gem.path[1], "gems","cobreak-#{CoBreak.version}" , "lib", "cobreak", "config", "database.db"), mode: 'r'){|booleano|
43
+ forzebrute.booleano = booleano
44
+ if (booleano.eql?('true'))
45
+ verify(dato)
46
+ end
47
+ }
48
+ if (type_hash.downcase.eql?('md4'))
49
+ @crypt = OpenSSL::Digest::MD4.new
50
+ elsif (type_hash.downcase.eql?('md5'))
51
+ @crypt = OpenSSL::Digest::MD5.new
52
+ elsif (type_hash.downcase.eql?('sha1'))
53
+ @crypt = OpenSSL::Digest::SHA1.new
54
+ elsif (type_hash.downcase.eql?('sha224'))
55
+ @crypt = OpenSSL::Digest::SHA224.new
56
+ elsif (type_hash.downcase.eql?('sha256'))
57
+ @crypt = OpenSSL::Digest::SHA256.new
58
+ elsif (type_hash.downcase.eql?('sha384'))
59
+ @crypt = OpenSSL::Digest::SHA384.new
60
+ elsif (type_hash.downcase.eql?('sha512'))
61
+ @crypt = OpenSSL::Digest::SHA512.new
62
+ elsif (type_hash.downcase.eql?('ripemd160'))
63
+ @crypt = OpenSSL::Digest::RIPEMD160.new
47
64
  end
65
+ lin = 0
48
66
  forzebrute.time = Time.now
49
- File.foreach(forzebrute.wordlist) {|line|
50
- line.chomp!
51
- if (forzebrute.crypt.hexdigest(line).eql?(forzebrute.hash))
52
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: " + line
53
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzebrute.time} seconds"
54
- $datBas::database(forzebrute.crypt.hexdigest(line))
55
- DB::database(line, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{forzebrute.type}.db"))
56
- exit
57
- end
58
- }
59
- if true
60
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Not Decrypted Text: #{dato}"
61
- puts "\e[1;31m[\e[0m+\e[1;31m]\e[0m Time: #{Time.now - forzebrute.time} seconds"
62
- end
67
+ begin
68
+ if (verbose)
69
+ thread = Thread.new do
70
+ dict = File.open(wordlist, mode: 'r')
71
+ while word = dict.gets
72
+ lin += 1
73
+ $word = word
74
+ if (crypt.hexdigest(word.chomp).eql?(hash_input))
75
+ @result = word
76
+ verbose = false
77
+ thread.kill
78
+ end
79
+ end
80
+ verbose = 'no'
81
+ end
82
+ else
83
+ dict = File.open(wordlist, mode: 'r')
84
+ while word = dict.gets
85
+ lin += 1
86
+ begin
87
+ if (crypt.hexdigest(word.chomp).eql?(hash_input.chomp))
88
+ @result = word
89
+ verbose = false
90
+ break
91
+ end
92
+ rescue
93
+ end
94
+ end
95
+ end
96
+ while (verbose == true)
97
+ STDOUT.flush
98
+ begin
99
+ print "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{$word.chomp}" + " " *30
100
+ rescue
101
+ end
102
+ sleep(0.1)
103
+ end
104
+ if (verbose == false)
105
+ puts "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{result}"
106
+ puts "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Number of lines: #{lin}"
107
+ puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash Cracking in #{Time.now - forzebrute.time} seconds"
108
+ else
109
+ puts "\r\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Not Cracking Text: #{hash_input}"
110
+ puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Time: #{Time.now - forzebrute.time} seconds\e[0m"
111
+ end
112
+ if (forzebrute.booleano.eql?('true'))
113
+ $datBas::database(crypt.hexdigest(wordlist.chomp))
114
+ DB::database(result, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{type_hash}.db"))
115
+ end
116
+ if !(result.nil?)
117
+ if !(out.nil?)
118
+ File.open(out, mode: 'a'){|out|
119
+ out.puts "=================================================="
120
+ out.puts "software: CoBreak #{CoBreak.version}"
121
+ out.puts "Type Hash: #{type_hash}\n"
122
+ out.puts "#{result.chomp}:#{crypt.hexdigest(result)}"
123
+ out.puts "=================================================="
124
+ }
125
+ end
126
+ end
127
+ rescue Interrupt
128
+ puts "\n\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Interrupt mode"
129
+ puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Password Not Cracked"
130
+ puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Number of Lines: #{lin}"
131
+ puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Wait Time: #{Time.now - forzebrute.time} seconds\e[0m"
132
+ exit
133
+ end
63
134
  end
64
- def chars(dato, range, char, type)
65
- verify(dato)
135
+ def chars(dato, range, char, type, out, verbose = false)
136
+ bool = File.open(File.join(Gem.path[1], "gems","cobreak-#{CoBreak.version}" , "lib", "cobreak", "config", "database.db"))
137
+ bool = bool.readlines[0].to_s.chomp
138
+ if (bool.eql?('true'))
139
+ verify(dato)
140
+ end
66
141
  forzechars = OpenStruct.new
67
142
  forzechars.dato = dato
68
143
  forzechars.range = range
69
144
  forzechars.char = char.chars
70
145
  forzechars.type = type
146
+ forzechars.out = out
147
+ forzechars.verbose = verbose
148
+ forzechars.cont = Array.new
149
+ forzechars.result = nil
71
150
  if (forzechars.type.downcase.eql?('md4'))
72
151
  forzechars.crypt = OpenSSL::Digest::MD4.new
73
152
  elsif (forzechars.type.downcase.eql?('md5'))
@@ -85,23 +164,49 @@ class Forze_brute
85
164
  elsif (forzechars.type.downcase.eql?('ripemd160'))
86
165
  forzechars.crypt = OpenSSL::Digest::RIPEMD160.new
87
166
  end
88
- forzechars.time = Time.now
89
- for range in (forzechars.range[0].to_i..forzechars.range[1].to_i).to_a
90
- for chars in forzechars.char.repeated_permutation(range).map(&:join)
91
- if (forzechars.crypt.hexdigest(chars.chomp)) == (forzechars.dato)
92
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: #{chars}"
93
- puts "\e[1;32m[\e[0m+\e[1;32m]\e[0m Hash Cracking #{Time.now - forzechars.time} seconds"
94
- $datBas::database(forzechars.crypt.hexdigest(chars))
95
- DB::database(chars, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{forzechars.type}.db"))
96
- exit
167
+ lin = 0
168
+ begin
169
+ forzechars.time = Time.now
170
+ for range in (forzechars.range[0].to_i..forzechars.range[1].to_i).to_a
171
+ for chars in forzechars.char.repeated_permutation(range).map(&:join)
172
+ lin += 1
173
+ if (forzechars.verbose.eql?(true))
174
+ print "\r\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{chars}"
175
+ end
176
+ if (forzechars.crypt.hexdigest(chars).eql?(forzechars.dato))
177
+ forzechars.result = chars
178
+ puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Password Crack: #{chars}"
179
+ puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Number of Lines: #{lin}"
180
+ puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash Cracking in #{Time.now - forzechars.time} seconds"
181
+ if bool.eql?('true')
182
+ $datBas::database(forzechars.crypt.hexdigest(chars))
183
+ DB::database(chars, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{forzechars.type}.db"))
184
+ end
185
+ if !(forzechars.out.nil?)
186
+ File.open(forzechars.out, mode: 'a'){|out|
187
+ out.puts "=================================================="
188
+ out.puts "software: CoBreak #{CoBreak.version}"
189
+ out.puts "Type Hash: #{forzechars.type}\n"
190
+ out.puts "#{chars}:#{forzechars.crypt.hexdigest(chars)}"
191
+ out.puts "=================================================="
192
+ }
193
+ end
194
+ break
195
+ end
97
196
  end
98
197
  end
198
+ rescue Interrupt
199
+ puts "\n\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Interrupt mode"
200
+ puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Password Not Cracked"
201
+ puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Number of Lines: #{lin}"
202
+ puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Wait Time: #{Time.now - forzechars.time} seconds\e[0m"
203
+ exit
99
204
  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}"
205
+ if (forzechars.result.nil?)
206
+ puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Not Cracking Text: #{forzechars.dato}"
207
+ puts "\e[1;31m[\e[1;37m+\e[1;31m]\e[1;37m Time: #{Time.now - forzechars.time}\e[0m"
208
+ exit
103
209
  end
104
210
  end
105
211
  end
106
- ForzeBrute = Forze_brute.new
107
-
212
+ ForzeBrute = Forze_brute.new