diff --git a/activedirectory/activedirectory.go b/activedirectory/activedirectory.go index a100d4b..5c780a6 100644 --- a/activedirectory/activedirectory.go +++ b/activedirectory/activedirectory.go @@ -200,7 +200,7 @@ func (m *ActiveDirectoryMatcher) Match(info osm.MatchInfo, index int, packet *os } buf := new(bytes.Buffer) - buf.Write(packet.Bytes()) + buf.Write(packet.Buffer) adRecv := AD_RECV{} diff --git a/cassandra/cassandra.go b/cassandra/cassandra.go index 48a51bd..e2f39a4 100644 --- a/cassandra/cassandra.go +++ b/cassandra/cassandra.go @@ -50,7 +50,7 @@ func (m *CassandraMatcher) Match(info osm.MatchInfo, index int, packet *osm.Pack } reader := new(bytes.Buffer) - reader.Write(packet.Bytes()) + reader.Write(packet.Buffer) c := cassandra{} if err := binary.Read(reader, binary.BigEndian, &c); err != nil { diff --git a/dns/dns.go b/dns/dns.go index 041354d..dedac3d 100644 --- a/dns/dns.go +++ b/dns/dns.go @@ -71,7 +71,7 @@ func (t *DNSMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) er } reader := new(bytes.Buffer) - reader.Write(packet.Bytes()) + reader.Write(packet.Buffer) h := Dns_frame_header{} if err := binary.Read(reader, binary.BigEndian, &h); err != nil { diff --git a/ldap/ldap.go b/ldap/ldap.go index bf87471..62b22f5 100644 --- a/ldap/ldap.go +++ b/ldap/ldap.go @@ -43,7 +43,7 @@ func (l *LDAPMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) e if packet == nil || !packet.Valid() { return osm.NoPacketReceivedError() } - p := ber.DecodePacket(packet.Bytes()) + p := ber.DecodePacket(packet.Buffer) if len(p.Children) <= 1 { return osm.NotMatchedError() diff --git a/mongodb/mongodb.go b/mongodb/mongodb.go index 1dac1e7..608ad3e 100644 --- a/mongodb/mongodb.go +++ b/mongodb/mongodb.go @@ -82,7 +82,7 @@ func (m *MongoDBMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet } reader := new(bytes.Buffer) - reader.Write(packet.Bytes()) + reader.Write(packet.Buffer) reply := OP_reply{} if err := binary.Read(reader, binary.LittleEndian, &reply); err != nil { diff --git a/nbss/nbss.go b/nbss/nbss.go index cfa9dce..0baac68 100644 --- a/nbss/nbss.go +++ b/nbss/nbss.go @@ -60,7 +60,7 @@ func (t *NBSSMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) e } reader := new(bytes.Buffer) - reader.Write(packet.Bytes()) + reader.Write(packet.Buffer) n := NBSS{} if err := binary.Read(reader, binary.LittleEndian, &n); err != nil { diff --git a/oracle/oracle.go b/oracle/oracle.go index e57af77..6402049 100644 --- a/oracle/oracle.go +++ b/oracle/oracle.go @@ -44,7 +44,7 @@ func (o *OracleMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) refuse := body_refuse{} buf := new(bytes.Buffer) - buf.Write(packet.Bytes()) + buf.Write(packet.Buffer) binary.Read(buf, binary.BigEndian, &header) binary.Read(buf, binary.BigEndian, &refuse) diff --git a/postgresql/postgresql.go b/postgresql/postgresql.go index 21fdc1c..fba5ebd 100644 --- a/postgresql/postgresql.go +++ b/postgresql/postgresql.go @@ -73,7 +73,7 @@ func (p *PostgreSQLMatcher) Match(info osm.MatchInfo, index int, packet *osm.Pac } reader := new(bytes.Buffer) - reader.Write(packet.Bytes()) + reader.Write(packet.Buffer) pg := pgsqlErrResponse{} if err := binary.Read(reader, binary.BigEndian, &pg); err != nil { diff --git a/rmi/rmi.go b/rmi/rmi.go index 8e270a8..d602a92 100644 --- a/rmi/rmi.go +++ b/rmi/rmi.go @@ -63,7 +63,7 @@ func (r *RMIMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) er rmiRecv := RMI_RECV_MESSAGE{} - buf := bytes.NewReader(packet.Bytes()) + buf := bytes.NewReader(packet.Buffer) binary.Read(buf, binary.BigEndian, &rmiRecv.streamMessage) binary.Read(buf, binary.BigEndian, &rmiRecv.packetLen) diff --git a/smb/smb.go b/smb/smb.go index 89af75a..152cb7b 100644 --- a/smb/smb.go +++ b/smb/smb.go @@ -83,7 +83,7 @@ func (t *SMBMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) er } reader := new(bytes.Buffer) - reader.Write(packet.Bytes()) + reader.Write(packet.Buffer) s := smb{} if err := binary.Read(reader, binary.BigEndian, &s); err != nil { diff --git a/snmp/v2/snmpv2.go b/snmp/v2/snmpv2.go index 5aecd18..01be818 100644 --- a/snmp/v2/snmpv2.go +++ b/snmp/v2/snmpv2.go @@ -81,7 +81,7 @@ func (s *SNMPMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) e } `asn1:"tag:2"` } - if _, err := asn1.Unmarshal(packet.Bytes(), &p); err != nil { + if _, err := asn1.Unmarshal(packet.Buffer, &p); err != nil { return err } diff --git a/sqlserver/sqlserver.go b/sqlserver/sqlserver.go index 98c323b..63e4469 100644 --- a/sqlserver/sqlserver.go +++ b/sqlserver/sqlserver.go @@ -102,7 +102,7 @@ func (t *SQLServerMatcher) Match(info osm.MatchInfo, index int, packet *osm.Pack } reader := new(bytes.Buffer) - reader.Write(packet.Bytes()) + reader.Write(packet.Buffer) m := mssqlResponse{} diff --git a/ssh/ssh.go b/ssh/ssh.go index 406ae4b..ea7054b 100644 --- a/ssh/ssh.go +++ b/ssh/ssh.go @@ -49,7 +49,7 @@ func (ssh *SSHMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) // SSH-protoversion-softwareversion SP comments CR LF // e.g. ) SSH-2.0-OpenSSH_7.5p1 Ubuntu-10ubuntu0.1\n - scanner := bufio.NewScanner(bytes.NewReader(packet.Bytes())) + scanner := bufio.NewScanner(bytes.NewReader(packet.Buffer)) for scanner.Scan() { exchange := scanner.Text() diff --git a/wmi/wmi.go b/wmi/wmi.go index 72edd92..a39a7ed 100644 --- a/wmi/wmi.go +++ b/wmi/wmi.go @@ -53,7 +53,7 @@ func (w *WMIMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) er } buf := new(bytes.Buffer) - buf.Write(packet.Bytes()) + buf.Write(packet.Buffer) wmiRecv := DCERPC_DEFAULT{}