Skip to content

Commit

Permalink
Removing unnecessary spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Sep 12, 2017
1 parent 7b87915 commit 1c44406
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 62 deletions.
2 changes: 0 additions & 2 deletions msfd
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ end
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
require 'msfenv'



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

require 'msf/base'
Expand Down
4 changes: 0 additions & 4 deletions msfrpc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ end
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
require 'msfenv'



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

require 'rex/parser/arguments'
Expand Down Expand Up @@ -59,7 +57,6 @@ arguments.parse(ARGV) do |opt, idx, val|
end
end


unless opts['ServerHost']
$stderr.puts "[-] Error: a server IP must be specified (-a)"
$stderr.puts arguments.usage
Expand Down Expand Up @@ -93,4 +90,3 @@ while(ARGV.shift)
end

Rex::Ui::Text::IrbShell.new(binding).run

2 changes: 0 additions & 2 deletions msfrpcd
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ end
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
require 'msfenv'



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

require 'rex/parser/arguments'
Expand Down
1 change: 0 additions & 1 deletion msfvenom
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ require 'msf/ui'
require 'msf/base'
require 'msf/core/payload_generator'


class MsfVenomError < StandardError; end
class HelpError < StandardError; end
class UsageError < MsfVenomError; end
Expand Down
5 changes: 0 additions & 5 deletions tools/password/cpassword_decrypt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def decrypt(encrypted_data)
end
end


#
# Shows script usage
#
Expand All @@ -88,31 +87,27 @@ def usage
exit
end


#
# Prints a status message
#
def print_status(msg='')
$stderr.puts "[*] #{msg}"
end


#
# Prints an error message
#
def print_error(msg='')
$stderr.puts "[-] #{msg}"
end


#
# Prints a good message
#
def print_good(msg='')
$stderr.puts "[+] #{msg}"
end


#
# main
#
Expand Down
4 changes: 0 additions & 4 deletions tools/password/halflm_second.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def try(word,challenge)
"-s" => [ true, "The server challenge (default value 1122334455667788)" ],
"-h" => [ false, "Display this help information" ])


$args.parse(ARGV) { |opt, idx, val|
case opt
when "-n"
Expand Down Expand Up @@ -81,8 +80,6 @@ def try(word,challenge)
exit
end



pass = pass.upcase
hash = hash.downcase

Expand Down Expand Up @@ -123,7 +120,6 @@ def try(word,challenge)
end
end


puts "[*] Trying four characters (eta: #{etime * cset.length * cset.length * cset.length} seconds)..."
0.upto(cset.length-1) do |c1|
0.upto(cset.length-1) do |c2|
Expand Down
14 changes: 6 additions & 8 deletions tools/password/hmac_sha1_crack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# $Id$
#
# This script cracks HMAC SHA1 hashes. It is strangely necessary as existing tools
# This script cracks HMAC SHA1 hashes. It is strangely necessary as existing tools
# have issues with binary salt values and extremely large salt values. The primary
# goal of this tool is to handle IPMI 2.0 HMAC SHA1 hashes.
#
Expand All @@ -29,7 +29,6 @@ def usage
exit
end


hash_inp = ARGV.shift || usage()
word_inp = ARGV.shift || usage()

Expand All @@ -51,17 +50,16 @@ def usage
$stderr.puts "[-] Invalid hash entry, missing field: #{line}"
next
end
unless h_salt =~ /^[a-f0-9]+$/i
unless h_salt =~ /^[a-f0-9]+$/i
$stderr.puts "[-] Invalid hash entry, salt must be in hex: #{line}"
next
end
hashes << [h_id, [h_salt].pack("H*"), [h_hash].pack("H*") ]
end
hash_fd.close

hash_fd.close

stime = Time.now.to_f
count = 0
count = 0
cracked = 0

word_fd.each_line do |line|
Expand All @@ -75,10 +73,10 @@ def usage
cracked += 1
end
count += 1

if count % 2500000 == 0
$stderr.puts "[*] Found #{cracked} passwords with #{hashes.length} left (#{(count / (Time.now.to_f - stime)).to_i}/s)"
end
end
end
hashes.delete_if {|e| e[3] }
break if hashes.length == 0
Expand Down
4 changes: 0 additions & 4 deletions tools/password/lm2ntcrack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def permute_pw(pw)
"-d" => [ true, "The domain (machine) name (NETLMv2/NETNTLMv2 type only)" ],
"-h" => [ false, "Display this help information" ])


