Skip to content

Instantly share code, notes, and snippets.

@picatz
Created October 6, 2017 19:49
Show Gist options
  • Save picatz/8966b7e650e64a4544d92f726a7740d0 to your computer and use it in GitHub Desktop.
Save picatz/8966b7e650e64a4544d92f726a7740d0 to your computer and use it in GitHub Desktop.
Simple Packet Analysis with Ruby
require "pry"
require "packetgen"
capture = Pcap.open_live(Pcap.lookupdev, 65535, true, 1)
loop do
while packet = capture.next
begin
parsed = PacketGen.parse(packet)
binding.pry # exit to go to next packet
rescue
# yolo
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment