Created
October 6, 2017 19:49
-
-
Save picatz/8966b7e650e64a4544d92f726a7740d0 to your computer and use it in GitHub Desktop.
Simple Packet Analysis with Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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