glide error

This commit is contained in:
geek
2017-08-07 14:31:08 +09:00
parent f5dffb050d
commit 464eeb2094
37 changed files with 2970 additions and 2965 deletions

View File

@@ -1,17 +1,21 @@
package activedirectory_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//import (
// "encoding/json"
// "github.com/stretchr/testify/assert"
@@ -65,45 +69,45 @@ func setConfig() crawler.Crawler {
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("ad", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("ad", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "ad",
Id: "ad",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("ad", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("ad", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "ad",
// Id: "ad",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}

View File

@@ -1,104 +1,104 @@
package cassandra_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewCassandraHealthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.104"
m["port"] = "9042"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("ad", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("ad", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("ad", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "ad",
Id: "ad",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "git.loafle.net/overflow/of_rpc/json/client"
// "git.loafle.net/overflow/of_rpc/models/param"
// "git.loafle.net/overflow/of_rpc/models/protocol"
// "log"
// "testing"
// "time"
//)
//
//func TestCheck(t *testing.T) {
// b, _ := check("192.168.1.104", 9042, true)
// assert.Equal(t, true, b)
//func setConfig() crawler.Crawler {
//
// r := NewCassandraHealthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.104"
// m["port"] = "9042"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("ad", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("ad", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("ad", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
//
// go start()
// time.Sleep(time.Second * 2)
// time.Sleep(2 * time.Second)
//
// p := protocol.HealthRequest{IsSSL: true}
// b, _ := json.Marshal(p)
// in := param.Input{
// Name: "ad",
// Id: "ad",
// }
//
// in := param.Input{Ip: "192.168.1.104", Port: 9042, Data: b}
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// re, _ := client.InvokeJSONRPC("50000", in)
// var m protocol.HeahthResponse
// json.Unmarshal(re.Data, &m)
// if err != nil {
// t.Fatal(err)
// }
//
// assert.Equal(t, true, m.IsMatch)
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////import (
//// "encoding/json"
//// "github.com/stretchr/testify/assert"
//// "git.loafle.net/overflow/of_rpc/json/client"
//// "git.loafle.net/overflow/of_rpc/models/param"
//// "git.loafle.net/overflow/of_rpc/models/protocol"
//// "testing"
//// "time"
////)
////
////func TestCheck(t *testing.T) {
//// b, _ := check("192.168.1.104", 9042, true)
//// assert.Equal(t, true, b)
////}
////
////func TestRPC(t *testing.T) {
////
//// go start()
//// time.Sleep(time.Second * 2)
////
//// p := protocol.HealthRequest{IsSSL: true}
//// b, _ := json.Marshal(p)
////
//// in := param.Input{Ip: "192.168.1.104", Port: 9042, Data: b}
////
//// re, _ := client.InvokeJSONRPC("50000", in)
//// var m protocol.HeahthResponse
//// json.Unmarshal(re.Data, &m)
////
//// assert.Equal(t, true, m.IsMatch)
////}

View File

@@ -1,104 +1,104 @@
package dns_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewDNSHealthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.215"
m["port"] = "53"
m["portType"] = "udp"
m["ssl"] = false
r.PutConfig("ad", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("ad", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("ad", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "ad",
Id: "ad",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "git.loafle.net/overflow/of_rpc/json/client"
// "git.loafle.net/overflow/of_rpc/models/param"
// "git.loafle.net/overflow/of_rpc/models/protocol"
// "log"
// "testing"
// "time"
//)
//
//func TestCheck(t *testing.T) {
// b, _ := check("192.168.1.215", 53, false)
// assert.Equal(t, true, b)
//func setConfig() crawler.Crawler {
//
// r := NewDNSHealthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.215"
// m["port"] = "53"
// m["portType"] = "udp"
// m["ssl"] = false
//
// r.PutConfig("ad", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("ad", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("ad", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
//
// go start()
// time.Sleep(time.Second * 2)
// time.Sleep(2 * time.Second)
//
// p := protocol.HealthRequest{IsSSL: false}
// b, _ := json.Marshal(p)
// in := param.Input{
// Name: "ad",
// Id: "ad",
// }
//
// in := param.Input{Ip: "192.168.1.215", Port: 53, Data: b}
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// re, _ := client.InvokeJSONRPC("50000", in)
// var m protocol.HealthResponse
// json.Unmarshal(re.Data, &m)
// if err != nil {
// t.Fatal(err)
// }
//
// assert.Equal(t, true, m.IsMatch)
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////import (
//// "encoding/json"
//// "github.com/stretchr/testify/assert"
//// "git.loafle.net/overflow/of_rpc/json/client"
//// "git.loafle.net/overflow/of_rpc/models/param"
//// "git.loafle.net/overflow/of_rpc/models/protocol"
//// "testing"
//// "time"
////)
////
////func TestCheck(t *testing.T) {
//// b, _ := check("192.168.1.215", 53, false)
//// assert.Equal(t, true, b)
////}
////
////func TestRPC(t *testing.T) {
////
//// go start()
//// time.Sleep(time.Second * 2)
////
//// p := protocol.HealthRequest{IsSSL: false}
//// b, _ := json.Marshal(p)
////
//// in := param.Input{Ip: "192.168.1.215", Port: 53, Data: b}
////
//// re, _ := client.InvokeJSONRPC("50000", in)
//// var m protocol.HealthResponse
//// json.Unmarshal(re.Data, &m)
////
//// assert.Equal(t, true, m.IsMatch)
////}

View File

@@ -1,93 +1,93 @@
package ftp_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewFTPHealthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.215"
m["port"] = "21"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("ftp", m)
return r
}
func TestMatch(t *testing.T) {
r := setConfig()
out := param.Output{}
r.Get("ftp", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("ftp", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "ftp",
Id: "ftp",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//
//func TestCheck(t *testing.T) {
// b, _ := check("192.168.1.215", 21, false)
// assert.Equal(t, true, b)
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func setConfig() crawler.Crawler {
// r := NewFTPHealthCrawler()
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.215"
// m["port"] = "21"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("ftp", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// r := setConfig()
//
// out := param.Output{}
// r.Get("ftp", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("ftp", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
//
// go start()
// time.Sleep(time.Second * 2)
// time.Sleep(2 * time.Second)
//
// p := protocol.HealthRequest{IsSSL: false}
// b, _ := json.Marshal(p)
// in := param.Input{
// Name: "ftp",
// Id: "ftp",
// }
//
// in := param.Input{Ip: "192.168.1.215", Port: 21, Data: b}
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// re, _ := client.InvokeJSONRPC("50000", in)
// var m protocol.HealthResponse
// json.Unmarshal(re.Data, &m)
// if err != nil {
// t.Fatal(err)
// }
//
// assert.Equal(t, true, m.IsMatch)
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////
////func TestCheck(t *testing.T) {
//// b, _ := check("192.168.1.215", 21, false)
//// assert.Equal(t, true, b)
////}
////
////
////func TestRPC(t *testing.T) {
////
//// go start()
//// time.Sleep(time.Second * 2)
////
//// p := protocol.HealthRequest{IsSSL: false}
//// b, _ := json.Marshal(p)
////
//// in := param.Input{Ip: "192.168.1.215", Port: 21, Data: b}
////
//// re, _ := client.InvokeJSONRPC("50000", in)
//// var m protocol.HealthResponse
//// json.Unmarshal(re.Data, &m)
////
//// assert.Equal(t, true, m.IsMatch)
////}

View File

@@ -1,87 +1,87 @@
package ftps_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewFTPSHealthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.103"
m["port"] = "2121"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("ftps", m)
return r
}
func TestMatch(t *testing.T) {
r := setConfig()
out := param.Output{}
r.Get("ftps", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("ftps", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "ftps",
Id: "ftps",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func setConfig() crawler.Crawler {
// r := NewFTPSHealthCrawler()
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.103"
// m["port"] = "2121"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("ftps", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// r := setConfig()
//
// out := param.Output{}
// r.Get("ftps", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("ftps", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
//
// go start()
// time.Sleep(time.Second * 2)
// time.Sleep(2 * time.Second)
//
// p := protocol.HealthRequest{IsSSL: false}
// b, _ := json.Marshal(p)
// in := param.Input{
// Name: "ftps",
// Id: "ftps",
// }
//
// in := param.Input{Ip: "192.168.1.215", Port: 21, Data: b}
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// re, _ := client.InvokeJSONRPC("50000", in)
// var m protocol.HealthResponse
// json.Unmarshal(re.Data, &m)
// if err != nil {
// t.Fatal(err)
// }
//
// assert.Equal(t, false, m.IsMatch)
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////
////func TestRPC(t *testing.T) {
////
//// go start()
//// time.Sleep(time.Second * 2)
////
//// p := protocol.HealthRequest{IsSSL: false}
//// b, _ := json.Marshal(p)
////
//// in := param.Input{Ip: "192.168.1.215", Port: 21, Data: b}
////
//// re, _ := client.InvokeJSONRPC("50000", in)
//// var m protocol.HealthResponse
//// json.Unmarshal(re.Data, &m)
////
//// assert.Equal(t, false, m.IsMatch)
////}

View File

@@ -1,87 +1,87 @@
package http_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewHTTPHealthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.105"
m["port"] = "80"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("ad", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("ad", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("ad", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "ad",
Id: "ad",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//package main
//
//import (
// "testing"
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func TestHttpProtocol_Get(t *testing.T) {
// b, err := check("192.168.1.105", 80)
// if err != nil {
// t.Error(err)
// }
// assert.Equal(t, true, b)
//func setConfig() crawler.Crawler {
//
// r := NewHTTPHealthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.105"
// m["port"] = "80"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("ad", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("ad", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("ad", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "ad",
// Id: "ad",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////package main
////
////import (
//// "testing"
//// "github.com/stretchr/testify/assert"
////)
////
////func TestHttpProtocol_Get(t *testing.T) {
//// b, err := check("192.168.1.105", 80)
//// if err != nil {
//// t.Error(err)
//// }
//// assert.Equal(t, true, b)
////}

View File

@@ -1,75 +1,75 @@
package imap_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewIMAPHealthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.215"
m["port"] = "993"
m["portType"] = "tcp"
m["ssl"] = true
r.PutConfig("ad", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("ad", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("ad", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "ad",
Id: "ad",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func setConfig() crawler.Crawler {
//
// r := NewIMAPHealthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.215"
// m["port"] = "993"
// m["portType"] = "tcp"
// m["ssl"] = true
//
// r.PutConfig("ad", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("ad", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("ad", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "ad",
// Id: "ad",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
//import (

View File

@@ -1,75 +1,75 @@
package ldap_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewLDAPHealthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.215"
m["port"] = "389"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("ad", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("ad", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("ad", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "ad",
Id: "ad",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func setConfig() crawler.Crawler {
//
// r := NewLDAPHealthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.215"
// m["port"] = "389"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("ad", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("ad", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("ad", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "ad",
// Id: "ad",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
//import (

View File

@@ -1,105 +1,105 @@
package mongodb_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewMongoDBHealthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.104"
m["port"] = "27017"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("ad", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("ad", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("ad", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "ad",
Id: "ad",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "git.loafle.net/overflow/of_rpc/json/client"
// "git.loafle.net/overflow/of_rpc/models/param"
// "git.loafle.net/overflow/of_rpc/models/protocol"
// "log"
// "testing"
// "time"
//)
//
//func TestCheck(t *testing.T) {
// b, _ := check("192.168.1.104", 27017, true)
// assert.Equal(t, true, b)
//func setConfig() crawler.Crawler {
//
// r := NewMongoDBHealthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.104"
// m["port"] = "27017"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("ad", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("ad", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("ad", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
//
// go start()
// time.Sleep(time.Second * 2)
// time.Sleep(2 * time.Second)
//
// p := protocol.HealthRequest{IsSSL: true}
// b, _ := json.Marshal(p)
// in := param.Input{
// Name: "ad",
// Id: "ad",
// }
//
// in := param.Input{Ip: "192.168.1.104", Port: 27017, Data: b}
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// re, _ := client.InvokeJSONRPC("50000", in)
// var m protocol.HealthResponse
// json.Unmarshal(re.Data, &m)
// if err != nil {
// t.Fatal(err)
// }
//
// assert.Equal(t, true, m.IsMatch)
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////
////import (
//// "encoding/json"
//// "github.com/stretchr/testify/assert"
//// "git.loafle.net/overflow/of_rpc/json/client"
//// "git.loafle.net/overflow/of_rpc/models/param"
//// "git.loafle.net/overflow/of_rpc/models/protocol"
//// "testing"
//// "time"
////)
////
////func TestCheck(t *testing.T) {
//// b, _ := check("192.168.1.104", 27017, true)
//// assert.Equal(t, true, b)
////}
////
////func TestRPC(t *testing.T) {
////
//// go start()
//// time.Sleep(time.Second * 2)
////
//// p := protocol.HealthRequest{IsSSL: true}
//// b, _ := json.Marshal(p)
////
//// in := param.Input{Ip: "192.168.1.104", Port: 27017, Data: b}
////
//// re, _ := client.InvokeJSONRPC("50000", in)
//// var m protocol.HealthResponse
//// json.Unmarshal(re.Data, &m)
////
//// assert.Equal(t, true, m.IsMatch)
////}

View File

@@ -1,86 +1,86 @@
package mssql_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewMSSqlHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.106"
m["port"] = "1433"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//
//import (
// "testing"
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func TestMatch(t *testing.T) {
// b, err := check("192.168.1.106", 1433)
// if err != nil {
// t.Error(err)
// }
// assert.Equal(t, true, b)
//func setConfig() crawler.Crawler {
//
// r := NewMSSqlHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.106"
// m["port"] = "1433"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////
////import (
//// "testing"
//// "github.com/stretchr/testify/assert"
////)
////
////func TestMatch(t *testing.T) {
//// b, err := check("192.168.1.106", 1433)
//// if err != nil {
//// t.Error(err)
//// }
//// assert.Equal(t, true, b)
////}

View File

@@ -1,86 +1,86 @@
package mysql_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewMysqlHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.103"
m["port"] = "3306"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("redis", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("redis", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("redis", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "redis",
Id: "redis",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func TestMatch(t *testing.T) {
// b, err := check("192.168.1.103", 3306)
// if err != nil {
// t.Error(err)
// }
// assert.Equal(t, true, b)
//func setConfig() crawler.Crawler {
//
// r := NewMysqlHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.103"
// m["port"] = "3306"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("redis", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("redis", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("redis", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "redis",
// Id: "redis",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////
////import (
//// "github.com/stretchr/testify/assert"
//// "testing"
////)
////
////func TestMatch(t *testing.T) {
//// b, err := check("192.168.1.103", 3306)
//// if err != nil {
//// t.Error(err)
//// }
//// assert.Equal(t, true, b)
////}

View File

@@ -1,105 +1,105 @@
package netbios_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewNetbiosHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.106"
m["port"] = "139"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "git.loafle.net/overflow/of_rpc/json/client"
// "git.loafle.net/overflow/of_rpc/models/param"
// "git.loafle.net/overflow/of_rpc/models/protocol"
// "log"
// "testing"
// "time"
//)
//
//func TestCheck(t *testing.T) {
// b, _ := check("192.168.1.106", 139, false)
// assert.Equal(t, true, b)
//func setConfig() crawler.Crawler {
//
// r := NewNetbiosHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.106"
// m["port"] = "139"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
//
// go start()
// time.Sleep(time.Second * 2)
// time.Sleep(2 * time.Second)
//
// p := protocol.HealthRequest{IsSSL: false}
// b, _ := json.Marshal(p)
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// in := param.Input{Ip: "192.168.1.106", Port: 139, Data: b}
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// re, _ := client.InvokeJSONRPC("50000", in)
// var m protocol.HealthResponse
// json.Unmarshal(re.Data, &m)
// if err != nil {
// t.Fatal(err)
// }
//
// assert.Equal(t, true, m.IsMatch)
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////
////import (
//// "encoding/json"
//// "github.com/stretchr/testify/assert"
//// "git.loafle.net/overflow/of_rpc/json/client"
//// "git.loafle.net/overflow/of_rpc/models/param"
//// "git.loafle.net/overflow/of_rpc/models/protocol"
//// "testing"
//// "time"
////)
////
////func TestCheck(t *testing.T) {
//// b, _ := check("192.168.1.106", 139, false)
//// assert.Equal(t, true, b)
////}
////
////func TestRPC(t *testing.T) {
////
//// go start()
//// time.Sleep(time.Second * 2)
////
//// p := protocol.HealthRequest{IsSSL: false}
//// b, _ := json.Marshal(p)
////
//// in := param.Input{Ip: "192.168.1.106", Port: 139, Data: b}
////
//// re, _ := client.InvokeJSONRPC("50000", in)
//// var m protocol.HealthResponse
//// json.Unmarshal(re.Data, &m)
////
//// assert.Equal(t, true, m.IsMatch)
////}

View File

@@ -1,127 +1,127 @@
package oracle_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewOracleHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.30"
m["port"] = "1521"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//
//import (
// "testing"
// "github.com/stretchr/testify/assert"
//)
//
//func TestMatch(t *testing.T) {
// b, err := check("192.168.1.106", 1433)
// if err != nil {
// t.Error(err)
// }
// assert.Equal(t, true, b)
//}
//package oracle_protocol_crawler
//
//
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "git.loafle.net/overflow/of_rpc/json/client"
// "git.loafle.net/overflow/of_rpc/models/param"
// "git.loafle.net/overflow/of_rpc/models/protocol"
// "log"
// "testing"
// "time"
//)
//
//func TestCheck(t *testing.T) {
// b, _ := check("192.168.1.30", 1521, false)
// assert.Equal(t, true, b)
//func setConfig() crawler.Crawler {
//
// r := NewOracleHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.30"
// m["port"] = "1521"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestCheckTls(t *testing.T) {
// b, _ := check("192.168.1.215", 22, true)
// assert.Equal(t, true, b)
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
//
// go start()
// time.Sleep(time.Second * 2)
// time.Sleep(2 * time.Second)
//
// p := protocol.HealthRequest{IsSSL: false}
// b, _ := json.Marshal(p)
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// in := param.Input{Ip: "192.168.1.30", Port: 1521, Data: b}
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// re, _ := client.InvokeJSONRPC("50000", in)
// var m protocol.HealthResponse
// json.Unmarshal(re.Data, &m)
// if err != nil {
// t.Fatal(err)
// }
//
// assert.Equal(t, true, m.IsMatch)
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////
////import (
//// "testing"
//// "github.com/stretchr/testify/assert"
////)
////
////func TestMatch(t *testing.T) {
//// b, err := check("192.168.1.106", 1433)
//// if err != nil {
//// t.Error(err)
//// }
//// assert.Equal(t, true, b)
////}
//
////package oracle_protocol_crawler
////
////
////import (
//// "encoding/json"
//// "github.com/stretchr/testify/assert"
//// "git.loafle.net/overflow/of_rpc/json/client"
//// "git.loafle.net/overflow/of_rpc/models/param"
//// "git.loafle.net/overflow/of_rpc/models/protocol"
//// "testing"
//// "time"
////)
////
////func TestCheck(t *testing.T) {
//// b, _ := check("192.168.1.30", 1521, false)
//// assert.Equal(t, true, b)
////}
////
////func TestCheckTls(t *testing.T) {
//// b, _ := check("192.168.1.215", 22, true)
//// assert.Equal(t, true, b)
////}
////
////
////func TestRPC(t *testing.T) {
////
//// go start()
//// time.Sleep(time.Second * 2)
////
//// p := protocol.HealthRequest{IsSSL: false}
//// b, _ := json.Marshal(p)
////
//// in := param.Input{Ip: "192.168.1.30", Port: 1521, Data: b}
////
//// re, _ := client.InvokeJSONRPC("50000", in)
//// var m protocol.HealthResponse
//// json.Unmarshal(re.Data, &m)
////
//// assert.Equal(t, true, m.IsMatch)
////}

View File

@@ -1,86 +1,86 @@
package pgsql_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewPGSqlHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.107"
m["port"] = "5432"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//
//import (
// "testing"
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func TestMatch(t *testing.T) {
// b, err := check("192.168.1.106", 1433)
// if err != nil {
// t.Error(err)
// }
// assert.Equal(t, true, b)
//func setConfig() crawler.Crawler {
//
// r := NewPGSqlHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.107"
// m["port"] = "5432"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////
////import (
//// "testing"
//// "github.com/stretchr/testify/assert"
////)
////
////func TestMatch(t *testing.T) {
//// b, err := check("192.168.1.106", 1433)
//// if err != nil {
//// t.Error(err)
//// }
//// assert.Equal(t, true, b)
////}

View File

@@ -1,111 +1,111 @@
package pop3_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewPOP3HeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.215"
m["port"] = "110"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//package pop3
//
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "git.loafle.net/overflow/of_rpc/json/client"
// "git.loafle.net/overflow/of_rpc/models/param"
// "git.loafle.net/overflow/of_rpc/models/protocol"
// "log"
// "testing"
// "time"
//)
//
//func TestCheck(t *testing.T) {
// b, _ := check("192.168.1.215", 110, false)
// assert.Equal(t, true, b)
//func setConfig() crawler.Crawler {
//
// r := NewPOP3HeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.215"
// m["port"] = "110"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestCheckSSL(t *testing.T) {
// b, _ := check("192.168.1.215", 995, true)
// assert.Equal(t, true, b)
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
//
// go start()
// time.Sleep(time.Second * 2)
// time.Sleep(2 * time.Second)
//
// p := protocol.HealthRequest{IsSSL: false}
// b, _ := json.Marshal(p)
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// in := param.Input{Ip: "192.168.1.215", Port: 143, Data: b}
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// re, _ := client.InvokeJSONRPC("50000", in)
// var m protocol.HealthResponse
// json.Unmarshal(re.Data, &m)
// if err != nil {
// t.Fatal(err)
// }
//
// assert.Equal(t, true, m.IsMatch)
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////package pop3
////
////import (
//// "encoding/json"
//// "github.com/stretchr/testify/assert"
//// "git.loafle.net/overflow/of_rpc/json/client"
//// "git.loafle.net/overflow/of_rpc/models/param"
//// "git.loafle.net/overflow/of_rpc/models/protocol"
//// "testing"
//// "time"
////)
////
////func TestCheck(t *testing.T) {
//// b, _ := check("192.168.1.215", 110, false)
//// assert.Equal(t, true, b)
////}
////
////func TestCheckSSL(t *testing.T) {
//// b, _ := check("192.168.1.215", 995, true)
//// assert.Equal(t, true, b)
////}
////
////func TestRPC(t *testing.T) {
////
//// go start()
//// time.Sleep(time.Second * 2)
////
//// p := protocol.HealthRequest{IsSSL: false}
//// b, _ := json.Marshal(p)
////
//// in := param.Input{Ip: "192.168.1.215", Port: 143, Data: b}
////
//// re, _ := client.InvokeJSONRPC("50000", in)
//// var m protocol.HealthResponse
//// json.Unmarshal(re.Data, &m)
////
//// assert.Equal(t, true, m.IsMatch)
////}

View File

@@ -1,41 +1,41 @@
package redis_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/overflow_probe/crawler"
"git.loafle.net/overflow/overflow_probe/crawler/config"
"github.com/stretchr/testify/assert"
"testing"
)
func setConfig() crawler.Crawler {
r := NewRedisHeahthCrawler()
m := config.Config{}
m.Target = config.Target{}
m.Target.Connection = config.Connection{}
m.Target.Connection.Ip = "192.168.1.104"
m.Target.Connection.Port = "6379"
m.Target.Connection.PortType = "tcp"
m.Target.Connection.SSL = false
r.PutConfig("redis", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
b, _ := r.Get("redis")
var check bool
json.Unmarshal(b, &check)
assert.Equal(t, true, check)
}
//import (
// "encoding/json"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "git.loafle.net/overflow/overflow_probe/crawler/config"
// "github.com/stretchr/testify/assert"
// "testing"
//)
//
//func setConfig() crawler.Crawler {
//
// r := NewRedisHeahthCrawler()
//
// m := config.Config{}
// m.Target = config.Target{}
// m.Target.Connection = config.Connection{}
// m.Target.Connection.Ip = "192.168.1.104"
// m.Target.Connection.Port = "6379"
// m.Target.Connection.PortType = "tcp"
// m.Target.Connection.SSL = false
//
// r.PutConfig("redis", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// b, _ := r.Get("redis")
//
// var check bool
// json.Unmarshal(b, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {

View File

@@ -1,75 +1,75 @@
package rmi_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewRMIHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.103"
m["port"] = "9840"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func setConfig() crawler.Crawler {
//
// r := NewRMIHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.103"
// m["port"] = "9840"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//package imap
//

View File

@@ -1,75 +1,75 @@
package smb_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewSMBHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.106"
m["port"] = "445"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func setConfig() crawler.Crawler {
//
// r := NewSMBHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.106"
// m["port"] = "445"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//package smb_protocol_crawler
//

View File

@@ -1,111 +1,111 @@
package smtp_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewSMTPHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.215"
m["port"] = "25"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//package smtp
//
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "git.loafle.net/overflow/of_rpc/json/client"
// "git.loafle.net/overflow/of_rpc/models/param"
// "git.loafle.net/overflow/of_rpc/models/protocol"
// "log"
// "testing"
// "time"
//)
//
//func TestCheck(t *testing.T) {
// b, _ := check("192.168.1.215", 25, false)
// assert.Equal(t, true, b)
//func setConfig() crawler.Crawler {
//
// r := NewSMTPHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.215"
// m["port"] = "25"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestCheckSSL(t *testing.T) {
// b, _ := check("192.168.1.215", 465, true)
// assert.Equal(t, true, b)
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
//
// go start()
// time.Sleep(time.Second * 2)
// time.Sleep(2 * time.Second)
//
// p := protocol.HealthRequest{IsSSL: false}
// b, _ := json.Marshal(p)
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// in := param.Input{Ip: "192.168.1.215", Port: 25, Data: b}
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// re, _ := client.InvokeJSONRPC("50000", in)
// var m protocol.HealthResponse
// json.Unmarshal(re.Data, &m)
// if err != nil {
// t.Fatal(err)
// }
//
// assert.Equal(t, true, m.IsMatch)
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//
////package smtp
////
////import (
//// "encoding/json"
//// "github.com/stretchr/testify/assert"
//// "git.loafle.net/overflow/of_rpc/json/client"
//// "git.loafle.net/overflow/of_rpc/models/param"
//// "git.loafle.net/overflow/of_rpc/models/protocol"
//// "testing"
//// "time"
////)
////
////func TestCheck(t *testing.T) {
//// b, _ := check("192.168.1.215", 25, false)
//// assert.Equal(t, true, b)
////}
////
////func TestCheckSSL(t *testing.T) {
//// b, _ := check("192.168.1.215", 465, true)
//// assert.Equal(t, true, b)
////}
////
////func TestRPC(t *testing.T) {
////
//// go start()
//// time.Sleep(time.Second * 2)
////
//// p := protocol.HealthRequest{IsSSL: false}
//// b, _ := json.Marshal(p)
////
//// in := param.Input{Ip: "192.168.1.215", Port: 25, Data: b}
////
//// re, _ := client.InvokeJSONRPC("50000", in)
//// var m protocol.HealthResponse
//// json.Unmarshal(re.Data, &m)
////
//// assert.Equal(t, true, m.IsMatch)
////}

View File

@@ -1,75 +1,75 @@
package snmpv2c_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewSNMPV2CHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.215"
m["port"] = "161"
m["portType"] = "udp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func setConfig() crawler.Crawler {
//
// r := NewSNMPV2CHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.215"
// m["port"] = "161"
// m["portType"] = "udp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//package snmpv2c_protocol_crawler
//

View File

@@ -1,75 +1,75 @@
package snmpv3_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewSNMPV3HeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.254"
m["port"] = "161"
m["portType"] = "udp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func setConfig() crawler.Crawler {
//
// r := NewSNMPV3HeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.254"
// m["port"] = "161"
// m["portType"] = "udp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//package snmpv3_protocol_crawler
//

View File

@@ -1,75 +1,75 @@
package ssh_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewSSHHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.215"
m["port"] = "22"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func setConfig() crawler.Crawler {
//
// r := NewSSHHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.215"
// m["port"] = "22"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//package ssh_protocol_crawler
//

View File

@@ -1,75 +1,75 @@
package telnet_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewTelnetHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.215"
m["port"] = "23"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func setConfig() crawler.Crawler {
//
// r := NewTelnetHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.215"
// m["port"] = "23"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//package main
//

View File

@@ -1,75 +1,75 @@
package wmi_protocol_crawler
import (
"encoding/json"
"git.loafle.net/overflow/of_rpc_go"
"git.loafle.net/overflow/of_rpc_go/client"
"git.loafle.net/overflow/of_rpc_go/models/param"
"git.loafle.net/overflow/overflow_probe/crawler"
"github.com/stretchr/testify/assert"
"log"
"testing"
"time"
)
func setConfig() crawler.Crawler {
r := NewWMIHeahthCrawler()
m := make(map[string]interface{}, 0)
m["ip"] = "192.168.1.1"
m["port"] = "135"
m["portType"] = "tcp"
m["ssl"] = false
r.PutConfig("r", m)
return r
}
func TestMatch(t *testing.T) {
// test config
r := setConfig()
out := param.Output{}
r.Get("r", &out)
var check bool
json.Unmarshal(out.Data, &check)
assert.Equal(t, true, check)
}
func start() {
r := setConfig()
of_rpc.AddDelegate("r", r)
err := of_rpc.StartJSONRPC()
if err != nil {
log.Fatal(err)
}
}
func TestRPC(t *testing.T) {
go start()
time.Sleep(2 * time.Second)
in := param.Input{
Name: "r",
Id: "r",
}
result, err := client.InvokeJSONRPCGet("50000", in)
if err != nil {
t.Fatal(err)
}
var check bool
json.Unmarshal(result.Data, &check)
assert.Equal(t, true, check)
}
//import (
// "encoding/json"
// "git.loafle.net/overflow/of_rpc_go"
// "git.loafle.net/overflow/of_rpc_go/client"
// "git.loafle.net/overflow/of_rpc_go/models/param"
// "git.loafle.net/overflow/overflow_probe/crawler"
// "github.com/stretchr/testify/assert"
// "log"
// "testing"
// "time"
//)
//
//func setConfig() crawler.Crawler {
//
// r := NewWMIHeahthCrawler()
//
// m := make(map[string]interface{}, 0)
//
// m["ip"] = "192.168.1.1"
// m["port"] = "135"
// m["portType"] = "tcp"
// m["ssl"] = false
//
// r.PutConfig("r", m)
//
// return r
//}
//
//func TestMatch(t *testing.T) {
// // test config
// r := setConfig()
//
// out := param.Output{}
// r.Get("r", &out)
//
// var check bool
// json.Unmarshal(out.Data, &check)
//
// assert.Equal(t, true, check)
//}
//
//func start() {
// r := setConfig()
//
// of_rpc.AddDelegate("r", r)
// err := of_rpc.StartJSONRPC()
// if err != nil {
// log.Fatal(err)
// }
//}
//
//func TestRPC(t *testing.T) {
// go start()
// time.Sleep(2 * time.Second)
//
// in := param.Input{
// Name: "r",
// Id: "r",
// }
//
// result, err := client.InvokeJSONRPCGet("50000", in)
//
// if err != nil {
// t.Fatal(err)
// }
//
// var check bool
// json.Unmarshal(result.Data, &check)
// assert.Equal(t, true, check)
//}
//package wmi_protocol_crawler
//