Skip to content
This repository has been archived by the owner on Feb 28, 2018. It is now read-only.

Commit

Permalink
Merge pull request #116 from bcoles/parsers_snpp
Browse files Browse the repository at this point in the history
Add sniffer/parsers/SNPP
  • Loading branch information
evilsocket committed Jan 30, 2016
2 parents b6ffed5 + d26a444 commit 24f6c51
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions lib/bettercap/sniffer/parsers/snpp.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
=begin
BETTERCAP
Author : Simone 'evilsocket' Margaritelli
Email : [email protected]
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

0 comments on commit 24f6c51

Please sign in to comment.