Land #6392, @wchen-r7's 'def peer' cleanup, fixing #6362

bug/bundler_fix
Jon Hart 2015-12-24 08:53:32 -08:00
commit efdb6a8885
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
34 changed files with 7 additions and 145 deletions

View File

@ -31,10 +31,6 @@ module Msf
) )
end end
def peer
"#{rhost}:#{rport}"
end
def read_timeout def read_timeout
datastore['READ_TIMEOUT'] datastore['READ_TIMEOUT']
end end

View File

@ -51,12 +51,6 @@ module Msf
datastore['RPORT'] datastore['RPORT']
end end
# Returns the RMI server peer
#
# @return [String]
def peer
"#{rhost}:#{rport}"
end
# Sends a RMI header stream # Sends a RMI header stream
# #

View File

@ -82,6 +82,11 @@ module Exploit::Remote::Tcp
) )
end end
# Returns the rhost:rport
def peer
"#{rhost}:#{rport}"
end
# #
# Establishes a TCP connection to the specified RHOST/RPORT # Establishes a TCP connection to the specified RHOST/RPORT
# #

View File

@ -190,10 +190,6 @@ class Metasploit3 < Msf::Auxiliary
response response
end end
def peer
"#{rhost}:#{rport}"
end
def protocol def protocol
datastore['PROTOCOL'] datastore['PROTOCOL']
end end

View File

@ -134,9 +134,6 @@ class Metasploit3 < Msf::Auxiliary
return nil return nil
end end
def peer
return "#{rhost}:#{rport}"
end
def fingerprint_endian def fingerprint_endian
begin begin

View File

@ -89,10 +89,6 @@ class Metasploit3 < Msf::Auxiliary
end end
end end
def peer
"#{rhost}:#{rport}"
end
def get_username def get_username
# Setup query to check for database username # Setup query to check for database username
clue_start = Rex::Text.rand_text_alpha(8 + rand(4)) clue_start = Rex::Text.rand_text_alpha(8 + rand(4))

View File

@ -40,10 +40,6 @@ class Metasploit3 < Msf::Auxiliary
], self.class) ], self.class)
end end
def peer
"#{rhost}:#{rport}"
end
def smb_delete_files def smb_delete_files
vprint_status("#{peer}: Connecting to the server...") vprint_status("#{peer}: Connecting to the server...")
connect() connect()

View File

@ -40,10 +40,6 @@ class Metasploit3 < Msf::Auxiliary
], self.class) ], self.class)
end end
def peer
"#{rhost}:#{rport}"
end
def smb_download def smb_download
vprint_status("#{peer}: Connecting...") vprint_status("#{peer}: Connecting...")
connect() connect()

View File

@ -47,10 +47,6 @@ class Metasploit3 < Msf::Auxiliary
end end
def peer
"#{rhost}:#{rport}"
end
def run_host(_ip) def run_host(_ip)
begin begin
vprint_status("#{peer}: Connecting to the server...") vprint_status("#{peer}: Connecting to the server...")

View File

@ -116,10 +116,6 @@ class Metasploit3 < Msf::Auxiliary
end end
def peer
"#{rhost}:#{rport}"
end
def dos_user def dos_user
length = 12000 # enough to overflow the end of allocated memory length = 12000 # enough to overflow the end of allocated memory
msg = create_message(length) msg = create_message(length)

View File

@ -42,10 +42,6 @@ class Metasploit3 < Msf::Auxiliary
], self.class) ], self.class)
end end
def peer
"#{rhost}:#{rport}"
end
def get_response(size = 72) def get_response(size = 72)
connect connect
response = sock.get_once(size) response = sock.get_once(size)

View File

@ -31,10 +31,6 @@ class Metasploit3 < Msf::Auxiliary
], self.class) ], self.class)
end end
def peer
"#{rhost}:#{rport}"
end
def run_host(ip) def run_host(ip)
vprint_status("#{peer} - Querying indices...") vprint_status("#{peer} - Querying indices...")
begin begin

View File

