fixed test
This commit is contained in:
@@ -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)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user