(self, pkt)
Packet callback
Packet callback
Packet callback
def dump(self, pkt):
        """Packet callback"""
        if not pkt is None:
            (usr, pswd) = parse_pkt(pkt)
            if not usr is None and not self.is_discovered(usr, pswd, pkt):
                self.log_msg('Host: %s\n[!] User: %s' % (pkt[IP].dst, usr))
            if not pswd is None and not self.is_discovered(usr, pswd, pkt):
                self.log_msg('Password: %s' % pswd)

            if usr is not None and pswd is not None:
                self.add_account_pw((usr, pswd, '%s:%s'
                                    % (pkt[IP].dst, pkt[TCP].dport)), pkt)
            elif not usr is None or not pswd is None:
                self.add_account(usr, pswd, pkt)
def dump ( self , pkt ) : if not pkt is None : ( usr , pswd ) = parse_pkt ( pkt ) if not usr is None and not self . is_discovered ( usr , pswd , pkt ) : self . log_msg ( 'Host: %s\n[!] User: %s' % ( pkt [ IP ] . dst , usr ) ) if not pswd is None and not self . is_discovered ( usr , pswd , pkt ) : self . log_msg ( 'Password: %s' % pswd ) if usr is not None and pswd is not None : self . add_account_pw ( ( usr , pswd , '%s:%s' % ( pkt [ IP ] . dst , pkt [ TCP ] . dport ) ) , pkt ) elif not usr is None or not pswd is None : self . add_account ( usr , pswd , pkt )