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.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/README.md +0 -0
- data/bin/cbrdb +83 -0
- data/cobreak.gemspec +12 -4
- data/diccionario.txt +0 -0
- data/hash.txt +1 -0
- data/hola.txt +1398101 -0
- data/lib/cobreak.rb +0 -0
- data/lib/cobreak/binary.rb +0 -0
- data/lib/cobreak/cesar.rb +3 -3
- data/lib/cobreak/cifrado.rb +3 -3
- data/lib/cobreak/cobreak.rb +7 -7
- data/lib/cobreak/config/database.db +0 -0
- data/lib/cobreak/decifrado.rb +5 -3
- data/lib/cobreak/decrypt.rb +21 -21
- data/lib/cobreak/details.rb +0 -0
- data/lib/cobreak/encrypt.rb +21 -19
- data/lib/cobreak/force.rb +164 -59
- data/lib/cobreak/force_brute.rb +15 -10
- data/lib/cobreak/force_chars.rb +18 -29
- data/lib/cobreak/function_db.rb +0 -1
- data/lib/cobreak/function_hash.rb +0 -2
- data/lib/cobreak/hash/hash.db +1 -0
- data/lib/cobreak/info_author.rb +0 -0
- data/lib/cobreak/list_all.rb +6 -6
- data/lib/cobreak/optionpr.rb +7 -4
- data/lib/cobreak/run.rb +0 -0
- data/lib/cobreak/show/md4.db +1 -0
- data/lib/cobreak/show/md5.db +1 -0
- data/lib/cobreak/show/ripemd160.db +1 -0
- data/lib/cobreak/show/sha1.db +1 -0
- data/lib/cobreak/show/sha224.db +1 -0
- data/lib/cobreak/show/sha256.db +1 -0
- data/lib/cobreak/show/sha384.db +1 -0
- data/lib/cobreak/show/sha512.db +1 -0
- data/lib/cobreak/version.rb +1 -1
- data/outputs.txt +17 -0
- data/prueba.txt +4 -0
- metadata +147 -7
- data/LICENSE +0 -700
    
        data/lib/cobreak.rb
    CHANGED
    
    | 
            File without changes
         | 
    
        data/lib/cobreak/binary.rb
    CHANGED
    
    | 
            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 =  | 
| 6 | 
            -
                alfa_minus =  | 
