ruby_hashcat 0.1.2 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -2
- data/README.md +3 -3
- data/lib/ruby_hashcat.rb +20 -0
- data/lib/ruby_hashcat/api.rb +22 -0
- data/lib/ruby_hashcat/objects/hash.rb +419 -0
- data/lib/ruby_hashcat/objects/init.rb +2 -0
- data/lib/ruby_hashcat/parse.rb +245 -0
- data/lib/ruby_hashcat/program.rb +12 -3
- data/lib/ruby_hashcat/routes/clean.rb +23 -0
- data/lib/ruby_hashcat/routes/crack.rb +85 -0
- data/lib/ruby_hashcat/routes/init.rb +7 -0
- data/lib/ruby_hashcat/routes/results.rb +25 -0
- data/lib/ruby_hashcat/routes/settings.rb +26 -0
- data/lib/ruby_hashcat/routes/status.rb +44 -0
- data/lib/ruby_hashcat/task.rb +12 -3
- data/lib/ruby_hashcat/tee.rb +11 -0
- data/lib/ruby_hashcat/tmp/.touch +0 -0
- data/lib/ruby_hashcat/tools.rb +42 -0
- data/lib/ruby_hashcat/validation.rb +4 -0
- data/lib/ruby_hashcat/version.rb +1 -1
- data/ruby_hashcat.gemspec +11 -6
- data/test/hashes/md5.txt +6494 -0
- data/test/hashes/md5crypt.txt +2 -0
- data/test/hashes/phpass.txt +1 -0
- data/test/rules/InsidePro-PasswordsPro.rule +3275 -0
- data/test/rules/best64.rule +103 -0
- data/test/test_api.rb +188 -0
- data/test/test_library.rb +90 -0
- data/test/test_results.rb +5 -0
- data/test/test_status.rb +7 -0
- data/test/test_wrapper.rb +61 -0
- data/test/tmp/automat.txt +2 -0
- data/test/tmp/cracked.pot +2906 -0
- data/test/tmp/stdout.txt +696 -0
- data/test/wordlists/wordlist.dict +129988 -0
- metadata +108 -8
@@ -0,0 +1,103 @@
|
|
1
|
+
## nothing, reverse, case... base stuff
|
2
|
+
:
|
3
|
+
r
|
4
|
+
u
|
5
|
+
T0
|
6
|
+
|
7
|
+
## simple number append
|
8
|
+
$0
|
9
|
+
$1
|
10
|
+
$2
|
11
|
+
$3
|
12
|
+
$4
|
13
|
+
$5
|
14
|
+
$6
|
15
|
+
$7
|
16
|
+
$8
|
17
|
+
$9
|
18
|
+
|
19
|
+
## special number append
|
20
|
+
$0 $0
|
21
|
+
$0 $1
|
22
|
+
$0 $2
|
23
|
+
$1 $1
|
24
|
+
$1 $2
|
25
|
+
$1 $3
|
26
|
+
$2 $1
|
27
|
+
$2 $2
|
28
|
+
$2 $3
|
29
|
+
$6 $9
|
30
|
+
$7 $7
|
31
|
+
$8 $8
|
32
|
+
$9 $9
|
33
|
+
$1 $2 $3
|
34
|
+
|
35
|
+
## high frequency append
|
36
|
+
$e
|
37
|
+
$s
|
38
|
+
|
39
|
+
## high frequency overwrite at end
|
40
|
+
] $a
|
41
|
+
] ] $s
|
42
|
+
] ] $a
|
43
|
+
] ] $e $r
|
44
|
+
] ] $i $e
|
45
|
+
] ] ] $o
|
46
|
+
] ] ] $y
|
47
|
+
] ] ] $1 $2 $3
|
48
|
+
] ] ] $m $a $n
|
49
|
+
] ] ] $d $o $g
|
50
|
+
|
51
|
+
## high frequency prepend
|
52
|
+
^1
|
53
|
+
^e ^h ^t
|
54
|
+
|
55
|
+
## high frequency overwrite at start
|
56
|
+
o0d
|
57
|
+
o0m o1a
|
58
|
+
o0t o0b
|
59
|
+
|
60
|
+
## leetify
|
61
|
+
so0
|
62
|
+
si1
|
63
|
+
se3
|
64
|
+
|
65
|
+
## simple extracts
|
66
|
+
D2
|
67
|
+
D2 D2
|
68
|
+
D3
|
69
|
+
D4
|
70
|
+
|
71
|
+
## undouble word
|
72
|
+
'5 D3
|
73
|
+
'5 $1
|
74
|
+
|
75
|
+
## removes suffixes from 'strongified' passwords in dict
|
76
|
+
]
|
77
|
+
] ]
|
78
|
+
] ] ]
|
79
|
+
] ] ] d
|
80
|
+
] ] D1 ]
|
81
|
+
|
82
|
+
## rotates
|
83
|
+
+5 ] } } } } '4
|
84
|
+
x02 { { { { { {
|
85
|
+
} ] ] {
|
86
|
+
} } -0 x12
|
87
|
+
} } }
|
88
|
+
} } } } '4
|
89
|
+
} } } } } '5
|
90
|
+
} } } } } } Y4 '4 d
|
91
|
+
|
92
|
+
## unknown
|
93
|
+
*04 +0 '4
|
94
|
+
*05 x03 d '3 p1
|
95
|
+
+0 +0 +0 +0 +0 +0 +0 +0
|
96
|
+
+0 +0 +0 x12
|
97
|
+
Z4 '8 x42
|
98
|
+
Z5 '6 x31 ] p1
|
99
|
+
Z5 *75 '5 { x02
|
100
|
+
d x28 Y4 '4 d
|
101
|
+
f *A5 '8 x14
|
102
|
+
p2 '7 p1 x58
|
103
|
+
x14 d p2 '6
|
data/test/test_api.rb
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
path = File.dirname(__FILE__)
|
2
|
+
require 'pp'
|
3
|
+
require 'rest-client'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
def normal
|
7
|
+
path = File.dirname(__FILE__)
|
8
|
+
attack = 0
|
9
|
+
hash = "#{path}/hashes/md5.txt"
|
10
|
+
word_list = "#{path}/wordlists/wordlist.dict"
|
11
|
+
rules = "best64.rule"
|
12
|
+
type = 0
|
13
|
+
|
14
|
+
request = RestClient::Request.new(
|
15
|
+
:method => :post,
|
16
|
+
:url => '127.0.0.1:4567/crack.json',
|
17
|
+
:payload => {
|
18
|
+
multipart: true,
|
19
|
+
hash: File.new(hash, 'rb'),
|
20
|
+
word_list: File.new(word_list, 'rb'),
|
21
|
+
id: 1,
|
22
|
+
attack: attack,
|
23
|
+
rule_sets: rules,
|
24
|
+
type: type
|
25
|
+
}
|
26
|
+
)
|
27
|
+
response = request.execute
|
28
|
+
|
29
|
+
pp response
|
30
|
+
|
31
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/status.json', {:params => {:id => 1}})
|
32
|
+
|
33
|
+
while JSON.parse(RestClient.get '127.0.0.1:4567/status.json', {:params => {:id => 1}})['status'] == 'running'
|
34
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/status-advanced.json', {:params => {:id => 1}})
|
35
|
+
sleep 10
|
36
|
+
end
|
37
|
+
|
38
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/results.json', {:params => {:id => 1}})
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
def charset
|
43
|
+
path = File.dirname(__FILE__)
|
44
|
+
attack = 3
|
45
|
+
hash = "#{path}/hashes/md5.txt"
|
46
|
+
charset = '?l?l?l?l?l?l?l?l'
|
47
|
+
type = 0
|
48
|
+
|
49
|
+
request = RestClient::Request.new(
|
50
|
+
:method => :post,
|
51
|
+
:url => '127.0.0.1:4567/crack.json',
|
52
|
+
:payload => {
|
53
|
+
multipart: true,
|
54
|
+
hash: File.new(hash, 'rb'),
|
55
|
+
charset: charset,
|
56
|
+
id: 2,
|
57
|
+
attack: attack,
|
58
|
+
type: type
|
59
|
+
}
|
60
|
+
)
|
61
|
+
response = request.execute
|
62
|
+
|
63
|
+
pp response
|
64
|
+
|
65
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/status.json', {:params => {:id => 2}})
|
66
|
+
|
67
|
+
while JSON.parse(RestClient.get '127.0.0.1:4567/status.json', {:params => {:id => 2}})['status'] == 'running'
|
68
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/status-advanced.json', {:params => {:id => 2}})
|
69
|
+
sleep 30
|
70
|
+
end
|
71
|
+
|
72
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/results.json', {:params => {:id => 2}})
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
def combination
|
77
|
+
path = File.dirname(__FILE__)
|
78
|
+
attack = 1
|
79
|
+
hash = "#{path}/hashes/md5.txt"
|
80
|
+
word_list = "#{path}/wordlists/wordlist.dict"
|
81
|
+
word_list_2 = "#{path}/wordlists/wordlist.dict"
|
82
|
+
type = 0
|
83
|
+
|
84
|
+
request = RestClient::Request.new(
|
85
|
+
:method => :post,
|
86
|
+
:url => '127.0.0.1:4567/crack.json',
|
87
|
+
:payload => {
|
88
|
+
multipart: true,
|
89
|
+
hash: File.new(hash, 'rb'),
|
90
|
+
word_list: File.new(word_list, 'rb'),
|
91
|
+
word_list_2: File.new(word_list_2, 'rb'),
|
92
|
+
id: 3,
|
93
|
+
attack: attack,
|
94
|
+
type: type
|
95
|
+
}
|
96
|
+
)
|
97
|
+
response = request.execute
|
98
|
+
|
99
|
+
pp response
|
100
|
+
|
101
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/status.json', {:params => {:id => 3}})
|
102
|
+
|
103
|
+
while JSON.parse(RestClient.get '127.0.0.1:4567/status.json', {:params => {:id => 3}})['status'] == 'running'
|
104
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/status-advanced.json', {:params => {:id => 3}})
|
105
|
+
sleep 30
|
106
|
+
end
|
107
|
+
|
108
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/results.json', {:params => {:id => 3}})
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
def hybrid_1
|
113
|
+
path = File.dirname(__FILE__)
|
114
|
+
attack = 6
|
115
|
+
hash = "#{path}/hashes/md5.txt"
|
116
|
+
word_list = "#{path}/wordlists/wordlist.dict"
|
117
|
+
charset = '?d?d?d'
|
118
|
+
type = 0
|
119
|
+
|
120
|
+
request = RestClient::Request.new(
|
121
|
+
:method => :post,
|
122
|
+
:url => '127.0.0.1:4567/crack.json',
|
123
|
+
:payload => {
|
124
|
+
multipart: true,
|
125
|
+
hash: File.new(hash, 'rb'),
|
126
|
+
word_list: File.new(word_list, 'rb'),
|
127
|
+
charset: charset,
|
128
|
+
id: 4,
|
129
|
+
attack: attack,
|
130
|
+
type: type
|
131
|
+
}
|
132
|
+
)
|
133
|
+
response = request.execute
|
134
|
+
|
135
|
+
pp response
|
136
|
+
|
137
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/status.json', {:params => {:id => 4}})
|
138
|
+
|
139
|
+
while JSON.parse(RestClient.get '127.0.0.1:4567/status.json', {:params => {:id => 4}})['status'] == 'running'
|
140
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/status-advanced.json', {:params => {:id => 4}})
|
141
|
+
sleep 10
|
142
|
+
end
|
143
|
+
|
144
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/results.json', {:params => {:id => 4}})
|
145
|
+
|
146
|
+
end
|
147
|
+
|
148
|
+
def hybrid_2
|
149
|
+
path = File.dirname(__FILE__)
|
150
|
+
attack = 7
|
151
|
+
hash = "#{path}/hashes/md5.txt"
|
152
|
+
word_list = "#{path}/wordlists/wordlist.dict"
|
153
|
+
charset = '?d?d?d'
|
154
|
+
type = 0
|
155
|
+
|
156
|
+
request = RestClient::Request.new(
|
157
|
+
:method => :post,
|
158
|
+
:url => '127.0.0.1:4567/crack.json',
|
159
|
+
:payload => {
|
160
|
+
multipart: true,
|
161
|
+
hash: File.new(hash, 'rb'),
|
162
|
+
word_list: File.new(word_list, 'rb'),
|
163
|
+
charset: charset,
|
164
|
+
id: 5,
|
165
|
+
attack: attack,
|
166
|
+
type: type
|
167
|
+
}
|
168
|
+
)
|
169
|
+
response = request.execute
|
170
|
+
|
171
|
+
pp response
|
172
|
+
|
173
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/status.json', {:params => {:id => 5}})
|
174
|
+
|
175
|
+
while JSON.parse(RestClient.get '127.0.0.1:4567/status.json', {:params => {:id => 5}})['status'] == 'running'
|
176
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/status-advanced.json', {:params => {:id => 5}})
|
177
|
+
sleep 10
|
178
|
+
end
|
179
|
+
|
180
|
+
pp JSON.parse(RestClient.get '127.0.0.1:4567/results.json', {:params => {:id => 5}})
|
181
|
+
|
182
|
+
end
|
183
|
+
|
184
|
+
#normal
|
185
|
+
#charset
|
186
|
+
combination
|
187
|
+
#hybrid_1
|
188
|
+
#hybrid_2
|
@@ -0,0 +1,90 @@
|
|
1
|
+
path = File.dirname(__FILE__)
|
2
|
+
require "#{path}/../lib/ruby_hashcat"
|
3
|
+
require 'pp'
|
4
|
+
|
5
|
+
def normal
|
6
|
+
path = File.dirname(__FILE__)
|
7
|
+
worker = RubyHashcat::Objects::Hash.new(1, '/home/ubuntu/tools/oclHashcat-1.01/cudaHashcat64.bin')
|
8
|
+
worker.attack = 0
|
9
|
+
worker.hash = "#{path}/hashes/phpass.txt"
|
10
|
+
worker.word_list = "#{path}/wordlists/wordlist.dict"
|
11
|
+
worker.rules = "passwordspro.rule"
|
12
|
+
worker.type = 400
|
13
|
+
worker.username = true
|
14
|
+
|
15
|
+
worker.crack(true)
|
16
|
+
|
17
|
+
while worker.running? do
|
18
|
+
sleep 15
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def charset
|
23
|
+
path = File.dirname(__FILE__)
|
24
|
+
worker = RubyHashcat::Objects::Hash.new(2, '/home/ubuntu/tools/oclHashcat-1.01/cudaHashcat64.bin')
|
25
|
+
worker.attack = 3
|
26
|
+
worker.hash = "#{path}/hashes/md5.txt"
|
27
|
+
worker.charset = '?l?l?l?l?l?l?l?l'
|
28
|
+
worker.type = 0
|
29
|
+
worker.username = true
|
30
|
+
|
31
|
+
worker.crack(true)
|
32
|
+
|
33
|
+
while worker.running? do
|
34
|
+
sleep 15
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def combination
|
39
|
+
path = File.dirname(__FILE__)
|
40
|
+
worker = RubyHashcat::Objects::Hash.new(3, '/home/ubuntu/tools/oclHashcat-1.01/cudaHashcat64.bin')
|
41
|
+
worker.attack = 1
|
42
|
+
worker.hash = "#{path}/hashes/phpass.txt"
|
43
|
+
worker.word_list = ["#{path}/wordlists/wordlist.dict", "#{path}/wordlists/wordlist.dict"]
|
44
|
+
worker.type = 400
|
45
|
+
worker.username = true
|
46
|
+
|
47
|
+
worker.crack(true)
|
48
|
+
|
49
|
+
while worker.running? do
|
50
|
+
sleep 15
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def hybrid_1
|
55
|
+
path = File.dirname(__FILE__)
|
56
|
+
worker = RubyHashcat::Objects::Hash.new(4, '/home/ubuntu/tools/oclHashcat-1.01/cudaHashcat64.bin')
|
57
|
+
worker.attack = 6
|
58
|
+
worker.hash = "#{path}/hashes/md5.txt"
|
59
|
+
worker.word_list = "#{path}/wordlists/wordlist.dict"
|
60
|
+
worker.charset = '?d?d?d'
|
61
|
+
worker.type = 0
|
62
|
+
|
63
|
+
worker.crack(true)
|
64
|
+
|
65
|
+
while worker.running? do
|
66
|
+
sleep 15
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def hybrid_2
|
71
|
+
path = File.dirname(__FILE__)
|
72
|
+
worker = RubyHashcat::Objects::Hash.new(5, '/home/ubuntu/tools/oclHashcat-1.01/cudaHashcat64.bin')
|
73
|
+
worker.attack = 7
|
74
|
+
worker.hash = "#{path}/hashes/md5.txt"
|
75
|
+
worker.charset = '?d?d?d'
|
76
|
+
worker.word_list = "#{path}/wordlists/wordlist.dict"
|
77
|
+
worker.type = 0
|
78
|
+
|
79
|
+
worker.crack(true)
|
80
|
+
|
81
|
+
while worker.running? do
|
82
|
+
sleep 15
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
#normal
|
87
|
+
#charset
|
88
|
+
#combination
|
89
|
+
#hybrid_1
|
90
|
+
#hybrid_2
|
data/test/test_status.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
path = File.dirname(__FILE__)
|
2
|
+
require "#{path}/../lib/ruby_hashcat"
|
3
|
+
|
4
|
+
worker = RubyHashcat::Program.new('/opt/cudaHashcat/cudaHashcat64.bin')
|
5
|
+
|
6
|
+
File.delete("#{path}/cudaHashcat.log") if File.exists?("#{path}/cudaHashcat.log")
|
7
|
+
File.delete("#{path}/cudaHashcat.pot") if File.exists?("#{path}/cudaHashcat.pot")
|
8
|
+
File.delete("#{path}/md5.crack") if File.exists?("#{path}/md5.crack")
|
9
|
+
File.delete("#{path}/phpass.crack") if File.exists?("#{path}/phpass.crack")
|
10
|
+
File.delete("#{path}/md5crypt.crack") if File.exists?("#{path}/md5crypt.crack")
|
11
|
+
|
12
|
+
# cudaExample0.sh
|
13
|
+
worker.crack do |crack|
|
14
|
+
crack.outfile = "#{path}/md5.crack"
|
15
|
+
crack.quiet = true
|
16
|
+
crack.disable_restore = true
|
17
|
+
crack.disable_potfile = true
|
18
|
+
crack.runtime = 15
|
19
|
+
crack.markov_threshold = 32
|
20
|
+
crack.attack_mode = 7
|
21
|
+
crack.hash = "#{path}/hashes/md5.txt"
|
22
|
+
crack.charset = '?a?a?a?a'
|
23
|
+
crack.wordlist = "#{path}/wordlists/wordlist.dict"
|
24
|
+
end
|
25
|
+
|
26
|
+
# cudaExample400.sh
|
27
|
+
worker.crack do |crack|
|
28
|
+
crack.quiet = true
|
29
|
+
crack.disable_restore = true
|
30
|
+
crack.disable_potfile = true
|
31
|
+
crack.runtime = 15
|
32
|
+
crack.hash_type = 400
|
33
|
+
crack.outfile = "#{path}/phpass.crack"
|
34
|
+
crack.hash = "#{path}/hashes/phpass.txt"
|
35
|
+
crack.wordlist = "#{path}/wordlists/wordlist.dict"
|
36
|
+
end
|
37
|
+
|
38
|
+
# cudaExample500.sh
|
39
|
+
worker.crack do |crack|
|
40
|
+
crack.quiet = true
|
41
|
+
crack.disable_restore = true
|
42
|
+
crack.disable_potfile = true
|
43
|
+
crack.hash_type = 500
|
44
|
+
crack.runtime = 30
|
45
|
+
crack.outfile = "#{path}/md5crypt.crack"
|
46
|
+
crack.hash = "#{path}/hashes/md5crypt.txt"
|
47
|
+
crack.wordlist = "#{path}/wordlists/wordlist.dict"
|
48
|
+
end
|
49
|
+
|
50
|
+
# Custom Cracking
|
51
|
+
worker.crack do |crack|
|
52
|
+
crack.quiet = true
|
53
|
+
crack.disable_restore = true
|
54
|
+
crack.disable_potfile = true
|
55
|
+
crack.runtime = 120
|
56
|
+
crack.rules = ["#{path}/rules/best64.rule", "#{path}/rules/InsidePro-PasswordsPro.rule"]
|
57
|
+
crack.hash_type = 0
|
58
|
+
crack.outfile = "#{path}/md5_2.crack"
|
59
|
+
crack.hash = "#{path}/hashes/md5.txt"
|
60
|
+
crack.wordlist = "#{path}/wordlists/wordlist.dict"
|
61
|
+
end
|