i would like to modify packets on the wire
i have been messing around with this for along time now, at this point
im clueless… im sure that what im trying to do can be done under 5
lines of code…
require ‘packetfu’
listener_capture = PacketFu::Capture.new(:iface => ‘eth0’, :start =>
true, :promisc => false, :filter => “tcp port 80”)
listener_capture.stream.each { |packet|
pkt = PacketFu::Packet.parse(packet)
puts pkt.payload # this holds GET request and also the response
#tcpdump like function
#Im cluelss at this point
if pkt.include?(“www.microsoft.com”)
pkt.drop# stop the transaction so we can modify
inject(pkt.payload.gsub(“www.microsoft.com”,“www.debian.org”))
end
}
im looking for example code but i cant find anything