| 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
         | 
    
        data/lib/cobreak/cifrado.rb
    CHANGED
    
    | @@ -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[ | 
| 28 | 
            -
                    puts "\e[1;32m[\e[ | 
| 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[ | 
| 30 | 
            +
                    puts "\e[1;31m[\e[37m+\e[1;31m]\e[37m Not Cipher Text..."
         | 
| 31 31 | 
             
                  end
         | 
| 32 32 | 
             
                end
         | 
| 33 33 | 
             
              end
         | 
    
        data/lib/cobreak/cobreak.rb
    CHANGED
    
    | @@ -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. | 
| 55 | 
            -
                    if (show. | 
| 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. | 
| 60 | 
            -
                          DeCrypt::show(@options.decrypt, line) if (show. | 
| 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. | 
| 63 | 
            +
                        if (show.crypt.include?(@options.encrypt.upcase))
         | 
| 64 64 | 
             
                          EnCrypt::show(@options.encrypt, @options.algo)
         | 
| 65 65 | 
             
                        end
         | 
| 66 | 
            -
                        if (show. | 
| 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[ | 
| 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
         | 
    
        data/lib/cobreak/decifrado.rb
    CHANGED
    
    | @@ -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[ | 
| 28 | 
            -
                     | 
| 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[ | 
| 32 | 
            +
                    puts "\e[1;31m[\e[37m+\e[1;31m]\e[37m Not Cipher Text..."
         | 
| 31 33 | 
             
                  end
         | 
| 32 34 | 
             
                end
         | 
| 33 35 | 
             
              end
         | 
    
        data/lib/cobreak/decrypt.rb
    CHANGED
    
    | @@ -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 | 
            -
                   | 
| 15 | 
            -
                     | 
| 16 | 
            -
             | 
| 17 | 
            -
                     | 
| 18 | 
            -
             | 
| 19 | 
            -
                     | 
| 20 | 
            -
             | 
| 21 | 
            -
                     | 
| 22 | 
            -
             | 
| 23 | 
            -
                     | 
| 24 | 
            -
             | 
| 25 | 
            -
                     | 
| 26 | 
            -
             | 
| 27 | 
            -
                     | 
| 28 | 
            -
             | 
| 29 | 
            -
                     | 
| 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. | 
| 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[ | 
| 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[ | 
| 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
         | 
    
        data/lib/cobreak/details.rb
    CHANGED
    
    | 
            File without changes
         | 
    
        data/lib/cobreak/encrypt.rb
    CHANGED
    
    | @@ -7,29 +7,31 @@ class Encrypt | |
| 7 7 | 
             
                encrypt = OpenStruct.new
         | 
| 8 8 | 
             
                encrypt.mode = mode.downcase
         | 
| 9 9 | 
             
                encrypt.dato = dato
         | 
| 10 | 
            -
                 | 
| 11 | 
            -
                   | 
| 12 | 
            -
             | 
| 13 | 
            -
                   | 
| 14 | 
            -
             | 
| 15 | 
            -
                   | 
| 16 | 
            -
             | 
| 17 | 
            -
                   | 
| 18 | 
            -
             | 
| 19 | 
            -
                   | 
| 20 | 
            -
             | 
| 21 | 
            -
                   | 
| 22 | 
            -
             | 
| 23 | 
            -
                   | 
| 24 | 
            -
             | 
| 25 | 
            -
                   | 
| 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 "\ | 
| 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',  | 
| 32 | 
            +
                  DB::database(dato, File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', "#{encrypt.mode}.db"))
         | 
| 31 33 | 
             
                else
         | 
| 32 | 
            -
                  puts "\ | 
| 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 : | 
| 16 | 
            +
                  String :hash
         | 
| 11 17 | 
             
                end
         | 
| 12 | 
            -
                 | 
| 13 | 
            -
                   | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 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[ | 
| 21 | 
            -
                  puts "\e[1;32m[\e[ | 
| 30 | 
            +
                  puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m Hash already existing in the database: #{dato}"
         | 
| 31 | 
            +
                  puts "\e[1;32m[\e[1;37m+\e[1;32m]\e[1;37m show the hash using --show, see the help parameter for more information\e[0m"
         | 
| 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 | 
            -
                 | 
| 29 | 
            -
                 | 
| 30 | 
            -
                 | 
| 31 | 
            -
             | 
| 32 | 
            -
             | 
| 33 | 
            -
             | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 36 | 
            -
             | 
| 37 | 
            -
             | 
| 38 | 
            -
             | 
| 39 | 
            -
                   | 
| 40 | 
            -
                     | 
| 41 | 
            -
                  elsif ( | 
| 42 | 
            -
                     | 
| 43 | 
            -
                  elsif ( | 
| 44 | 
            -
                     | 
| 45 | 
            -
                  elsif ( | 
| 46 | 
            -
                     | 
| 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 | 
            -
             | 
| 50 | 
            -
             | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
             | 
| 54 | 
            -
             | 
| 55 | 
            -
             | 
| 56 | 
            -
             | 
| 57 | 
            -
             | 
| 58 | 
            -
             | 
| 59 | 
            -
             | 
| 60 | 
            -
             | 
| 61 | 
            -
             | 
| 62 | 
            -
             | 
| 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 | 
            -
                 | 
| 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 | 
            -
                 | 
| 89 | 
            -
                 | 
| 90 | 
            -
                   | 
| 91 | 
            -
             | 
| 92 | 
            -
             | 
| 93 | 
            -
                       | 
| 94 | 
            -
                       | 
| 95 | 
            -
             | 
| 96 | 
            -
                       | 
| 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  | 
| 101 | 
            -
                  puts "\e[1;31m[\e[ | 
| 102 | 
            -
                  puts "\e[1;31m[\e[ | 
| 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
         |