fixed test

This commit is contained in:
snoop
2017-08-09 12:21:34 +09:00
parent ac55bd8435
commit e2c14584b6
12 changed files with 562 additions and 547 deletions

View File

@@ -1,33 +1,35 @@
package ssh
//import (
// "fmt"
// "git.loafle.net/overflow/overflow_probe/collector/core/scan/service/matcher/packet"
// "git.loafle.net/overflow/overflow_probe/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)
//
//}
import (
"fmt"
//"git.loafle.net/overflow/overflow_probe/matcher/ssh"
"git.loafle.net/overflow/overflow_probe/matcher/packet"
//"git.loafle.net/overflow/overflow_probe/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)
b := NewSSHMatcher().Match(0, packet.NewPacket(bytes, l), nil)
fmt.Println(b)
}