Change only the last methods to private

GSoC/Meterpreter_Web_Console
Pedro Ribeiro 2019-01-23 11:00:42 +07:00 committed by GitHub
parent 0562aa50b4
commit 9375ee2ffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 18 deletions

View File

@ -3,7 +3,7 @@ require 'msf/core/exploit/tcp'
###
#
# This module exposes methods that may be useful to exploits that deal with
# servers that speak the Nuuo protocols for their devices and management software.
# servers that speak Nuuo NUCM protocol for their devices and management software.
#
###
module Msf
@ -37,7 +37,7 @@ module Exploit::Remote::Nuuo
@nucs_session = nil
# All CMS versions at time of release
# All NUCS versions at time of release
# Note that these primitives are not guaranteed to work in all versions
# Add new version strings here
@nucs_versions =
@ -72,21 +72,6 @@ module Exploit::Remote::Nuuo
end
##
# Formats the message we want to send into the correct protocol format
##
private
def format_msg(msg)
final_msg = msg[0] + " #{datastore['PROTOCOL']}\r\n"
for line in msg[1..msg.length-1]
final_msg = final_msg + line + "\r\n"
end
if not final_msg =~ /USERLOGIN/
final_msg = final_msg + "User-Session-No: " + @nucs_session.to_s + "\r\n"
end
return final_msg + "\r\n"
end
##
# Sends a protocol message aynchronously - fire and forget
##
@ -193,6 +178,7 @@ module Exploit::Remote::Nuuo
next
else
@nucs_session = data
break
end
end
else
@ -203,6 +189,7 @@ module Exploit::Remote::Nuuo
next
else
@nucs_session = data
break
end
end
end
@ -219,7 +206,6 @@ module Exploit::Remote::Nuuo
end
end
private
def login_password
data = nucs_send_data_msg(["USERLOGIN", "Version: #{@nucs_version}", "Username: #{datastore['USERNAME']}", \
"Password-Length: #{datastore['PASSWORD'].length}", "TimeZone-Length: 0"], datastore['PASSWORD'])
@ -230,6 +216,20 @@ module Exploit::Remote::Nuuo
end
end
##
# Formats the message we want to send into the correct protocol format
##
def format_msg(msg)
final_msg = msg[0] + " #{datastore['PROTOCOL']}\r\n"
for line in msg[1..msg.length-1]
final_msg = final_msg + line + "\r\n"
end
if not final_msg =~ /USERLOGIN/
final_msg = final_msg + "User-Session-No: " + @nucs_session.to_s + "\r\n"
end
return final_msg + "\r\n"
end
end
end