actually set max run time

make maxrutnime affect the crack command
This commit is contained in:
David Maloney 2014-06-14 20:03:56 -05:00
parent 33519b1fcd
commit a5fb898904
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
4 changed files with 19 additions and 1 deletions

View File

@ -2,7 +2,7 @@ source 'https://rubygems.org'
# Add default group gems to `metasploit-framework.gemspec`:
# spec.add_runtime_dependency '<name>', [<version requirements>]
gemspec
gem 'pry'
group :db do
# Needed for Msf::DbManager
gem 'activerecord', '>= 3.0.0', '< 4.0.0'

View File

@ -53,6 +53,7 @@ GEM
arel (3.0.3)
bcrypt (3.1.7)
builder (3.0.4)
coderay (1.1.0)
diff-lcs (1.2.5)
erubis (2.7.0)
factory_girl (4.4.0)
@ -71,6 +72,7 @@ GEM
activerecord (>= 3.2.13, < 4.0.0)
activesupport
pg
method_source (0.8.2)
mini_portile (0.6.0)
msgpack (0.5.8)
multi_json (1.0.4)
@ -80,6 +82,10 @@ GEM
packetfu (1.1.9)
pcaprub (0.11.3)
pg (0.17.1)
pry (0.9.12.6)
coderay (~> 1.0)
method_source (~> 0.8)
slop (~> 3.4)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
@ -124,6 +130,7 @@ GEM
multi_json (~> 1.0.3)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
slop (3.5.0)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
@ -150,6 +157,7 @@ DEPENDENCIES
network_interface (~> 0.0.1)
pcaprub
pg (>= 0.11)
pry
rake (>= 10.0.0)
redcarpet
rspec (>= 2.12)

View File

@ -140,6 +140,10 @@ module Metasploit
cmd << ( "--rules=" + rules )
end
if max_runtime.present?
cmd << ( "--max-run-time=" + max_runtime.to_s)
end
cmd << hash_path
end

View File

@ -15,6 +15,7 @@ describe Metasploit::Framework::JtR::Cracker do
let(:nt_format) { 'nt' }
let(:incremental) { 'Digits5' }
let(:rules) { 'Rule34'}
let(:max_runtime) { 5000 }
describe '#binary_path' do
@ -110,6 +111,11 @@ describe Metasploit::Framework::JtR::Cracker do
expect(cracker.crack_command).to include "--rules=#{rules}"
end
it 'uses the user supplied max-run-time' do
cracker.max_runtime = max_runtime
expect(cracker.crack_command).to include "--max-run-time=#{max_runtime.to_s}"
end
it 'puts the path to the has file at the end' do
cracker.hash_path = hash_path
expect(cracker.crack_command.last).to eq hash_path