Removing unnecessary spaces

bug/bundler_fix
heitor.gouvea@ima.sp.gov.br 2017-09-12 10:00:18 -03:00
parent 7b87915e1f
commit 1c44406e94
13 changed files with 7 additions and 62 deletions

2
msfd
View File

@ -19,8 +19,6 @@ end
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib'))) $:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
require 'msfenv' require 'msfenv'
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB'] $:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'msf/base' require 'msf/base'

4
msfrpc
View File

@ -17,8 +17,6 @@ end
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib'))) $:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
require 'msfenv' require 'msfenv'
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB'] $:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex/parser/arguments' require 'rex/parser/arguments'
@ -59,7 +57,6 @@ arguments.parse(ARGV) do |opt, idx, val|
end end
end end
unless opts['ServerHost'] unless opts['ServerHost']
$stderr.puts "[-] Error: a server IP must be specified (-a)" $stderr.puts "[-] Error: a server IP must be specified (-a)"
$stderr.puts arguments.usage $stderr.puts arguments.usage
@ -93,4 +90,3 @@ while(ARGV.shift)
end end
Rex::Ui::Text::IrbShell.new(binding).run Rex::Ui::Text::IrbShell.new(binding).run

View File

@ -17,8 +17,6 @@ end
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib'))) $:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
require 'msfenv' require 'msfenv'
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB'] $:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex/parser/arguments' require 'rex/parser/arguments'

View File

@ -16,7 +16,6 @@ require 'msf/ui'
require 'msf/base' require 'msf/base'
require 'msf/core/payload_generator' require 'msf/core/payload_generator'
class MsfVenomError < StandardError; end class MsfVenomError < StandardError; end
class HelpError < StandardError; end class HelpError < StandardError; end
class UsageError < MsfVenomError; end class UsageError < MsfVenomError; end

View File

@ -79,7 +79,6 @@ class CPassword
end end
end end
# #
# Shows script usage # Shows script usage
# #
@ -88,7 +87,6 @@ def usage
exit exit
end end
# #
# Prints a status message # Prints a status message
# #
@ -96,7 +94,6 @@ def print_status(msg='')
$stderr.puts "[*] #{msg}" $stderr.puts "[*] #{msg}"
end end
# #
# Prints an error message # Prints an error message
# #
@ -104,7 +101,6 @@ def print_error(msg='')
$stderr.puts "[-] #{msg}" $stderr.puts "[-] #{msg}"
end end
# #
# Prints a good message # Prints a good message
# #
@ -112,7 +108,6 @@ def print_good(msg='')
$stderr.puts "[+] #{msg}" $stderr.puts "[+] #{msg}"
end end
# #
# main # main
# #

View File

