This commit is contained in:
crusader 2018-09-03 16:23:25 +09:00
parent 6ce87348ba
commit 704ba5cc5d
14 changed files with 14 additions and 14 deletions

View File

@ -200,7 +200,7 @@ func (m *ActiveDirectoryMatcher) Match(info osm.MatchInfo, index int, packet *os
} }
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
buf.Write(packet.Bytes()) buf.Write(packet.Buffer)
adRecv := AD_RECV{} adRecv := AD_RECV{}

View File

@ -50,7 +50,7 @@ func (m *CassandraMatcher) Match(info osm.MatchInfo, index int, packet *osm.Pack
} }
reader := new(bytes.Buffer) reader := new(bytes.Buffer)
reader.Write(packet.Bytes()) reader.Write(packet.Buffer)
c := cassandra{} c := cassandra{}
if err := binary.Read(reader, binary.BigEndian, &c); err != nil { if err := binary.Read(reader, binary.BigEndian, &c); err != nil {

View File

@ -71,7 +71,7 @@ func (t *DNSMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) er
} }
reader := new(bytes.Buffer) reader := new(bytes.Buffer)
reader.Write(packet.Bytes()) reader.Write(packet.Buffer)
h := Dns_frame_header{} h := Dns_frame_header{}
if err := binary.Read(reader, binary.BigEndian, &h); err != nil { if err := binary.Read(reader, binary.BigEndian, &h); err != nil {

View File

@ -43,7 +43,7 @@ func (l *LDAPMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) e
if packet == nil || !packet.Valid() { if packet == nil || !packet.Valid() {
return osm.NoPacketReceivedError() return osm.NoPacketReceivedError()
} }
p := ber.DecodePacket(packet.Bytes()) p := ber.DecodePacket(packet.Buffer)
if len(p.Children) <= 1 { if len(p.Children) <= 1 {
return osm.NotMatchedError() return osm.NotMatchedError()

View File

@ -82,7 +82,7 @@ func (m *MongoDBMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet
} }
reader := new(bytes.Buffer) reader := new(bytes.Buffer)
reader.Write(packet.Bytes()) reader.Write(packet.Buffer)
reply := OP_reply{} reply := OP_reply{}
if err := binary.Read(reader, binary.LittleEndian, &reply); err != nil { if err := binary.Read(reader, binary.LittleEndian, &reply); err != nil {

View File

@ -60,7 +60,7 @@ func (t *NBSSMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) e
} }
reader := new(bytes.Buffer) reader := new(bytes.Buffer)
reader.Write(packet.Bytes()) reader.Write(packet.Buffer)
n := NBSS{} n := NBSS{}
if err := binary.Read(reader, binary.LittleEndian, &n); err != nil { if err := binary.Read(reader, binary.LittleEndian, &n); err != nil {

View File

@ -44,7 +44,7 @@ func (o *OracleMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet)
refuse := body_refuse{} refuse := body_refuse{}
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
buf.Write(packet.Bytes()) buf.Write(packet.Buffer)
binary.Read(buf, binary.BigEndian, &header) binary.Read(buf, binary.BigEndian, &header)
binary.Read(buf, binary.BigEndian, &refuse) binary.Read(buf, binary.BigEndian, &refuse)

View File

@ -73,7 +73,7 @@ func (p *PostgreSQLMatcher) Match(info osm.MatchInfo, index int, packet *osm.Pac
} }
reader := new(bytes.Buffer) reader := new(bytes.Buffer)
reader.Write(packet.Bytes()) reader.Write(packet.Buffer)
pg := pgsqlErrResponse{} pg := pgsqlErrResponse{}
if err := binary.Read(reader, binary.BigEndian, &pg); err != nil { if err := binary.Read(reader, binary.BigEndian, &pg); err != nil {

View File

@ -63,7 +63,7 @@ func (r *RMIMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) er
rmiRecv := RMI_RECV_MESSAGE{} 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.streamMessage)
binary.Read(buf, binary.BigEndian, &rmiRecv.packetLen) binary.Read(buf, binary.BigEndian, &rmiRecv.packetLen)

View File

@ -83,7 +83,7 @@ func (t *SMBMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) er
} }
reader := new(bytes.Buffer) reader := new(bytes.Buffer)
reader.Write(packet.Bytes()) reader.Write(packet.Buffer)
s := smb{} s := smb{}
if err := binary.Read(reader, binary.BigEndian, &s); err != nil { if err := binary.Read(reader, binary.BigEndian, &s); err != nil {

View File

@ -81,7 +81,7 @@ func (s *SNMPMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) e
} `asn1:"tag:2"` } `asn1:"tag:2"`
} }
if _, err := asn1.Unmarshal(packet.Bytes(), &p); err != nil { if _, err := asn1.Unmarshal(packet.Buffer, &p); err != nil {
return err return err
} }

View File

@ -102,7 +102,7 @@ func (t *SQLServerMatcher) Match(info osm.MatchInfo, index int, packet *osm.Pack
} }
reader := new(bytes.Buffer) reader := new(bytes.Buffer)
reader.Write(packet.Bytes()) reader.Write(packet.Buffer)
m := mssqlResponse{} m := mssqlResponse{}

View File

@ -49,7 +49,7 @@ func (ssh *SSHMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet)
// SSH-protoversion-softwareversion SP comments CR LF // SSH-protoversion-softwareversion SP comments CR LF
// e.g. ) SSH-2.0-OpenSSH_7.5p1 Ubuntu-10ubuntu0.1\n // 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() { for scanner.Scan() {
exchange := scanner.Text() exchange := scanner.Text()

View File

@ -53,7 +53,7 @@ func (w *WMIMatcher) Match(info osm.MatchInfo, index int, packet *osm.Packet) er
} }
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
buf.Write(packet.Bytes()) buf.Write(packet.Buffer)
wmiRecv := DCERPC_DEFAULT{} wmiRecv := DCERPC_DEFAULT{}