Guest

belch

By: a guest on Nov 9th, 2009  |  syntax: Ruby  |  size: 0.59 KB  |  hits: 64  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. n = Racket::Racket.new
  2. n.l2 = Racket::Ethernet.new(Racket::Misc.randstring(14))
  3. n.l2.src_mac = params[:src_mac]
  4. n.l2.dst_mac = params[:dst_mac]
  5. n.l2.ethertype = 0x86dd
  6.  
  7. n.l3 = Racket::IPv6.new
  8. n.l3.src_ip = Racket::L3::Misc.ipv62long(params[:src_ip6])
  9. n.l3.dst_ip = Racket::L3::Misc.ipv62long(params[:dst_ip6])
  10. n.l3.ttl    = 255
  11. n.l3.nhead  = 0x3a
  12.  
  13. n.l4 = Racket::ICMPv6.new
  14. n.l4.type = 135
  15. n.l4.target_addr = Racket::L3::Misc.ipv62long(params[:target])
  16. n.l4.add_option(1, Racket::Misc.mac2long(params[:src_mac]))
  17.  
  18. intf = Pcap.open_live('eth0', 65535, false, 1)
  19. intf.inject(n.pack)