38 lines
619 B
Go
38 lines
619 B
Go
package smb
|
|
|
|
//import (
|
|
// "loafle.com/overflow/collector/core/scan/service/matcher/packet"
|
|
// "net"
|
|
// "testing"
|
|
//)
|
|
//
|
|
//const (
|
|
// ADDR string = "192.168.1.104:139"
|
|
//)
|
|
//
|
|
//func TestSMBMatcher(t *testing.T) {
|
|
//
|
|
// m := NewSMBMatcher()
|
|
//
|
|
// conn, _ := net.Dial("tcp", ADDR)
|
|
// defer conn.Close()
|
|
//
|
|
// for i := 0; i < m.PacketCount(); i++ {
|
|
//
|
|
// pack := m.Packet(i)
|
|
// conn.Write(pack.Buffer)
|
|
// bytes := make([]byte, 1024)
|
|
// n, _ := conn.Read(bytes)
|
|
//
|
|
// p := packet.NewPacket(bytes, n)
|
|
//
|
|
// if m.Match(i, p, nil) {
|
|
// t.Log("SMB found.")
|
|
// return
|
|
// }
|
|
//
|
|
// t.Error("SMB not found")
|
|
// }
|
|
//
|
|
//}
|