$args.parse(ARGV) { |opt, idx, val|
case opt
when "-t"
Expand Down Expand Up @@ -122,7 +121,6 @@ def permute_pw(pw)
end
end


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


20 changes: 0 additions & 20 deletions tools/password/md5_lookup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
require 'msf/core'
require 'optparse'


#
# Basic prints we can't live without
#
Expand Down Expand Up @@ -71,7 +70,6 @@ class Disclaimer
# @return [String] The name of the tool
attr_accessor :group_name


def initialize
self.config_file = Msf::Config.config_file
self.group_name = 'MD5Lookup'
Expand All @@ -93,23 +91,20 @@ def ack
end
end


# Saves the waiver so the warning won't show again after ack
#
# @return [void]
def save_waiver
save_setting('waiver', true)
end


# Returns true if we don't have to show the warning again
#
# @return [Boolean]
def has_waiver?
load_setting('waiver') == 'true' ? true : false
end


private

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


# Returns the value of a specific setting
#
# @param key_name [String] The name of the setting
Expand Down Expand Up @@ -177,7 +171,6 @@ def initialize(opts={})
)
end


# Returns the found cracked MD5 hash
#
# @param md5_hash [String] The MD5 hash to lookup
Expand All @@ -192,10 +185,8 @@ def lookup(md5_hash, db)
get_json_result(res)
end


private


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

end


# This class parses the user-supplied options (inputs)
class OptsConsole

Expand Down Expand Up @@ -275,10 +265,8 @@ def self.parse(args)
options
end


private


# Returns the parsed options from ARGV
#
# raise [OptionParser::InvalidOption] Invalid option found
Expand Down Expand Up @@ -317,7 +305,6 @@ def self.get_parsed_options
return parser, options
end


# Returns the actual database names based on what the user wants
#
# @param list [String] A list of user-supplied database names
Expand All @@ -339,7 +326,6 @@ def self.extract_db_names(list)
new_db_list
end


# Returns a list of all of the supported database symbols
#
# @return [Array<Symbol>] Database symbols
Expand All @@ -357,7 +343,6 @@ def self.get_database_names
end
end


# This class decides how this process works
class Driver

Expand All @@ -379,7 +364,6 @@ def initialize
end
end


# Main function
#
# @return [void]
Expand All @@ -403,18 +387,15 @@ def run
end
end


# Cleans up the output file handler if exists
#
# @return [void]
def cleanup
@output_handle.close if @output_handle
end


private


# Saves the MD5 result to file
#
# @param result [Hash] The result that contains the MD5 information
Expand Down Expand Up @@ -472,7 +453,6 @@ def is_md5_format?(md5_hash)

end


#
# main
#
Expand Down
2 changes: 0 additions & 2 deletions tools/password/vxencrypt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def hashit(inp)
hackit(sum)
end


def hackit(sum)
magic = 31695317
res = ((sum * magic) & 0xffffffff).to_s
Expand All @@ -29,4 +28,3 @@ def hackit(sum)

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

4 changes: 0 additions & 4 deletions tools/password/vxmaster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# $Revision$
#


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


seeds = []
8.upto(12) do |slen|
0x23.upto(0x7c) do |cset|
Expand Down Expand Up @@ -165,7 +163,6 @@ def vxworks_pass_from_sum(sum, lpass=nil)
end
seedsets << seeds


# Calculate passwords and their hashes for all possible outputs
1.upto(209656) do |i|
found = false
Expand Down Expand Up @@ -200,4 +197,3 @@ def vxworks_pass_from_sum(sum, lpass=nil)
exit(0)
end
end

1 change: 0 additions & 1 deletion tools/recon/list_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

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


if RUBY_PLATFORM == "i386-mingw32"
begin
require 'network_interface'
Expand Down
Loading

0 comments on commit 1c44406

Please sign in to comment.