
belch
By: a guest on Nov 9th, 2009 | syntax:
Ruby | size: 0.59 KB | hits: 64 | expires: Never
n = Racket::Racket.new
n.l2 = Racket::Ethernet.new(Racket::Misc.randstring(14))
n.l2.src_mac = params[:src_mac]
n.l2.dst_mac = params[:dst_mac]
n.l2.ethertype = 0x86dd
n.l3 = Racket::IPv6.new
n.l3.src_ip = Racket::L3::Misc.ipv62long(params[:src_ip6])
n.l3.dst_ip = Racket::L3::Misc.ipv62long(params[:dst_ip6])
n.l3.ttl = 255
n.l3.nhead = 0x3a
n.l4 = Racket::ICMPv6.new
n.l4.type = 135
n.l4.target_addr = Racket::L3::Misc.ipv62long(params[:target])
n.l4.add_option(1, Racket::Misc.mac2long(params[:src_mac]))
intf = Pcap.open_live('eth0', 65535, false, 1)
intf.inject(n.pack)