overflow_discovery/service/matcher/telnet/telnet_test.go
crusader 46be2aa395 ing
2017-11-21 21:52:45 +09:00

34 lines
618 B
Go

package telnet
import (
"fmt"
"git.loafle.net/overflow/overflow_discovery/service/matcher"
"net"
"testing"
)
func TestTelnetMatcher_Match(t *testing.T) {
//port := types.NewPort("23", types.NewHost("192.168.1.210"), types.TYPE_TCP)
//telnet := NewTelnetMatcher()
//
//var ipport string
//ipport = port.Host.Ip + ":" + string(port.Port)
client, _ := net.Dial("tcp", "192.168.1.105:23")
defer client.Close()
bytes := make([]byte, 512)
l, _ := client.Read(bytes)
fmt.Println("length :", l)
fmt.Println(bytes)
b := NewTelnetMatcher().Match(0, matcher.NewPacket(bytes, l), nil)
fmt.Println(b)
}