From 9b14589e4fa3a110cd48943afcfe99680b20c9ac Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Sun, 22 Jan 2017 15:39:31 +0100 Subject: [PATCH] Added UDP parser showing UDP packets being sent and received on the network. --- lib/bettercap/sniffer/parsers/udp.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/bettercap/sniffer/parsers/udp.rb diff --git a/lib/bettercap/sniffer/parsers/udp.rb b/lib/bettercap/sniffer/parsers/udp.rb new file mode 100644 index 00000000..b9dc25af --- /dev/null +++ b/lib/bettercap/sniffer/parsers/udp.rb @@ -0,0 +1,27 @@ +# encoding: UTF-8 +=begin + +BETTERCAP + +Author : Simone 'evilsocket' Margaritelli +Email : evilsocket@gmail.com +Blog : https://www.evilsocket.net/ + +This project is released under the GPL 3 license. + +=end + +module BetterCap +module Parsers +# Just keep track of UDP connections. +class UDP < Base + def on_packet( pkt ) + begin + if pkt.is_udp? + StreamLogger.log_raw( pkt, 'UDP', "#{pkt.payload.size} bytes" ) + end + rescue; end + end +end +end +end