@ -36,10 +36,6 @@ class Metasploit3 < Msf::Auxiliary
], self.class) ], self.class)
end end
def peer
"#{rhost}:#{rport}"
end
def extract_words(wordfile) def extract_words(wordfile)
return [] unless wordfile && File.readable?(wordfile) return [] unless wordfile && File.readable?(wordfile)
begin begin

View File

@ -43,10 +43,6 @@ class Metasploit3 < Msf::Auxiliary
res res
end end
def peer
"#{rhost}:#{rport}"
end
def run_host(ip) def run_host(ip)
vprint_status("#{peer} - Login...") vprint_status("#{peer} - Login...")

View File

@ -124,9 +124,6 @@ class Metasploit3 < Msf::Auxiliary
"\x02\xf0\x80\x38" "\x02\xf0\x80\x38"
end end
def peer
"#{rhost}:#{rport}"
end
def check_rdp_vuln def check_rdp_vuln
# check if rdp is open # check if rdp is open

View File

@ -56,10 +56,6 @@ class Metasploit3 < Msf::Auxiliary
) )
end end
def peer
"#{rhost}:#{rport}"
end
def read_timeout def read_timeout
datastore['READ_TIMEOUT'] datastore['READ_TIMEOUT']
end end

View File

@ -38,10 +38,6 @@ class Metasploit3 < Msf::Auxiliary
], self.class) ], self.class)
end end
def peer
"#{rhost}:#{rport}"
end
def run_host(ip) def run_host(ip)
begin begin
connect connect

View File

@ -37,10 +37,6 @@ class Metasploit3 < Msf::Auxiliary
) )
end end
def peer
"#{rhost}:#{rport}"
end
def timeout def timeout
datastore['TIMEOUT'] <= 0 ? DEFAULT_TIMEOUT : datastore['TIMEOUT'] datastore['TIMEOUT'] <= 0 ? DEFAULT_TIMEOUT : datastore['TIMEOUT']
end end

View File

@ -111,10 +111,6 @@ class Metasploit3 < Msf::Auxiliary
], self.class) ], self.class)
end end
def peer
"#{rhost}:#{rport}"
end
def response_timeout def response_timeout
datastore['RESPONSE_TIMEOUT'] datastore['RESPONSE_TIMEOUT']
end end

View File

@ -170,10 +170,6 @@ class Metasploit3 < Msf::Auxiliary
end end
def peer
"#{rhost}:#{rport}"
end
# #
# Main methods # Main methods
# #

View File

@ -33,7 +33,7 @@ class Metasploit4 < Msf::Exploit::Remote
['CVE', '2013-2028'], ['CVE', '2013-2028'],
['OSVDB', '93037'], ['OSVDB', '93037'],
['URL', 'http://nginx.org/en/security_advisories.html'], ['URL', 'http://nginx.org/en/security_advisories.html'],
['URL', 'http://packetstormsecurity.com/files/121560/Nginx-1.3.9-1.4.0-Stack-Buffer-Overflow.html'] ['PACKETSTORM', '121560']
], ],
'Privileged' => false, 'Privileged' => false,
'Payload' => 'Payload' =>
@ -73,9 +73,6 @@ class Metasploit4 < Msf::Exploit::Remote
end end
def peer
"#{rhost}:#{rport}"
end
def check def check
begin begin

View File

@ -54,10 +54,6 @@ class Metasploit3 < Msf::Exploit::Remote
], self.class) ], self.class)
end end
def peer
"#{rhost}:#{rport}"
end
def exploit def exploit
unless vulnerable? unless vulnerable?
fail_with(Failure::Unknown, "#{peer} - Jenkins is not vulnerable, aborting...") fail_with(Failure::Unknown, "#{peer} - Jenkins is not vulnerable, aborting...")

View File

@ -129,10 +129,6 @@ class Metasploit3 < Msf::Exploit::Remote
end end
end end
def peer
"#{rhost}:#{rport}"
end
def build_pkt(fields) def build_pkt(fields)
data = "\xff\xfe" # BOM Unicode data = "\xff\xfe" # BOM Unicode
fields.each do |v| fields.each do |v|

