Skip to content

Commit 1c44406

Browse files
Removing unnecessary spaces
1 parent 7b87915 commit 1c44406

13 files changed

+7
-62
lines changed

msfd

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ end
1919
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
2020
require 'msfenv'
2121

22-
23-
2422
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
2523

2624
require 'msf/base'

msfrpc

-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ end
1717
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
1818
require 'msfenv'
1919

20-
21-
2220
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
2321

2422
require 'rex/parser/arguments'
@@ -59,7 +57,6 @@ arguments.parse(ARGV) do |opt, idx, val|
5957
end
6058
end
6159

62-
6360
unless opts['ServerHost']
6461
$stderr.puts "[-] Error: a server IP must be specified (-a)"
6562
$stderr.puts arguments.usage
@@ -93,4 +90,3 @@ while(ARGV.shift)
9390
end
9491

9592
Rex::Ui::Text::IrbShell.new(binding).run
96-

msfrpcd

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ end
1717
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
1818
require 'msfenv'
1919

20-
21-
2220
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
2321

2422
require 'rex/parser/arguments'

msfvenom

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ require 'msf/ui'
1616
require 'msf/base'
1717
require 'msf/core/payload_generator'
1818

19-
2019
class MsfVenomError < StandardError; end
2120
class HelpError < StandardError; end
2221
class UsageError < MsfVenomError; end

tools/password/cpassword_decrypt.rb

-5
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def decrypt(encrypted_data)
7979
end
8080
end
8181

82-
8382
#
8483
# Shows script usage
8584
#
@@ -88,31 +87,27 @@ def usage
8887
exit
8988
end
9089

91-
9290
#
9391
# Prints a status message
9492
#
9593
def print_status(msg='')
9694
$stderr.puts "[*] #{msg}"
9795
end
9896

99-
10097
#
10198
# Prints an error message
10299
#
103100
def print_error(msg='')
104101
$stderr.puts "[-] #{msg}"
105102
end
106103

107-
108104
#
109105
# Prints a good message
110106
#
111107
def print_good(msg='')
112108
$stderr.puts "[+] #{msg}"
113109
end
114110

115-
116111
#
117112
# main
118113
#

tools/password/halflm_second.rb

-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def try(word,challenge)
3939
"-s" => [ true, "The server challenge (default value 1122334455667788)" ],
4040
"-h" => [ false, "Display this help information" ])
4141

42-
4342
$args.parse(ARGV) { |opt, idx, val|
4443
case opt
4544
when "-n"
@@ -81,8 +80,6 @@ def try(word,challenge)
8180
exit
8281
end
8382

84-
85-
8683
pass = pass.upcase
8784
hash = hash.downcase
8885

@@ -123,7 +120,6 @@ def try(word,challenge)
123120
end
124121
end
125122

126-
127123
puts "[*] Trying four characters (eta: #{etime * cset.length * cset.length * cset.length} seconds)..."
128124
0.upto(cset.length-1) do |c1|
129125
0.upto(cset.length-1) do |c2|

tools/password/hmac_sha1_crack.rb

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# $Id$
44
#
5-
# This script cracks HMAC SHA1 hashes. It is strangely necessary as existing tools
5+
# This script cracks HMAC SHA1 hashes. It is strangely necessary as existing tools
66
# have issues with binary salt values and extremely large salt values. The primary
77
# goal of this tool is to handle IPMI 2.0 HMAC SHA1 hashes.
88
#
@@ -29,7 +29,6 @@ def usage
2929
exit
3030
end
3131

32-
3332
hash_inp = ARGV.shift || usage()
3433
word_inp = ARGV.shift || usage()
3534

@@ -51,17 +50,16 @@ def usage
5150
$stderr.puts "[-] Invalid hash entry, missing field: #{line}"
5251
next
5352
end
54-
unless h_salt =~ /^[a-f0-9]+$/i
53+
unless h_salt =~ /^[a-f0-9]+$/i
5554
$stderr.puts "[-] Invalid hash entry, salt must be in hex: #{line}"
5655
next
5756
end
5857
hashes << [h_id, [h_salt].pack("H*"), [h_hash].pack("H*") ]
5958
end
60-
hash_fd.close
61-
59+
hash_fd.close
6260

6361
stime = Time.now.to_f
64-
count = 0
62+
count = 0
6563
cracked = 0
6664

6765
word_fd.each_line do |line|
@@ -75,10 +73,10 @@ def usage
7573
cracked += 1
7674
end
7775
count += 1
78-
76+
7977
if count % 2500000 == 0
8078
$stderr.puts "[*] Found #{cracked} passwords with #{hashes.length} left (#{(count / (Time.now.to_f - stime)).to_i}/s)"
81-
end
79+
end
8280
end
8381
hashes.delete_if {|e| e[3] }
8482
break if hashes.length == 0

tools/password/lm2ntcrack.rb

-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def permute_pw(pw)
7070
"-d" => [ true, "The domain (machine) name (NETLMv2/NETNTLMv2 type only)" ],
7171
"-h" => [ false, "Display this help information" ])
7272