@ -39,7 +39,6 @@ $args = Rex::Parser::Arguments.new(
"-s" => [ true, "The server challenge (default value 1122334455667788)" ], "-s" => [ true, "The server challenge (default value 1122334455667788)" ],
"-h" => [ false, "Display this help information" ]) "-h" => [ false, "Display this help information" ])
$args.parse(ARGV) { |opt, idx, val| $args.parse(ARGV) { |opt, idx, val|
case opt case opt
when "-n" when "-n"
@ -81,8 +80,6 @@ if(pass.length != 7)
exit exit
end end
pass = pass.upcase pass = pass.upcase
hash = hash.downcase hash = hash.downcase
@ -123,7 +120,6 @@ end
end end
end end
puts "[*] Trying four characters (eta: #{etime * cset.length * cset.length * cset.length} seconds)..." 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 |c1|
0.upto(cset.length-1) do |c2| 0.upto(cset.length-1) do |c2|

View File

@ -2,7 +2,7 @@
# #
# $Id$ # $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 # 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. # goal of this tool is to handle IPMI 2.0 HMAC SHA1 hashes.
# #
@ -29,7 +29,6 @@ def usage
exit exit
end end
hash_inp = ARGV.shift || usage() hash_inp = ARGV.shift || usage()
word_inp = ARGV.shift || usage() word_inp = ARGV.shift || usage()
@ -51,17 +50,16 @@ hash_fd.each_line do |line|
$stderr.puts "[-] Invalid hash entry, missing field: #{line}" $stderr.puts "[-] Invalid hash entry, missing field: #{line}"
next next
end 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}" $stderr.puts "[-] Invalid hash entry, salt must be in hex: #{line}"
next next
end end
hashes << [h_id, [h_salt].pack("H*"), [h_hash].pack("H*") ] hashes << [h_id, [h_salt].pack("H*"), [h_hash].pack("H*") ]
end end
hash_fd.close hash_fd.close
stime = Time.now.to_f stime = Time.now.to_f
count = 0 count = 0
cracked = 0 cracked = 0
word_fd.each_line do |line| word_fd.each_line do |line|
@ -75,10 +73,10 @@ word_fd.each_line do |line|
cracked += 1 cracked += 1
end end
count += 1 count += 1
if count % 2500000 == 0 if count % 2500000 == 0
$stderr.puts "[*] Found #{cracked} passwords with #{hashes.length} left (#{(count / (Time.now.to_f - stime)).to_i}/s)" $stderr.puts "[*] Found #{cracked} passwords with #{hashes.length} left (#{(count / (Time.now.to_f - stime)).to_i}/s)"
end end
end end
hashes.delete_if {|e| e[3] } hashes.delete_if {|e| e[3] }
break if hashes.length == 0 break if hashes.length == 0

View File

@ -70,7 +70,6 @@ $args = Rex::Parser::Arguments.new(
"-d" => [ true, "The domain (machine) name (NETLMv2/NETNTLMv2 type only)" ], "-d" => [ true, "The domain (machine) name (NETLMv2/NETNTLMv2 type only)" ],
"-h" => [ false, "Display this help information" ]) "-h" => [ false, "Display this help information" ])
$args.parse(ARGV) { |opt, idx, val| $args.parse(ARGV) { |opt, idx, val|
case opt case opt
when "-t" when "-t"
@ -122,7 +121,6 @@ else
end end
end end
if type == "HALFLM" or type == "LM" or type == "NTLM" then if type == "HALFLM" or type == "LM" or type == "NTLM" then
if srvchal != nil or clichal != nil or user != nil or domain != nil 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" $stderr.puts "[*] No challenge, user or domain must be provided with this type"
@ -872,5 +870,3 @@ else
$stderr.puts "type must be of type : HALFLM/LM/NTLM/HALFNETLMv1/NETLMv1/NETNTLMv1/NETNTLM2_SESSION/NETLMv2/NETNTLMv2" $stderr.puts "type must be of type : HALFLM/LM/NTLM/HALFNETLMv1/NETLMv1/NETNTLMv1/NETNTLM2_SESSION/NETLMv2/NETNTLMv2"
exit exit
end end

View File

@ -37,7 +37,6 @@ require 'rex'
require 'msf/core' require 'msf/core'
require 'optparse' require 'optparse'
# #
# Basic prints we can't live without # Basic prints we can't live without
# #
@ -71,7 +70,6 @@ module Md5LookupUtility
# @return [String] The name of the tool # @return [String] The name of the tool
attr_accessor :group_name attr_accessor :group_name
def initialize def initialize
self.config_file = Msf::Config.config_file self.config_file = Msf::Config.config_file
self.group_name = 'MD5Lookup' self.group_name = 'MD5Lookup'
@ -93,7 +91,6 @@ module Md5LookupUtility
end end
end end
# Saves the waiver so the warning won't show again after ack # Saves the waiver so the warning won't show again after ack
# #
# @return [void] # @return [void]
@ -101,7 +98,6 @@ module Md5LookupUtility
save_setting('waiver', true) save_setting('waiver', true)
end end
# Returns true if we don't have to show the warning again # Returns true if we don't have to show the warning again
# #
# @return [Boolean] # @return [Boolean]
@ -109,7 +105,6 @@ module Md5LookupUtility
load_setting('waiver') == 'true' ? true : false load_setting('waiver') == 'true' ? true : false
end end
private private
# Saves a setting to Metasploit's config file # Saves a setting to Metasploit's config file
@ -124,7 +119,6 @@ module Md5LookupUtility
ini.to_file(self.config_file) ini.to_file(self.config_file)
end end
# Returns the value of a specific setting # Returns the value of a specific setting
# #
# @param key_name [String] The name of the setting # @param key_name [String] The name of the setting
@ -177,7 +171,6 @@ module Md5LookupUtility
) )
end end
# Returns the found cracked MD5 hash # Returns the found cracked MD5 hash
# #
# @param md5_hash [String] The MD5 hash to lookup # @param md5_hash [String] The MD5 hash to lookup
@ -192,10 +185,8 @@ module Md5LookupUtility
get_json_result(res) get_json_result(res)
end end
private private
# Parses the cracked result from a JSON input # Parses the cracked result from a JSON input
# @param res [Rex::Proto::Http::Response] The Rex HTTP response # @param res [Rex::Proto::Http::Response] The Rex HTTP response
# @return [String] Found cracked MD5 hash # @return [String] Found cracked MD5 hash
@ -217,7 +208,6 @@ module Md5LookupUtility
end end
# This class parses the user-supplied options (inputs) # This class parses the user-supplied options (inputs)
class OptsConsole class OptsConsole
@ -275,10 +265,8 @@ module Md5LookupUtility
options options
end end
private private
# Returns the parsed options from ARGV # Returns the parsed options from ARGV
# #
# raise [OptionParser::InvalidOption] Invalid option found # raise [OptionParser::InvalidOption] Invalid option found
@ -317,7 +305,6 @@ module Md5LookupUtility
return parser, options return parser, options
end end
# Returns the actual database names based on what the user wants # Returns the actual database names based on what the user wants
# #
# @param list [String] A list of user-supplied database names # @param list [String] A list of user-supplied database names
@ -339,7 +326,6 @@ module Md5LookupUtility
new_db_list new_db_list
end end
# Returns a list of all of the supported database symbols # Returns a list of all of the supported database symbols
# #
# @return [Array<Symbol>] Database symbols # @return [Array<Symbol>] Database symbols
@ -357,7 +343,6 @@ module Md5LookupUtility
end end
end end
# This class decides how this process works # This class decides how this process works
class Driver class Driver
@ -379,7 +364,6 @@ module Md5LookupUtility
end end
end end
# Main function # Main function
# #
# @return [void] # @return [void]
@ -403,7 +387,6 @@ module Md5LookupUtility
end end
end end
# Cleans up the output file handler if exists # Cleans up the output file handler if exists
# #
# @return [void] # @return [void]
@ -411,10 +394,8 @@ module Md5LookupUtility
@output_handle.close if @output_handle @output_handle.close if @output_handle
end end
private private
# Saves the MD5 result to file # Saves the MD5 result to file
# #
# @param result [Hash] The result that contains the MD5 information # @param result [Hash] The result that contains the MD5 information
@ -472,7 +453,6 @@ module Md5LookupUtility
end end
# #
# main # main
# #

