metasploit-framework/modules/auxiliary/scanner/pcanywhere/pcanywhere_tcp.rb

67 lines
1.5 KiB
Ruby
Raw Normal View History

2012-01-28 19:51:10 +00:00
##
# $Id$
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
class Metasploit3 < Msf::Auxiliary
include Msf::Exploit::Remote::Tcp
include Msf::Auxiliary::Scanner
include Msf::Auxiliary::Report
def initialize
super(
'Name' => 'pcAnywhere TCP Service Discovery',
'Version' => '$Revision$',
'Description' => 'Discover active pcAnywhere services through TCP',
'Author' => 'hdm',
'License' => MSF_LICENSE
)
register_options(
[
Opt::RPORT(5631)
], self.class)
end
def run_host(ip)
begin
connect
sock.put("\x00\x00\x00\x00")
res = sock.get_once(-1, 15)
if not (res and res.index("Please press <Enter>"))
disconnect
return
end
=begin
sock.put( "\x6f\x06\xfe" )
res = sock.get_once(-1, 15)
sock.put("\x6f\x61\xff\x09\x00\x07\x00\x00\x01\xff\x00\x00\x07\x00")
res = sock.get_once(-1, 15)
sock.put("\x6f\x62\x00\x02\x00\x00\x00")
res = sock.get_once(-1, 15)
print_status(Rex::Text.to_hex_dump(res))
=end
2012-01-28 19:52:25 +00:00
2012-01-28 19:51:10 +00:00
report_service(:host => rhost, :port => rport, :name => "pcanywhere", :info => "")
2012-01-28 19:52:25 +00:00
print_status("#{rhost}:#{rport} pcAnywhere")
2012-01-28 20:35:07 +00:00
rescue ::Rex::ConnectionError, ::EOFError
2012-01-28 19:51:10 +00:00
rescue ::Exception => e
2012-01-28 20:35:07 +00:00
print_error("#{rhost}:#{rport} Error: #{e.class} #{e} #{e.backtrace}")
2012-01-28 19:51:10 +00:00
end
end
end