73-
7473
$args.parse(ARGV) { |opt, idx, val|
7574
case opt
7675
when "-t"
@@ -122,7 +121,6 @@ def permute_pw(pw)
122121
end
123122
end
124123

125-
126124
if type == "HALFLM" or type == "LM" or type == "NTLM" then
127125
if srvchal != nil or clichal != nil or user != nil or domain != nil then
128126
$stderr.puts "[*] No challenge, user or domain must be provided with this type"
@@ -872,5 +870,3 @@ def permute_pw(pw)
872870
$stderr.puts "type must be of type : HALFLM/LM/NTLM/HALFNETLMv1/NETLMv1/NETNTLMv1/NETNTLM2_SESSION/NETLMv2/NETNTLMv2"
873871
exit
874872
end
875-
876-

tools/password/md5_lookup.rb

-20
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
require 'msf/core'
3838
require 'optparse'
3939

40-
4140
#
4241
# Basic prints we can't live without
4342
#
@@ -71,7 +70,6 @@ class Disclaimer
7170
# @return [String] The name of the tool
7271
attr_accessor :group_name
7372

74-
7573
def initialize
7674
self.config_file = Msf::Config.config_file
7775
self.group_name = 'MD5Lookup'
@@ -93,23 +91,20 @@ def ack
9391
end
9492
end
9593

96-
9794
# Saves the waiver so the warning won't show again after ack
9895
#
9996
# @return [void]
10097
def save_waiver
10198
save_setting('waiver', true)
10299
end
103100

104-
105101
# Returns true if we don't have to show the warning again
106102
#
107103
# @return [Boolean]
108104
def has_waiver?
109105
load_setting('waiver') == 'true' ? true : false
110106
end
111107

112-
113108
private
114109

115110
# Saves a setting to Metasploit's config file
@@ -124,7 +119,6 @@ def save_setting(key_name, value)
124119
ini.to_file(self.config_file)
125120
end
126121

127-
128122
# Returns the value of a specific setting
129123
#
130124
# @param key_name [String] The name of the setting
@@ -177,7 +171,6 @@ def initialize(opts={})
177171
)
178172
end
179173

180-
181174
# Returns the found cracked MD5 hash
182175
#
183176
# @param md5_hash [String] The MD5 hash to lookup
@@ -192,10 +185,8 @@ def lookup(md5_hash, db)
192185
get_json_result(res)
193186
end
194187

195-
196188
private
197189

198-
199190
# Parses the cracked result from a JSON input
200191
# @param res [Rex::Proto::Http::Response] The Rex HTTP response
201192
# @return [String] Found cracked MD5 hash
@@ -217,7 +208,6 @@ def get_json_result(res)
217208

218209
end
219210

220-
221211
# This class parses the user-supplied options (inputs)
222212
class OptsConsole
223213

@@ -275,10 +265,8 @@ def self.parse(args)
275265
options
276266
end
277267

278-
279268
private
280269

281-
282270
# Returns the parsed options from ARGV
283271
#
284272
# raise [OptionParser::InvalidOption] Invalid option found
@@ -317,7 +305,6 @@ def self.get_parsed_options
317305
return parser, options
318306
end
319307

320-
321308
# Returns the actual database names based on what the user wants
322309
#
323310
# @param list [String] A list of user-supplied database names
@@ -339,7 +326,6 @@ def self.extract_db_names(list)
339326
new_db_list
340327
end
341328

342-
343329
# Returns a list of all of the supported database symbols
344330
#
345331
# @return [Array<Symbol>] Database symbols
@@ -357,7 +343,6 @@ def self.get_database_names
357343
end
358344
end
359345

360-
361346
# This class decides how this process works
362347
class Driver
363348

@@ -379,7 +364,6 @@ def initialize
379364
end
380365
end
381366

382-
383367
# Main function
384368
#
385369
# @return [void]
@@ -403,18 +387,15 @@ def run
403387
end
404388
end
405389

406-
407390
# Cleans up the output file handler if exists
408391
#
409392
# @return [void]
410393
def cleanup
411394
@output_handle.close if @output_handle
412395
end
413396

414-
415397
private
416398

417-
418399
# Saves the MD5 result to file
419400
#
420401
# @param result [Hash] The result that contains the MD5 information
@@ -472,7 +453,6 @@ def is_md5_format?(md5_hash)
472453

473454
end
474455

475-
476456
#
477457
# main
478458
#

tools/password/vxencrypt.rb

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def hashit(inp)
1515
hackit(sum)
1616
end
1717

18-
1918
def hackit(sum)
2019
magic = 31695317
2120
res = ((sum * magic) & 0xffffffff).to_s
@@ -29,4 +28,3 @@ def hackit(sum)
2928

3029
input = ARGV.shift || "flintstone"
3130
$stderr.puts "[*] Hash for password '#{input}' is #{hashit(input)}"
32-

tools/password/vxmaster.rb

-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# $Revision$
1313
#
1414

15-
1615
# VxWorks converts the clear-text password into single integer value. This value
1716
# can only be one of about 210,000 possible options. The method below emulates
1817
# what the vxencrypt utility does and was implemented based on publicly indexed
@@ -128,7 +127,6 @@ def vxworks_pass_from_sum(sum, lpass=nil)
128127
end
129128
seedsets << seeds
130129

131-
132130
seeds = []
133131
8.upto(12) do |slen|
134132
0x23.upto(0x7c) do |cset|
@@ -165,7 +163,6 @@ def vxworks_pass_from_sum(sum, lpass=nil)
165163
end
166164
seedsets << seeds
167165

168-
169166
# Calculate passwords and their hashes for all possible outputs
170167
1.upto(209656) do |i|
171168
found = false
@@ -200,4 +197,3 @@ def vxworks_pass_from_sum(sum, lpass=nil)
200197
exit(0)
201198
end
202199
end
203-

tools/recon/list_interfaces.rb

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
2121

22-
2322
if RUBY_PLATFORM == "i386-mingw32"
2423
begin
2524
require 'network_interface'

0 commit comments

Comments
 (0)