34 lines
654 B
Go
34 lines
654 B
Go
package ssh
|
|
|
|
//import (
|
|
// "fmt"
|
|
// "loafle.com/overflow/collector/core/scan/service/matcher/packet"
|
|
// "loafle.com/overflow/collector/discovery/types"
|
|
// "net"
|
|
// "testing"
|
|
//)
|
|
//
|
|
//func TestSSHMatcher_Match(t *testing.T) {
|
|
//
|
|
// port := types.NewPort("22", types.NewHost("192.168.1.103"), types.TYPE_TCP)
|
|
// ssh := NewSSHMatcher()
|
|
//
|
|
// var ipport string
|
|
// ipport = port.Host.Ip + ":" + string(port.Port)
|
|
//
|
|
// client, _ := net.Dial("tcp", ipport)
|
|
//
|
|
// defer client.Close()
|
|
//
|
|
// bytes := make([]byte, 512)
|
|
//
|
|
// l, _ := client.Read(bytes)
|
|
//
|
|
// fmt.Println(bytes)
|
|
//
|
|
// b := ssh.Match(0, packet.NewPacket(bytes, l), nil)
|
|
//
|
|
// fmt.Println(b)
|
|
//
|
|
//}
|