Created
March 20, 2015 20:44
-
-
Save astroza/b5993c02278bbeac2643 to your computer and use it in GitHub Desktop.
FOTM sniffer
This file contains 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 'packetfu' | |
include PacketFu | |
iface = ARGV[0] || "en1" | |
def sniff(iface) | |
cap = Capture.new(:iface => iface, :start => true) | |
cap.stream.each do |p| | |
pkt = Packet.parse p | |
if pkt.is_tcp? | |
next if pkt.ip_daddr != '23.96.96.142' | |
m = /GET (\/api.+) HTTP.+/.match(pkt.payload) | |
if m | |
puts "API REQUEST: curl \"http://fotm.info#{m[1]}\"" | |
end | |
end | |
end | |
end | |
sniff(iface) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gem install packetfu pcaprub