See #782. Updating ldap exploit to use capture_sendto. Also updating capture.rb to include RHOST.

git-svn-id: file:///home/svn/framework3/trunk@8266 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Tod Beardsley 2010-01-27 19:37:22 +00:00
parent 0f37a27fe4
commit 2f76affadb
2 changed files with 15 additions and 7 deletions

View File

@ -4,9 +4,11 @@ module Msf
#
# This module provides methods for sending and receiving
# raw packets. It should be preferred over the soon-to-be
# deprecated Rex::Socket::Ip mixin.
# deprecated Rex::Socket::Ip and Msf::Exploite::Remote::Ip
# mixins.
#
# Please see the pcaprub documentation for more information.
# Please see the pcaprub documentation for more information
# on how to use capture objects.
#
###
@ -26,7 +28,8 @@ module Exploit::Capture
OptString.new('FILTER', [false, 'The filter string for capturing traffic']),
OptInt.new('SNAPLEN', [true, 'The number of bytes to capture', 65535]),
OptInt.new('TIMEOUT', [true, 'The number of seconds to wait for new data', 500]),
OptAddress.new('GATEWAY', [false, 'The gateway IP address'])
OptAddress.new('GATEWAY', [false, 'The gateway IP address']),
Opt::RHOST
], Msf::Exploit::Capture
)
@ -344,6 +347,11 @@ module Exploit::Capture
def expire_arpcache
self.arp_cache = {}
end
# For compatabilty with Msf::Exploit::Remote::Ip
def rhost
datastore['RHOST']
end
attr_accessor :capture, :arp_cache, :arp_capture

View File

@ -10,7 +10,7 @@ require 'racket'
class Metasploit3 < Msf::Auxiliary
include Msf::Exploit::Remote::Ip
include Msf::Exploit::Capture
include Msf::Auxiliary::Dos
def initialize
@ -42,7 +42,7 @@ class Metasploit3 < Msf::Auxiliary
m = Rex::Text.rand_text_alpha_lower(3)
connect_ip
open_pcap
n = Racket::Racket.new
@ -66,9 +66,9 @@ class Metasploit3 < Msf::Auxiliary
pkt = n.pack
ip_write(pkt)
capture_sendto(pkt, rhost)
disconnect_ip
close_pcap
end