View File

@ -15,7 +15,6 @@ def hashit(inp)
hackit(sum) hackit(sum)
end end
def hackit(sum) def hackit(sum)
magic = 31695317 magic = 31695317
res = ((sum * magic) & 0xffffffff).to_s res = ((sum * magic) & 0xffffffff).to_s
@ -29,4 +28,3 @@ end
input = ARGV.shift || "flintstone" input = ARGV.shift || "flintstone"
$stderr.puts "[*] Hash for password '#{input}' is #{hashit(input)}" $stderr.puts "[*] Hash for password '#{input}' is #{hashit(input)}"

View File

@ -12,7 +12,6 @@
# $Revision$ # $Revision$
# #
# VxWorks converts the clear-text password into single integer value. This value # 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 # 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 # what the vxencrypt utility does and was implemented based on publicly indexed
@ -128,7 +127,6 @@ seeds = []
end end
seedsets << seeds seedsets << seeds
seeds = [] seeds = []
8.upto(12) do |slen| 8.upto(12) do |slen|
0x23.upto(0x7c) do |cset| 0x23.upto(0x7c) do |cset|
@ -165,7 +163,6 @@ seeds = []
end end
seedsets << seeds seedsets << seeds
# Calculate passwords and their hashes for all possible outputs # Calculate passwords and their hashes for all possible outputs
1.upto(209656) do |i| 1.upto(209656) do |i|
found = false found = false
@ -200,4 +197,3 @@ seedsets << seeds
exit(0) exit(0)
end end
end end

View File

@ -19,7 +19,6 @@ require 'msfenv'
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB'] $:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
if RUBY_PLATFORM == "i386-mingw32" if RUBY_PLATFORM == "i386-mingw32"
begin begin
require 'network_interface' require 'network_interface'

View File

@ -12,18 +12,17 @@
# mubix # mubix
# #
msfbase = __FILE__ msfbase = __FILE__
while File.symlink?(msfbase) while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase)) msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end end
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', '..', 'lib'))) $:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', '..', 'lib')))
require 'msfenv' require 'msfenv'
require 'rex' require 'rex'
require 'optparse' require 'optparse'
class OptsConsole class OptsConsole
def self.parse(args) def self.parse(args)
options = {'output' => 'iplist.txt'} options = {'output' => 'iplist.txt'}
@ -78,7 +77,6 @@ Usage: #{__FILE__} [options]|
end end
end end
# #
# Prints IPs # Prints IPs
# #
@ -91,7 +89,6 @@ def make_list(in_f, out_f)
end end
end end
# #
# Returns file handles # Returns file handles
# #
@ -106,7 +103,6 @@ def load_files(in_f, out_f)
return handle_in, handle_out return handle_in, handle_out
end end
options = OptsConsole.parse(ARGV) options = OptsConsole.parse(ARGV)
in_f, out_f = load_files(options['input'], options['output']) in_f, out_f = load_files(options['input'], options['output'])