2008-07-22 19:37:05 +00:00
|
|
|
##
|
2008-10-23 02:43:21 +00:00
|
|
|
# $Id$
|
2008-07-22 19:37:05 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# 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.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2008-07-22 19:37:05 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
require 'msf/core'
|
2009-07-17 20:36:40 +00:00
|
|
|
require 'racket'
|
2008-07-22 19:37:05 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Auxiliary
|
2008-07-22 19:37:05 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Ip
|
|
|
|
include Msf::Auxiliary::Scanner
|
2008-07-22 19:37:05 +00:00
|
|
|
|
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'Simple IP Spoofing Tester',
|
2008-10-23 02:43:21 +00:00
|
|
|
'Version' => '$Revision$',
|
2008-07-22 19:37:05 +00:00
|
|
|
'Description' => 'Simple IP Spoofing Tester',
|
|
|
|
'Author' => 'hdm',
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def run_host(ip)
|
|
|
|
print_status("Sending a packet to host #{ip}")
|
|
|
|
|
|
|
|
connect_ip if not ip_sock
|
2009-07-17 20:36:40 +00:00
|
|
|
|
|
|
|
n = Racket::Racket.new
|
|
|
|
|
|
|
|
n.l3 = Racket::IPv4.new
|
|
|
|
n.l3.src_ip = ip
|
|
|
|
n.l3.dst_ip = ip
|
|
|
|
n.l3.protocol = 17
|
|
|
|
n.l3.id = 0xdead
|
|
|
|
n.l3.ttl = 255
|
|
|
|
|
|
|
|
n.l4 = Racket::UDP.new
|
|
|
|
n.l4.src_port = 53
|
|
|
|
n.l4.dst_port = 53
|
|
|
|
n.l4.payload = "HELLO WORLD"
|
|
|
|
|
|
|
|
n.l4.fix!(n.l3.src_ip, n.l3.dst_ip)
|
|
|
|
|
|
|
|
buff = n.pack
|
2008-07-22 19:37:05 +00:00
|
|
|
|
|
|
|
ip_sock.sendto(buff, ip)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2009-07-17 20:36:40 +00:00
|
|
|
end
|