35 lines
586 B
Go
35 lines
586 B
Go
package netbios
|
|
|
|
//
|
|
//import (
|
|
// "loafle.com/overflow/collector/core/scan/service/matcher/packet"
|
|
// "net"
|
|
// "testing"
|
|
//)
|
|
//
|
|
//func TestNBSS(t *testing.T) {
|
|
//
|
|
// m := NewNetBiosMatcher()
|
|
//
|
|
// conn, _ := net.Dial("tcp", "192.168.1.106:139")
|
|
//
|
|
// 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("NBSS found")
|
|
// return
|
|
// }
|
|
//
|
|
// t.Error("NBSS not found")
|
|
// }
|
|
//
|
|
//}
|