View File

@ -147,10 +147,6 @@ class Metasploit3 < Msf::Exploit::Remote
end end
def peer
"#{rhost}:#{rport}"
end
def default_timeout def default_timeout
datastore['RESPONSE_TIMEOUT'] datastore['RESPONSE_TIMEOUT']
end end

View File

@ -106,10 +106,6 @@ class Metasploit3 < Msf::Exploit::Remote
end end
end end
def peer
"#{rhost}:#{rport}"
end
def primer def primer
connect connect

View File

@ -87,9 +87,6 @@ class Metasploit3 < Msf::Exploit::Remote
Exploit::CheckCode::Detected Exploit::CheckCode::Detected
end end
def peer
"#{rhost}:#{rport}"
end
def get_fingerprint def get_fingerprint
ommni = connect ommni = connect

View File

@ -105,9 +105,6 @@ class Metasploit3 < Msf::Exploit::Remote
end end
end end
def peer
"#{rhost}:#{rport}"
end
def build_pkt(fields) def build_pkt(fields)
data = "\xff\xfe" # BOM Unicode data = "\xff\xfe" # BOM Unicode

View File

@ -101,10 +101,6 @@ class Metasploit3 < Msf::Exploit::Remote
register_file_for_cleanup("wbem\\mof\\good\\#{mof_name}") register_file_for_cleanup("wbem\\mof\\good\\#{mof_name}")
end end
def peer
"#{rhost}:#{rport}"
end
def build_pkt(fields) def build_pkt(fields)
data = "\xff\xfe" # BOM Unicode data = "\xff\xfe" # BOM Unicode
fields.each do |v| fields.each do |v|

View File

@ -66,10 +66,6 @@ class Metasploit3 < Msf::Exploit::Remote
], self.class) ], self.class)
end end
def peer
"#{rhost}:#{rport}"
end
# #
# Check # Check
# #

View File

@ -59,10 +59,6 @@ class Metasploit3 < Msf::Exploit::Remote
return Exploit::CheckCode::Safe return Exploit::CheckCode::Safe
end end
def peer
"#{rhost}:#{rport}"
end
def query(q) def query(q)
rows = [] rows = []

View File

@ -64,10 +64,6 @@ class Metasploit3 < Msf::Exploit::Remote
Exploit::CheckCode::Safe Exploit::CheckCode::Safe
end end
def peer
"#{rhost}:#{rport}"
end
def query(q) def query(q)
rows = [] rows = []

View File

@ -31,11 +31,6 @@ class Metasploit3 < Msf::Post
], self.class) ], self.class)
end end
def peer
"#{session.session_host}:#{session.session_port}"
end
# #
# The OSX version uses an apple script to do this # The OSX version uses an apple script to do this
# #

View File

@ -58,11 +58,6 @@ class Metasploit3 < Msf::Post
version version
end end
def peer
"#{session.session_host}:#{session.session_port}"
end
# #
# Converts LastSession.plist to xml, and then read it # Converts LastSession.plist to xml, and then read it
# @param filename [String] The path to LastSession.plist # @param filename [String] The path to LastSession.plist

View File

@ -38,22 +38,6 @@ class Metasploit3 < Msf::Post
)) ))
end end
def r_host
if session.type =~ /meterpreter/
session.sock.peerhost
else
session.session_host
end
end
def peer
if session.type =~ /meterpreter/
"#{r_host} (#{sysinfo['Computer']})"
else
r_host
end
end
# #
# Decrypt DES encrypted password string # Decrypt DES encrypted password string
# #
@ -215,7 +199,7 @@ class Metasploit3 < Msf::Post
print_good "#{peer} - Found Username: '#{user}' Password: '#{pass}'" print_good "#{peer} - Found Username: '#{user}' Password: '#{pass}'"
report_cred( report_cred(
ip: r_host, ip: rhost,
port: port, port: port,
service_name: 'http', service_name: 'http',
user: user, user: user,