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

Commit

Permalink
Add sniffer/parsers/SNPP
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoles committed Jan 30, 2016
1 parent ea55d14 commit d26a444
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 d26a444

Please sign in to comment.