lib/cobreak/optionpr.rb in cobreak-1.0.1 vs lib/cobreak/optionpr.rb in cobreak-1.0.2

- old
+ new

@@ -1,33 +1,36 @@ -require 'optparse' require 'cobreak/cobreak' require 'cobreak/force_brute' require 'cobreak/force_chars' require 'cobreak/version' require 'cobreak/list_all' +require 'sequel' +require 'openssl' module CoBreak class ParseOPT def self.optparse(options) begin OptionParser.new do|param| - param.banner = "Usage: CoBreak.rb [--mode] [--options] [text or file]" + param.banner = "Usage: cobreak [--mode] [--options] [--input text or file]" param.separator '' param.separator "Mode Cipher:" param.on('--encoding=[TYPE]', String, 'encoding input text or file'){|en_co| options.enc = en_co} param.on('--decoding=[TYPE]', String, 'decoding input text or file'){|de_co| options.dec = de_co} param.separator "Mode Cryptography" param.on('--encrypt=[FORMAT]', String, 'encrypt parameter'){|en_en| options.encrypt = en_en} param.separator "Mode BruteForce" - param.on('--bruteforce=[FORMAT]', String, 'brute force mode to crack a hash'){|modeforce| options.bruteforce = modeforce} + param.on('--bruteforce=[FORMAT]', String, 'brute force mode to crack a hash'){|modeforce|options.bruteforce = modeforce} param.separator "" param.separator "Options:" param.on('-l', '--list=TYPE or FORMAT', String, 'list cipher types of hash formats'){|lin| options.list = lin} param.on('-r', '--range MIN MAX', Array, "word chars length"){|rang| options.range = rang} param.on('-c', '--chars CHARACTERS', String, 'character input to generate word lists'){|chars| options.chars = chars} param.on('-w', '--wordlist=WORDLIST', 'Wordlist mode, read words from FILE or stadin (default: diccionario.txt)'){|wordlist| options.wordlist = wordlist} param.on('--show=[FORMAT]', String, 'show decrypted specific hash'){|de_en| options.decrypt = de_en} param.on('-i', '--input FILE or TEXT', String, 'take file or text to carry out the process'){|alg| options.algo = alg} + param.on('-o', '--output FILe', String, 'output the software'){|out| options.out = out} + param.on('-v', '--verbose', 'verbose mode'){options.verbose = true} param.on('--usage', 'show examples of use of this tool')do puts "usage: cobreak [--mode] [--options] [--input] text or file" puts "" puts "cipher:" puts "" @@ -41,10 +44,10 @@ puts "" puts "cobreak --bruteforce=[FORMAT] --wordlist=[WORDLIST] --input text or file" puts "cobreak --bruteforce=[FORMAT] --chars [CHARACTERS] --range MIN MAX --input text or file" puts "" end - param.on_tail('-v', '--version', 'show version'){puts "CoBreak version #{CoBreak.version}"; exit} + param.on_tail('-V', '--version', 'show version'){puts "CoBreak version #{CoBreak.version}"; exit} param.on_tail('-h', '--help', 'command to view help parameters'){puts param; exit} param.separator '' end.parse! rescue OptionParser::MissingArgument => missing if missing.to_s.include?("--wordlist")