Metasploit mailing list archives

Re: SNMP or TCP


From: HD Moore <hdm () metasploit com>
Date: Wed, 14 Dec 2011 14:23:14 -0600

On 12/14/2011 7:54 AM, anthr6x wrote:
Hi all,

I am trying to scan the network for devices with a specific vendor
(looking at the MAC). Once a specific device is found, I want to connect
to it on port 80 to make sure it works. I was using
Msf::Exploit::Remote::SNMPClient to scan the network. When I try to
connect to a client using Msf::Exploit::Remote::Tcp, it still uses the
port 161. I tried using "connect(false, { 'PeerPort' => 80} )" as I've
been advised in the chat room, but still i'm getting the exception "the
connection was refused by the remote host (192.168.15.125:161
<http://192.168.15.125:161>)".

When I use Msf::Exploit::Remote::Tcp for scanning, it works as I want
but takes a long time to scan through the subnet. 

how can I overcome this issue?


You are mixing TCP/UDP, in this case, you can't have both handled via
the "connect" wrapper API, you would need to include the UDP mixin and
then make the TCP connection through the Rex API. An example:

s = Rex::Socket::Tcp.create(
        'PeerHost'  => rhost,
        'PeeerPort' => rport,
        'Context'   => { 'Msf' => framework, 'MsfExploit' => self }
    )

s.put("GET / HTTP/1.0\r\n\r\n")

_______________________________________________
https://mail.metasploit.com/mailman/listinfo/framework


Current thread: