overflow_discovery/service/match/ssh/ssh_test.go

36 lines
707 B
Go
Raw Normal View History

2017-11-21 12:47:55 +00:00
package ssh
import (
"fmt"
//"git.loafle.net/overflow/overflow_discovery/match/ssh"
2017-11-21 12:52:45 +00:00
"git.loafle.net/overflow/overflow_discovery/service/matcher"
2017-11-21 12:47:55 +00:00
//"git.loafle.net/overflow/overflow_discovery/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", "192.168.1.10:22")
defer client.Close()
bytes := make([]byte, 512)
l, _ := client.Read(bytes)
fmt.Println(bytes)
2017-11-21 12:52:45 +00:00
b := NewSSHMatcher().Match(0, matcher.NewPacket(bytes, l), nil)
2017-11-21 12:47:55 +00:00
fmt.Println(b)
}