From d26a444665295e3fcebfc3ebefa20cb48aa90af5 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Sat, 30 Jan 2016 16:59:29 +0000 Subject: [PATCH] Add sniffer/parsers/SNPP --- lib/bettercap/sniffer/parsers/snpp.rb | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/bettercap/sniffer/parsers/snpp.rb diff --git a/lib/bettercap/sniffer/parsers/snpp.rb b/lib/bettercap/sniffer/parsers/snpp.rb new file mode 100644 index 00000000..0338df73 --- /dev/null +++ b/lib/bettercap/sniffer/parsers/snpp.rb @@ -0,0 +1,38 @@ +=begin + +BETTERCAP + +Author : Simone 'evilsocket' Margaritelli +Email : evilsocket@gmail.com +Blog : http://www.evilsocket.net/ + +This project is released under the GPL 3 license. + +=end +require 'bettercap/sniffer/parsers/base' + +module BetterCap +module Parsers +# Simple Network Paging Protocol (SNPP) authentication parser. +class Snpp < Base + def initialize + @name = 'SNPP' + end + def on_packet( pkt ) + begin + if pkt.tcp_dst == 444 + lines = pkt.to_s.split(/\r?\n/) + lines.each do |line| + if line =~ /LOGIn\s+(.+)\s+(.+)$/ + user = $1 + pass = $2 + StreamLogger.log_raw( pkt, @name, "username=#{user} password=#{pass}" ) + end + end + end + rescue + end + end +end +end +end