Skip to content

Instantly share code, notes, and snippets.

@picatz
Last active November 6, 2016 00:49
Show Gist options
  • Save picatz/bd5f386ee1b739bc5d0f4386ac1e611f to your computer and use it in GitHub Desktop.
Save picatz/bd5f386ee1b739bc5d0f4386ac1e611f to your computer and use it in GitHub Desktop.
An example of using packetfu and pry
require 'packetfu'
require 'pry'
iface = PacketFu::Utils.default_int
cap = PacketFu::Capture.new(:iface => iface, :start => true)
cap.stream.each do | packet |
# will dump you into a pry repl
binding.pry
end
# => example output ...
# From: /path/to/packetfu_and_pry.rb @ line 9 :
#
# 3:
# 4: iface = PacketFu::Utils.default_int
# 5: cap = PacketFu::Capture.new(:iface => iface, :start => true)
# 6:
# 7: cap.stream.each do | packet |
# => 8: binding.pry
# 9: end
#
# [1] pry(main)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment