cobreaktws 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,41 @@
1
+ module CoBreak
2
+ class List
3
+ #all list formats and types
4
+ def initialize(options)
5
+ all = Array.new
6
+ all << "Base64" << "Base32" << "Base16" << "Ascii85" << "Binary" << "Cesar"
7
+ if (options.list.eql?("cipher"))
8
+ list_cipher = all.map do |type|
9
+ {category: 'Cipher', name: type}
10
+ end
11
+ puts "\n"
12
+ puts " " * 2 + "#{'ID' + ' ' * 3} | #{' ' + 'Name' + ' ' * 27} | #{'Category' + ' ' * 6}"
13
+ puts "=" * 8 + "+" + "=" * 34 + "+" + "=" * 20
14
+ salt = " "
15
+ list_cipher.each_with_index do |cipher, index|
16
+ puts " " * 2 + "#{index + 1}" + " " * 4 + salt + "|" + " " * 2 + "#{cipher[:name].ljust(31)} | #{cipher[:category].ljust(8)}"
17
+ if(index==8)
18
+ salt = ""
19
+ end
20
+ end
21
+ end
22
+ all.clear
23
+ all << "MD4" << "MD5" << "HALF-MD5" << "SHA1" << "DOUBLE-SHA1" << "SHA2-224" << "SHA2-256" << "SHA2-384" << "SHA2-512" << "SHA3-224" << "SHA3-256" << "SHA3-384" << "SHA3-512" << "RIPEMD-160" << "TIGER-160" << "BLAKE2S-128" << "BLAKE2S-160" << "BlAKE2B-160" << "BLAKE2S-224" << "BLAKE2S-256" << "BLAKE2B-256" << "BLAKE2B_384" << "BLAKE2B-512" << "WHIRLPOOL" << "GOST_STREEBOG_256" << "GOST_STREEBOG_256" << "SHAKE-128"
24
+ if (options.list.eql?("digest"))
25
+ list_algorithms = all.map do |type|
26
+ {category: 'Raw-Hash', name: type}
27
+ end
28
+ puts "\n"
29
+ puts " " * 2 + "#{'ID' + ' ' * 3} | #{' ' + 'Name' + ' ' * 27} | #{'Category' + ' ' * 6}"
30
+ puts "=" * 8 + "+" + "=" * 34 + "+" + "=" * 20
31
+ salt = " "
32
+ list_algorithms.each_with_index do |hash, index|
33
+ puts " " * 2 + "#{index + 1}" + " " * 4 + salt + "|" + " " * 2 + "#{hash[:name].ljust(31)} | #{hash[:category].ljust(8)}"
34
+ if(index==8)
35
+ salt = ""
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,148 @@
1
+ require 'cobreak/cobreak_opt'
2
+ require 'cobreak/force_brute'
3
+ require 'cobreak/force_chars'
4
+ require 'cobreak/version'
5
+ require 'cobreak/list_all'
6
+ require 'sequel'
7
+ require 'openssl'
8
+ module CoBreak
9
+ class ParseOPT
10
+ def self.optparse(options)
11
+ begin
12
+ OptionParser.new do|param|
13
+ param.banner = "Usage: cobreak [--mode] [--options] [--input text or file]"
14
+ param.separator ''
15
+ param.separator "Mode Cipher:"
16
+ param.on('--encoding=[CIPHER]', String, 'encoding input text or file'){|en_co| options.enc = en_co}
17
+ param.on('--decoding=[CIPHER]', String, 'decoding input text or file'){|de_co| options.dec = de_co}
18
+ param.separator "Mode Cryptography"
19
+ param.on('--encrypt=[FORMAT]', String, 'encrypt parameter'){|en_en| options.encrypt = en_en}
20
+ param.separator "Mode BruteForce"
21
+ param.on('-b', '--bruteforce=DIGEST', String, 'brute force mode to crack a hash'){|modeforce|options.bruteforce = modeforce}
22
+ param.separator ""
23
+ param.separator "Options:"
24
+ param.on('-l', '--list=encoding or encrypt', String, 'list cipher types of hash formats'){|lin| options.list = lin}
25
+ param.on('-r', '--range MIN MAX', Array, "word chars length"){|rang| options.range = rang}
26
+ param.on('-c', '--chars CHARACTERS', String, 'character input to generate word lists'){|chars| options.chars = chars}
27
+ param.on('-w', '--wordlist=WORDLIST', 'Wordlist mode, read words from FILE or stadin (default: rockyou)'){|wordlist| options.wordlist = wordlist}
28
+ param.on('--show=[FORMAT]', String, 'show decrypted specific hash'){|de_en| options.decrypt = de_en}
29
+ param.on('-i', '--input FILE or TEXT', String, 'take file or text to carry out the process'){|alg| options.algo = alg}
30
+ param.on('-o', '--output FILe', String, 'output the software'){|out| options.out = out}
31
+ param.on('-v', '--verbose', 'verbose mode'){options.verbose = true}
32
+ param.on('--usage', 'show examples of use of this tool')do
33
+ puts "usage: cobreak [--mode] [--options] [--input] text or file"
34
+ puts ""
35
+ puts "cipher:"
36
+ puts ""
37
+ puts "cobreak --encoding=[CIPHER] --input text or file"
38
+ puts "cobreak --decoding=[CIPHER] --input text or file"
39
+ puts ""
40
+ puts "note that the cesar cipher mode has to have a number in front to know the rotations"
41
+ puts "examples: --encoding=cesar 5 --input hola"
42
+ puts ""
43
+ puts "bruteforce:"
44
+ puts ""
45
+ puts "cobreak --bruteforce=[ENCRYPT] --wordlist=[WORDLIST] --input text or file"
46
+ puts "cobreak --bruteforce=[ENCRYPT] --chars [CHARACTERS] --range MIN MAX --input text or file"
47
+ puts ""
48
+ end
49
+ param.on_tail('-V', '--version', 'show version'){puts "CoBreak version #{CoBreak.version}"; exit}
50
+ param.on_tail('-h', '--help', 'command to view help parameters'){puts param; exit}
51
+ param.separator ''
52
+ end.parse!
53
+ rescue OptionParser::MissingArgument => missing
54
+ if missing.to_s.include?("--wordlist")
55
+ options.wordlist = File.join(Gem.path[1], 'gems', "cobreak-#{CoBreak.version}", 'diccionario.txt')
56
+ elsif missing.to_s.include?("--chars")
57
+ options.chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
58
+ else
59
+ puts missing.message
60
+ end
61
+ ensure
62
+ if (options.wordlist == "rockyou")
63
+ unless (File.exists?(options.wordlist))
64
+ #options.wordlist = File.join(Gem.path[1], 'gems', "cobreak-#{CoBreak.version}", 'diccionario.txt')
65
+ options.wordlist = File.join('/usr', 'share', 'wordlists', 'rockyou.txt')
66
+ end
67
+ end
68
+ end
69
+ CoBreak::Box.var(options)
70
+ case options.bruteforce
71
+ when ('1')
72
+ options.bruteforce = 'md4'
73
+ when ('2')
74
+ options.bruteforce = 'md5'
75
+ when ('3')
76
+ options.bruteforce = 'half-md5'
77
+ when ('4')
78
+ options.bruteforce = 'sha1'
79
+ when ('5')
80
+ options.bruteforce = 'double-sha1'
81
+ when ('6')
82
+ options.bruteforce = 'sha2-224'
83
+ when ('7')
84
+ options.bruteforce = 'sha2-256'
85
+ when ('8')
86
+ options.bruteforce = 'sha2-384'
87
+ when ('9')
88
+ options.bruteforce = 'sha2-512'
89
+ when ('10')
90
+ options.bruteforce = 'sha3-224'
91
+ when ('11')
92
+ options.bruteforce = 'sha3-256'
93
+ when ('12')
94
+ options.bruteforce = 'sha3-384'
95
+ when ('13')
96
+ options.bruteforce = 'sha3-512'
97
+ when ('14')
98
+ options.bruteforce = 'ripemd-160'
99
+ when ('15')
100
+ options.bruteforce = 'tiger-160'
101
+ when ('16')
102
+ options.bruteforce = 'blake2s-128'
103
+ when ('17')
104
+ options.bruteforce = 'blake2s-160'
105
+ when ('18')
106
+ options.bruteforce = 'blake2b-160'
107
+ when ('19')
108
+ options.bruteforce = 'blake2s-224'
109
+ when ('20')
110
+ options.bruteforce = 'blake2s-256'
111
+ when ('21')
112
+ options.bruteforce = 'blake2b-256'
113
+ when ('22')
114
+ options.bruteforce = 'blake2b-384'
115
+ when ('23')
116
+ options.bruteforce = 'blake2b-512'
117
+ when ('24')
118
+ options.bruteforce = 'whirlpool'
119
+ when ('25')
120
+ options.bruteforce = 'gost-streeboog-256'
121
+ when ('26')
122
+ options.bruteforce = 'gost-streeboog-512'
123
+ when ('27')
124
+ options.bruteforce = 'shake-128'
125
+ else
126
+ puts ""
127
+ end
128
+ if !(options.enc.nil?) or !(options.dec.nil?)
129
+ CoBreak::Box::Cipher.coding()
130
+ end
131
+ if !(options.encrypt.nil?) or !(options.decrypt.nil?)
132
+ CoBreak::Box::Cryptgraphy.crypt()
133
+ end
134
+ CoBreak::List.new(options)
135
+ unless (options.wordlist.nil?) or (options.wordlist.empty?)
136
+ bruteforce = CoBreak::BruteForze.new(options)
137
+ bruteforce.banner_wordlist()
138
+ bruteforce.wordlist
139
+ end
140
+ unless (options.chars.nil?) or (options.chars.empty?)
141
+ options.range << ARGV[0].to_i
142
+ brutechars = CoBreak::BruteChars.new(options)
143
+ brutechars.banner_chars()
144
+ brutechars.chars()
145
+ end
146
+ end
147
+ end
148
+ end
@@ -0,0 +1,9 @@
1
+ require 'optparse'
2
+ module CoBreakOPT
3
+ class Runner
4
+ def self.runner(options)
5
+ require 'cobreak/optionpr'
6
+ CoBreak::ParseOPT.optparse(options)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ module CoBreak
2
+ def self.version()
3
+ return '1.0.4'
4
+ end
5
+ end
data/lib/cobreak.rb ADDED
@@ -0,0 +1,4 @@
1
+ require 'cobreak/version'
2
+ require 'fileutils'
3
+ require 'cobreak/info_author'
4
+ require 'cobreak/details'
metadata ADDED
@@ -0,0 +1,185 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cobreaktws
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.4
5
+ platform: ruby
6
+ authors:
7
+ - BreakerTW
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-10-25 00:00:00.000000000 Z
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'
27
+ - !ruby/object:Gem::Dependency
28
+ name: openssl
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 2.2.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.2.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: sequel
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 5.44.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 5.44.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: sqlite3
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.4'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 1.4.0
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '1.4'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 1.4.0
75
+ - !ruby/object:Gem::Dependency
76
+ name: sqlite3
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.4'
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 1.4.0
85
+ type: :runtime
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '1.4'
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 1.4.0
95
+ - !ruby/object:Gem::Dependency
96
+ name: Ascii85
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '1.0'
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: 1.0.0
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '1.0'
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: 1.0.0
115
+ description: The CoBreak script is an cipher and cryptography tool
116
+ email: breaker@gmail.com
117
+ executables:
118
+ - cobreak
119
+ - cbrdb
120
+ extensions:
121
+ - ext/cobreak/extconf.rb
122
+ extra_rdoc_files: []
123
+ files:
124
+ - ".vscode/settings.json"
125
+ - Gemfile
126
+ - README.md
127
+ - bin/cbrdb
128
+ - bin/cobreak
129
+ - cobreak.gemspec
130
+ - ext/cobreak/cobreak.c
131
+ - ext/cobreak/cobreak_cipher.c
132
+ - ext/cobreak/cobreak_cipher.h
133
+ - ext/cobreak/cobreak_gcrypt.c
134
+ - ext/cobreak/cobreak_gcrypt.h
135
+ - ext/cobreak/cobreak_openmp.c
136
+ - ext/cobreak/cobreak_openmp.h
137
+ - ext/cobreak/cobreak_openssl.c
138
+ - ext/cobreak/cobreak_openssl.h
139
+ - ext/cobreak/cobreak_ruby.h
140
+ - ext/cobreak/extconf.rb
141
+ - lib/cobreak.rb
142
+ - lib/cobreak/binary.rb
143
+ - lib/cobreak/cesar.rb
144
+ - lib/cobreak/cifrado.rb
145
+ - lib/cobreak/cobreak_opt.rb
146
+ - lib/cobreak/config/database.db
147
+ - lib/cobreak/decifrado.rb
148
+ - lib/cobreak/decrypt.rb
149
+ - lib/cobreak/details.rb
150
+ - lib/cobreak/encrypt.rb
151
+ - lib/cobreak/force.rb
152
+ - lib/cobreak/force_brute.rb
153
+ - lib/cobreak/force_chars.rb
154
+ - lib/cobreak/function_db.rb
155
+ - lib/cobreak/function_hash.rb
156
+ - lib/cobreak/hash/hash.db
157
+ - lib/cobreak/info_author.rb
158
+ - lib/cobreak/list_all.rb
159
+ - lib/cobreak/optionpr.rb
160
+ - lib/cobreak/run.rb
161
+ - lib/cobreak/version.rb
162
+ homepage: https://github.com/BreakingTWS/CoBreak
163
+ licenses:
164
+ - MIT
165
+ metadata: {}
166
+ post_install_message: thanks for installing my gem
167
+ rdoc_options: []
168
+ require_paths:
169
+ - lib
170
+ required_ruby_version: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ required_rubygems_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ requirements: []
181
+ rubygems_version: 3.3.15
182
+ signing_key:
183
+ specification_version: 4
184
+ summary: Force Brute, Cipher, Cryptography
185
+ test_files: []