From f265cbad85fce34ce74278a071a92f56c3e011d3 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 12 Sep 2018 13:52:58 +0900 Subject: [PATCH] ing --- activedirectory/activedirectory.go | 16 ++++++++++++++++ cassandra/cassandra.go | 16 ++++++++++++++++ dns/dns.go | 15 +++++++++++++++ elasticsearch/elasticsearch.go | 15 +++++++++++++++ ftp/ftp.go | 15 +++++++++++++++ http/http.go | 16 ++++++++++++++++ imap/imap.go | 15 +++++++++++++++ ldap/ldap.go | 15 +++++++++++++++ lpd/lpd.go | 16 ++++++++++++++++ matcher.go | 4 ++++ mongodb/mongodb.go | 16 ++++++++++++++++ mysql/mysql.go | 16 ++++++++++++++++ nbss/nbss.go | 15 +++++++++++++++ oracle/oracle.go | 15 +++++++++++++++ pop/pop.go | 15 +++++++++++++++ postgresql/postgresql.go | 15 +++++++++++++++ redis/redis.go | 16 ++++++++++++++++ rmi/rmi.go | 16 ++++++++++++++++ smb/smb.go | 16 ++++++++++++++++ smtp/smtp.go | 15 +++++++++++++++ snmp/v2/snmpv2.go | 16 ++++++++++++++++ sqlserver/sqlserver.go | 15 +++++++++++++++ ssh/ssh.go | 16 ++++++++++++++++ telnet/telnet.go | 15 +++++++++++++++ wmi/wmi.go | 15 +++++++++++++++ 25 files changed, 375 insertions(+) diff --git a/activedirectory/activedirectory.go b/activedirectory/activedirectory.go index 56d4e3a..dab0f95 100644 --- a/activedirectory/activedirectory.go +++ b/activedirectory/activedirectory.go @@ -181,6 +181,22 @@ func (m *ActiveDirectoryMatcher) Type() string { return "DIRECTORY" } +func (m *ActiveDirectoryMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "MicroSoft" +} + +func (m *ActiveDirectoryMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *ActiveDirectoryMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *ActiveDirectoryMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + func (m *ActiveDirectoryMatcher) Name(matchCtx *osm.MatchCtx) string { return "ActiveDirectory" } diff --git a/cassandra/cassandra.go b/cassandra/cassandra.go index d26281f..4daa669 100644 --- a/cassandra/cassandra.go +++ b/cassandra/cassandra.go @@ -27,6 +27,22 @@ func (m *CassandraMatcher) Type() string { return "NOSQL" } +func (m *CassandraMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "The Apache Software Foundation" +} + +func (m *CassandraMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *CassandraMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *CassandraMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + func (m *CassandraMatcher) Name(matchCtx *osm.MatchCtx) string { return "Cassandra" } diff --git a/dns/dns.go b/dns/dns.go index 7819a15..8dd543d 100644 --- a/dns/dns.go +++ b/dns/dns.go @@ -48,6 +48,21 @@ func (m *DNSMatcher) Key() string { func (m *DNSMatcher) Type() string { return "NETWORK" } +func (m *DNSMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *DNSMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *DNSMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *DNSMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *DNSMatcher) Name(matchCtx *osm.MatchCtx) string { return "DNS" diff --git a/elasticsearch/elasticsearch.go b/elasticsearch/elasticsearch.go index 80f5c0d..9258c59 100644 --- a/elasticsearch/elasticsearch.go +++ b/elasticsearch/elasticsearch.go @@ -20,6 +20,21 @@ func (m *ElasticSearchMatcher) Key() string { func (m *ElasticSearchMatcher) Type() string { return "SEARCH" } +func (m *ElasticSearchMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "Elasticsearch" +} + +func (m *ElasticSearchMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *ElasticSearchMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *ElasticSearchMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *ElasticSearchMatcher) Name(matchCtx *osm.MatchCtx) string { name := "ElasticSearch" diff --git a/ftp/ftp.go b/ftp/ftp.go index 9550685..3d2daf9 100644 --- a/ftp/ftp.go +++ b/ftp/ftp.go @@ -36,6 +36,21 @@ func (m *FTPMatcher) Key() string { func (m *FTPMatcher) Type() string { return "NETWORK" } +func (m *FTPMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *FTPMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *FTPMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *FTPMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *FTPMatcher) Name(matchCtx *osm.MatchCtx) string { return "FTP" diff --git a/http/http.go b/http/http.go index a328f75..175f8ee 100644 --- a/http/http.go +++ b/http/http.go @@ -18,6 +18,22 @@ func (m *HTTPMatcher) Type() string { return "WEB" } +func (m *HTTPMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *HTTPMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *HTTPMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *HTTPMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + func (m *HTTPMatcher) Name(matchCtx *osm.MatchCtx) string { name := "HTTP" if v, ok := matchCtx.GetAttribute("server"); ok { diff --git a/imap/imap.go b/imap/imap.go index 01d1677..e57c614 100644 --- a/imap/imap.go +++ b/imap/imap.go @@ -20,6 +20,21 @@ func (m *IMAPMatcher) Key() string { func (m *IMAPMatcher) Type() string { return "MAIL" } +func (m *IMAPMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *IMAPMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *IMAPMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *IMAPMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *IMAPMatcher) Name(matchCtx *osm.MatchCtx) string { return "IMAP" diff --git a/ldap/ldap.go b/ldap/ldap.go index b56e3f0..53783b4 100644 --- a/ldap/ldap.go +++ b/ldap/ldap.go @@ -25,6 +25,21 @@ func (m *LDAPMatcher) Key() string { func (m *LDAPMatcher) Type() string { return "DIRECTORY" } +func (m *LDAPMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *LDAPMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *LDAPMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *LDAPMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *LDAPMatcher) Name(matchCtx *osm.MatchCtx) string { return "LDAP" diff --git a/lpd/lpd.go b/lpd/lpd.go index 6a511c5..c8cc460 100644 --- a/lpd/lpd.go +++ b/lpd/lpd.go @@ -16,6 +16,22 @@ func (m *LPDMatcher) Type() string { return "NETWORK" } +func (m *LPDMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *LPDMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *LPDMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *LPDMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + func (m *LPDMatcher) Name(matchCtx *osm.MatchCtx) string { return "LPD (Printer)" } diff --git a/matcher.go b/matcher.go index 20de11a..2b4b1bd 100644 --- a/matcher.go +++ b/matcher.go @@ -7,6 +7,10 @@ import ( type Matcher interface { Key() string Type() string + Vendor(matchCtx *MatchCtx) string + Version(matchCtx *MatchCtx) string + OsType(matchCtx *MatchCtx) string + OsVersion(matchCtx *MatchCtx) string Name(matchCtx *MatchCtx) string IsPrePacket() bool diff --git a/mongodb/mongodb.go b/mongodb/mongodb.go index f7c42ed..54d006e 100644 --- a/mongodb/mongodb.go +++ b/mongodb/mongodb.go @@ -58,6 +58,22 @@ func (m *MongoDBMatcher) Type() string { return "NOSQL" } +func (m *MongoDBMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "MongoDB" +} + +func (m *MongoDBMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *MongoDBMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *MongoDBMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + func (m *MongoDBMatcher) Name(matchCtx *osm.MatchCtx) string { return "MongoDB" } diff --git a/mysql/mysql.go b/mysql/mysql.go index 2d63a57..256a0d7 100644 --- a/mysql/mysql.go +++ b/mysql/mysql.go @@ -21,6 +21,22 @@ func (m *MySqlMatcher) Type() string { return "DATABASE" } +func (m *MySqlMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "Oracle" +} + +func (m *MySqlMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *MySqlMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *MySqlMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + func (m *MySqlMatcher) Name(matchCtx *osm.MatchCtx) string { name := "MySQL" if v, ok := matchCtx.GetAttribute("version"); ok { diff --git a/nbss/nbss.go b/nbss/nbss.go index 2a336b3..b429ca4 100644 --- a/nbss/nbss.go +++ b/nbss/nbss.go @@ -36,6 +36,21 @@ func (m *NBSSMatcher) Key() string { func (m *NBSSMatcher) Type() string { return "NETWORK" } +func (m *NBSSMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *NBSSMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *NBSSMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *NBSSMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *NBSSMatcher) Name(matchCtx *osm.MatchCtx) string { return "NBSS" diff --git a/oracle/oracle.go b/oracle/oracle.go index 3105577..4ceee28 100644 --- a/oracle/oracle.go +++ b/oracle/oracle.go @@ -18,6 +18,21 @@ func (m *OracleMatcher) Key() string { func (m *OracleMatcher) Type() string { return "DATABASE" } +func (m *OracleMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "Oracle" +} + +func (m *OracleMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *OracleMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *OracleMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *OracleMatcher) Name(matchCtx *osm.MatchCtx) string { return "Oracle" diff --git a/pop/pop.go b/pop/pop.go index 7fe9d8b..f8ccec0 100644 --- a/pop/pop.go +++ b/pop/pop.go @@ -19,6 +19,21 @@ func (m *POPMatcher) Key() string { func (m *POPMatcher) Type() string { return "MAIL" } +func (m *POPMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *POPMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *POPMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *POPMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *POPMatcher) Name(matchCtx *osm.MatchCtx) string { return "POP3" diff --git a/postgresql/postgresql.go b/postgresql/postgresql.go index ab8f8bc..b942ef8 100644 --- a/postgresql/postgresql.go +++ b/postgresql/postgresql.go @@ -48,6 +48,21 @@ func (m *PostgreSQLMatcher) Key() string { func (m *PostgreSQLMatcher) Type() string { return "DATABASE" } +func (m *PostgreSQLMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "PostgreSQL" +} + +func (m *PostgreSQLMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *PostgreSQLMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *PostgreSQLMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *PostgreSQLMatcher) Name(matchCtx *osm.MatchCtx) string { return "PostgreSQL" diff --git a/redis/redis.go b/redis/redis.go index 6e8cc07..90d49e2 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -24,6 +24,22 @@ func (m *RedisMatcher) Type() string { return "NOSQL" } +func (m *RedisMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "Redis" +} + +func (m *RedisMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *RedisMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *RedisMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + func (m *RedisMatcher) Name(matchCtx *osm.MatchCtx) string { name := "Redis" diff --git a/rmi/rmi.go b/rmi/rmi.go index 1d6909a..0d2c628 100644 --- a/rmi/rmi.go +++ b/rmi/rmi.go @@ -39,6 +39,22 @@ func (m *RMIMatcher) Type() string { return "NETWORK" } +func (m *RMIMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *RMIMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *RMIMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *RMIMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + func (m *RMIMatcher) Name(matchCtx *osm.MatchCtx) string { return "RMI" } diff --git a/smb/smb.go b/smb/smb.go index fee213c..bc8c803 100644 --- a/smb/smb.go +++ b/smb/smb.go @@ -60,6 +60,22 @@ func (m *SMBMatcher) Type() string { return "NETWORK" } +func (m *SMBMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SMBMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SMBMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SMBMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + func (m *SMBMatcher) Name(matchCtx *osm.MatchCtx) string { return "SMB" } diff --git a/smtp/smtp.go b/smtp/smtp.go index f08b726..3a97f5d 100644 --- a/smtp/smtp.go +++ b/smtp/smtp.go @@ -17,6 +17,21 @@ func (m *SmtpMatcher) Key() string { func (m *SmtpMatcher) Type() string { return "MAIL" } +func (m *SmtpMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SmtpMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SmtpMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SmtpMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *SmtpMatcher) Name(matchCtx *osm.MatchCtx) string { return "SMTP" diff --git a/snmp/v2/snmpv2.go b/snmp/v2/snmpv2.go index 63a6d2e..beb3a1b 100644 --- a/snmp/v2/snmpv2.go +++ b/snmp/v2/snmpv2.go @@ -51,6 +51,22 @@ func (m *SNMPMatcher) Type() string { return "MONITORING" } +func (m *SNMPMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SNMPMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SNMPMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SNMPMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + func (s *SNMPMatcher) Name(matchCtx *osm.MatchCtx) string { return "SNMP" } diff --git a/sqlserver/sqlserver.go b/sqlserver/sqlserver.go index 7b539fd..0eb1bf9 100644 --- a/sqlserver/sqlserver.go +++ b/sqlserver/sqlserver.go @@ -76,6 +76,21 @@ func (m *SQLServerMatcher) Key() string { func (m *SQLServerMatcher) Type() string { return "DATABASE" } +func (m *SQLServerMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "MicroSoft" +} + +func (m *SQLServerMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SQLServerMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SQLServerMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *SQLServerMatcher) Name(matchCtx *osm.MatchCtx) string { if m.isSSL { diff --git a/ssh/ssh.go b/ssh/ssh.go index d61bb47..dba976a 100644 --- a/ssh/ssh.go +++ b/ssh/ssh.go @@ -20,6 +20,22 @@ func (m *SSHMatcher) Type() string { return "NETWORK" } +func (m *SSHMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SSHMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SSHMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *SSHMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + func (m *SSHMatcher) Name(matchCtx *osm.MatchCtx) string { name := "SSH" if v, ok := matchCtx.GetAttribute("softwareversion"); ok { diff --git a/telnet/telnet.go b/telnet/telnet.go index ad54df1..c04f9f1 100644 --- a/telnet/telnet.go +++ b/telnet/telnet.go @@ -23,6 +23,21 @@ func (m *TelnetMatcher) Key() string { func (m *TelnetMatcher) Type() string { return "NETWORK" } +func (m *TelnetMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *TelnetMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *TelnetMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *TelnetMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *TelnetMatcher) Name(matchCtx *osm.MatchCtx) string { return "Telnet" diff --git a/wmi/wmi.go b/wmi/wmi.go index 267dad6..5601b5d 100644 --- a/wmi/wmi.go +++ b/wmi/wmi.go @@ -28,6 +28,21 @@ func (m *WMIMatcher) Key() string { func (m *WMIMatcher) Type() string { return "MONITORING" } +func (m *WMIMatcher) Vendor(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *WMIMatcher) Version(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *WMIMatcher) OsType(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} + +func (m *WMIMatcher) OsVersion(matchCtx *osm.MatchCtx) string { + return "UNKNOWN" +} func (m *WMIMatcher) Name(matchCtx *osm.MatchCtx) string { return "WMI"