forked from tomatome/grdp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grdp_test.go
47 lines (44 loc) · 875 Bytes
/
grdp_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"fmt"
"github.com/Rak00n/grdp/glog"
"testing"
)
func testrdp(target string) {
domain := ""
username := "administrator"
password := "930517"
//target = "180.102.17.30:3389"
var err error
g := NewClient(target, glog.NONE)
//SSL协议登录测试
err = g.LoginForSSL(domain, username, password)
if err == nil {
fmt.Println("Login Success")
return
}
if err.Error() != "PROTOCOL_RDP" {
fmt.Println("Login Error:", err)
return
}
//RDP协议登录测试
err = g.LoginForRDP(domain, username, password)
if err == nil {
fmt.Println("Login Success")
return
} else {
fmt.Println("Login Error:", err)
return
}
}
func TestName(t *testing.T) {
targetArr := []string{
//"50.57.49.172:3389",
//"20.49.22.250:3389",
"192.168.248.199:3389",
}
for _, target := range targetArr {
fmt.Println(target)
testrdp(target)
}
}