ing
This commit is contained in:
parent
6ce87348ba
commit
704ba5cc5d
|
@ -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{}
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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{}
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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{}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user