diff --git a/activedirectory/activedirectory.go b/activedirectory/activedirectory.go index b6f7e50..0cbaf54 100644 --- a/activedirectory/activedirectory.go +++ b/activedirectory/activedirectory.go @@ -174,6 +174,10 @@ type ActiveDirectoryMatcher struct { } func (m *ActiveDirectoryMatcher) ServiceName() string { + return "ACTIVEDIRECTORY" +} + +func (m *ActiveDirectoryMatcher) String() string { return "ActiveDirectory" } diff --git a/cassandra/cassandra.go b/cassandra/cassandra.go index 2748897..c31ade1 100644 --- a/cassandra/cassandra.go +++ b/cassandra/cassandra.go @@ -20,6 +20,10 @@ type CassandraMatcher struct { } func (m *CassandraMatcher) ServiceName() string { + return "CASSANDRA" +} + +func (m *CassandraMatcher) String() string { return "Cassandra" } diff --git a/dns/dns.go b/dns/dns.go index 4c7d1b7..0c5c4ca 100644 --- a/dns/dns.go +++ b/dns/dns.go @@ -45,6 +45,10 @@ func (t *DNSMatcher) ServiceName() string { return "DNS" } +func (t *DNSMatcher) String() string { + return "DNS" +} + func (t *DNSMatcher) IsPrePacket() bool { return false } diff --git a/ftp/ftp.go b/ftp/ftp.go index 4405280..5aba801 100644 --- a/ftp/ftp.go +++ b/ftp/ftp.go @@ -29,6 +29,10 @@ type FTPMatcher struct { } func (ftp *FTPMatcher) ServiceName() string { + return "FTP" +} + +func (ftp *FTPMatcher) String() string { re := "" if ftp.isFtps { re = "FTPS" diff --git a/http/http.go b/http/http.go index 5932344..20f8740 100644 --- a/http/http.go +++ b/http/http.go @@ -14,6 +14,10 @@ func (h *HTTPMatcher) ServiceName() string { return "HTTP" } +func (h *HTTPMatcher) String() string { + return "HTTP" +} + func (h *HTTPMatcher) IsPrePacket() bool { return false } diff --git a/imap/imap.go b/imap/imap.go index 3326162..145ec59 100644 --- a/imap/imap.go +++ b/imap/imap.go @@ -17,6 +17,10 @@ func (i *IMAPMatcher) ServiceName() string { return "IMAP" } +func (i *IMAPMatcher) String() string { + return "IMAP" +} + func (i *IMAPMatcher) IsPrePacket() bool { return true } diff --git a/ldap/ldap.go b/ldap/ldap.go index 723029a..a6f140b 100644 --- a/ldap/ldap.go +++ b/ldap/ldap.go @@ -91,6 +91,10 @@ func (l *LDAPMatcher) ServiceName() string { return "LDAP" } +func (l *LDAPMatcher) String() string { + return "LDAP" +} + func (l *LDAPMatcher) IsPrePacket() bool { return false } diff --git a/matcher_test.go b/matcher_test.go index 2e72a81..b03f0b2 100644 --- a/matcher_test.go +++ b/matcher_test.go @@ -9,6 +9,10 @@ type TestMatcher struct { } func (t *TestMatcher) ServiceName() string { + return "TESTMATCHER" +} + +func (t *TestMatcher) String() string { return "TestMatcher" } diff --git a/mongodb/mongodb.go b/mongodb/mongodb.go index 77ad83d..47436da 100644 --- a/mongodb/mongodb.go +++ b/mongodb/mongodb.go @@ -38,6 +38,10 @@ type MongoDBMatcher struct { } func (t *MongoDBMatcher) ServiceName() string { + return "MONGODB" +} + +func (t *MongoDBMatcher) String() string { return "MongoDB" } diff --git a/mysql/mysql.go b/mysql/mysql.go index ef2d659..b2ebb54 100644 --- a/mysql/mysql.go +++ b/mysql/mysql.go @@ -42,6 +42,10 @@ type MySqlMatcher struct { } func (t *MySqlMatcher) ServiceName() string { + return "MYSQL" +} + +func (t *MySqlMatcher) String() string { if t.isErrResp { return "MySQL" + "(Err-" + strconv.Itoa(t.errCode) + " : " + t.errMsg + ")" } diff --git a/netbios/netbios.go b/netbios/netbios.go index f735e50..80f31d1 100644 --- a/netbios/netbios.go +++ b/netbios/netbios.go @@ -34,6 +34,10 @@ func (t *NetBiosMatcher) ServiceName() string { return "NBSS" } +func (t *NetBiosMatcher) String() string { + return "NBSS" +} + func (t *NetBiosMatcher) IsPrePacket() bool { return false } diff --git a/oracle/oracle.go b/oracle/oracle.go index 35b5165..9258650 100644 --- a/oracle/oracle.go +++ b/oracle/oracle.go @@ -12,6 +12,9 @@ type OracleMatcher struct { } func (o *OracleMatcher) ServiceName() string { + return "ORACLE" +} +func (o *OracleMatcher) String() string { return "Oracle" } diff --git a/pop/pop.go b/pop/pop.go index 28a2c13..475fab9 100644 --- a/pop/pop.go +++ b/pop/pop.go @@ -16,6 +16,10 @@ func (p *POPMatcher) ServiceName() string { return "POP3" } +func (p *POPMatcher) String() string { + return "POP3" +} + func (p *POPMatcher) IsPrePacket() bool { return true } diff --git a/postgresql/postgresql.go b/postgresql/postgresql.go index 7bf8493..b0608ad 100644 --- a/postgresql/postgresql.go +++ b/postgresql/postgresql.go @@ -57,6 +57,10 @@ type PostgreSQLMatcher struct { } func (t *PostgreSQLMatcher) ServiceName() string { + return "POSTGRESQL" +} + +func (t *PostgreSQLMatcher) String() string { return "PostgreSQL" } diff --git a/redis/protected/redisProtected.go b/redis/protected/redisProtected.go index fcc1668..5f171a9 100644 --- a/redis/protected/redisProtected.go +++ b/redis/protected/redisProtected.go @@ -14,6 +14,10 @@ type RedisProtectedMatcher struct { } func (r *RedisProtectedMatcher) ServiceName() string { + return "REDIS" +} + +func (r *RedisProtectedMatcher) String() string { return "Redis:Protected" } diff --git a/redis/redis.go b/redis/redis.go index 1c17a48..c7b0f38 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -13,6 +13,10 @@ type RedisMatcher struct { } func (t *RedisMatcher) ServiceName() string { + return "REDIS" +} + +func (t *RedisMatcher) String() string { return "Redis" } @@ -20,7 +24,6 @@ func (t *RedisMatcher) IsPrePacket() bool { return false } - func (t *RedisMatcher) HasResponse(index int) bool { return true } diff --git a/rmi/rmi.go b/rmi/rmi.go index 38789d8..ab1e547 100644 --- a/rmi/rmi.go +++ b/rmi/rmi.go @@ -35,6 +35,10 @@ func (r *RMIMatcher) ServiceName() string { return "RMI" } +func (r *RMIMatcher) String() string { + return "RMI" +} + func (r *RMIMatcher) IsPrePacket() bool { return false } diff --git a/smb/smb.go b/smb/smb.go index 709c908..d3f40ee 100644 --- a/smb/smb.go +++ b/smb/smb.go @@ -56,6 +56,10 @@ func (t *SMBMatcher) ServiceName() string { return "SMB" } +func (t *SMBMatcher) String() string { + return "SMB" +} + func (t *SMBMatcher) IsPrePacket() bool { return false } diff --git a/smtp/smtp.go b/smtp/smtp.go index c53fa28..e052ec4 100644 --- a/smtp/smtp.go +++ b/smtp/smtp.go @@ -14,6 +14,10 @@ func (t *SmtpMatcher) ServiceName() string { return "SMTP" } +func (t *SmtpMatcher) String() string { + return "SMTP" +} + func (t *SmtpMatcher) IsPrePacket() bool { return true } diff --git a/snmp/v2/snmpv2.go b/snmp/v2/snmpv2.go index db42974..1f8e14b 100644 --- a/snmp/v2/snmpv2.go +++ b/snmp/v2/snmpv2.go @@ -54,6 +54,10 @@ type SNMPMatcher struct { } func (t *SNMPMatcher) ServiceName() string { + return "SNMP_V2" +} + +func (t *SNMPMatcher) String() string { return "SNMP V2" } diff --git a/snmp/v3/snmpv3.go b/snmp/v3/snmpv3.go index f7ca87b..e37c4c5 100644 --- a/snmp/v3/snmpv3.go +++ b/snmp/v3/snmpv3.go @@ -73,6 +73,10 @@ type SNMPMatcher struct { } func (t *SNMPMatcher) ServiceName() string { + return "SNMP_V3" +} + +func (t *SNMPMatcher) String() string { return "SNMP V3" } diff --git a/sqlserver/sqlserver.go b/sqlserver/sqlserver.go index 257a6d8..920e9c1 100644 --- a/sqlserver/sqlserver.go +++ b/sqlserver/sqlserver.go @@ -69,6 +69,10 @@ type SQLServerMatcher struct { } func (t *SQLServerMatcher) ServiceName() string { + return "SQLSERVER" +} + +func (t *SQLServerMatcher) String() string { if t.isSSL { return "SQL Server (SSL)" } diff --git a/ssh/ssh.go b/ssh/ssh.go index 5f511cf..8a67bdb 100644 --- a/ssh/ssh.go +++ b/ssh/ssh.go @@ -14,6 +14,10 @@ func (ssh *SSHMatcher) ServiceName() string { return "SSH" } +func (ssh *SSHMatcher) String() string { + return "SSH" +} + func (ssh *SSHMatcher) IsPrePacket() bool { return true } diff --git a/telnet/telnet.go b/telnet/telnet.go index 523a7fd..7ef4311 100644 --- a/telnet/telnet.go +++ b/telnet/telnet.go @@ -17,6 +17,10 @@ type TelnetMatcher struct { } func (tel *TelnetMatcher) ServiceName() string { + return "TELNET" +} + +func (tel *TelnetMatcher) String() string { return "Telnet" } @@ -68,5 +72,3 @@ func NewMatcher() cnsm.Matcher { return m } - - diff --git a/wmi/wmi.go b/wmi/wmi.go index cba5393..b301722 100644 --- a/wmi/wmi.go +++ b/wmi/wmi.go @@ -25,6 +25,10 @@ func (w *WMIMatcher) ServiceName() string { return "WMI" } +func (w *WMIMatcher) String() string { + return "WMI" +} + func (w *WMIMatcher) IsPrePacket() bool { return false }