[framework] Using Scapy dissectors in Metasploit

H D Moore hdm at metasploit.com
Sat Sep 29 03:43:09 CDT 2007


I hacked on the source until it became class-wrapper friendly. The new 
code can be used in three distinct ways:

# boring class mode
scruby = ScrubyBasic.new
pkt = scruby.Ether()/scruby.IP()/scruby.TCP()/"AAAA"
scruby.sendp(pkt)

# old mode, constrained within a class
class MyScruby 
  include Scruby
  def wee
    sendp(Ether()/IP()/TCP()/"AAAA")
  end
end

# old mode (needs @conf to be initialized)
include Scruby
@conf = Conf.new
sendp(Ether()/IP()/TCP()/"AAAA")

Tarball available:
http://metasploit.com/users/hdm/tools/scruby-0.2.1-hdm.tgz

-HD

PS.  I converted it all to tab indents. Easy to convert back, but a pain  
to go the other direction.



More information about the framework mailing list