2009-07-21 10:54:24 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2009-07-21 10:54:24 +00:00
|
|
|
# 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::Auxiliary::Report
|
|
|
|
include Msf::Exploit::Capture
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-07-21 10:54:24 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'Simple Ethernet Frame Spoofer',
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'Description' => 'This module sends spoofed ethernet frames',
|
|
|
|
'Author' => 'hdm',
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Actions' =>
|
|
|
|
[
|
|
|
|
[ 'Spoofer' ]
|
|
|
|
],
|
|
|
|
'DefaultAction' => 'Spoofer'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
print_status("Opening the network interface...")
|
|
|
|
open_pcap()
|
|
|
|
|
2009-07-27 14:05:23 +00:00
|
|
|
r = Racket::Racket.new
|
2009-12-29 23:32:50 +00:00
|
|
|
r.l2 = Racket::L2::Ethernet.new
|
2009-07-21 10:54:24 +00:00
|
|
|
r.l2.ethertype = 0x0800
|
|
|
|
r.l2.src_mac = "00:41:41:41:41:41"
|
|
|
|
r.l2.dst_mac = "00:42:42:42:42:42"
|
2009-12-29 23:32:50 +00:00
|
|
|
r.l3 = Racket::L3::IPv4.new
|
2009-07-21 10:54:24 +00:00
|
|
|
r.l3.src_ip = "41.41.41.41"
|
|
|
|
r.l3.dst_ip = "42.42.42.42"
|
|
|
|
r.l3.protocol = 17
|
2009-12-29 23:32:50 +00:00
|
|
|
r.l4 = Racket::L4::UDP.new
|
2009-07-21 10:54:24 +00:00
|
|
|
r.l4.src_port = 0x41
|
|
|
|
r.l4.dst_port = 0x42
|
|
|
|
r.l4.payload = "SPOOOOOFED"
|
|
|
|
r.l4.fix!(r.l3.src_ip, r.l3.dst_ip)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-07-21 10:54:24 +00:00
|
|
|
1.upto(10) do
|
|
|
|
capture.inject(r.pack)
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-07-27 14:05:23 +00:00
|
|
|
close_pcap()
|
2009-07-21 10:54:24 +00:00
|
|
|
print_status("Finished sending")
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-07-21 10:54:24 +00:00
|
|
|
end
|