cassandra matcher

This commit is contained in:
insanity@loafle.com 2017-08-09 17:48:31 +09:00
parent 4913cff255
commit ddf3defbce
3 changed files with 16 additions and 15 deletions

View File

@ -92,13 +92,13 @@ func (t *CassandraMatcher) Match(index int, packet *packet.Packet, info scaninfo
}
var itemcount uint16
if binary.Read(reader, binary.BigEndian, &itemcount) != nil {
return false
}
if itemcount != 0 && itemcount != 2 {
return false
}
//if binary.Read(reader, binary.BigEndian, &itemcount) != nil {
// return false
//}
//
//if itemcount != 0 && itemcount != 2 {
// return false
//}
return true

View File

@ -11,7 +11,7 @@ func TestCassandra(t *testing.T) {
m := NewCassandraMatcher()
conn, err := net.Dial("tcp", "192.168.1.16:19041")
conn, err := net.Dial("tcp", "192.168.1.16:19042")
if err != nil {
t.Error(err)
return

View File

@ -1,5 +1,6 @@
package dhcp
import (
"bytes"
"encoding/binary"
@ -76,13 +77,13 @@ func sendDHCPDiscovery() error {
var flag uint16 = 0
dhcp.BootpFlags = ^flag // flag = unicast , ^flag = broadcast
//TODO : getting mac addr from zone !!FIXME
dhcp.ClientMacAddr[0] = 0x50
dhcp.ClientMacAddr[1] = 0xe5
dhcp.ClientMacAddr[2] = 0x49
dhcp.ClientMacAddr[3] = 0x46
dhcp.ClientMacAddr[4] = 0x93
dhcp.ClientMacAddr[5] = 0x28
//TODO : getting mac addr from zone
//dhcp.ClientMacAddr[0] = 0x50
//dhcp.ClientMacAddr[1] = 0xe5
//dhcp.ClientMacAddr[2] = 0x49
//dhcp.ClientMacAddr[3] = 0x46
//dhcp.ClientMacAddr[4] = 0x93
//dhcp.ClientMacAddr[5] = 0x28
writer := new(bytes.Buffer)
binary.Write(writer, binary.BigEndian, dhcp)