File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -27,4 +27,36 @@ func TestRun(t *testing.T) {
27
27
t .Fatalf ("%s considered suspiscious by %d info checkers" , test .ip , got )
28
28
}
29
29
}
30
+
31
+ // checkers can tell you wether the IP address is suspicious.
32
+ checkers := []Checker {
33
+ & AbuseIPDB {},
34
+ & CINSArmy {},
35
+ & ET {},
36
+ & OTX {},
37
+ & IPsum {},
38
+ & Shodan {},
39
+ & ThreatCrowd {},
40
+ & VirusTotal {},
41
+ }
42
+
43
+ checkers = append (checkers , infoCheckers ... )
44
+
45
+ tests = []struct {
46
+ ip string
47
+ suspicious int
48
+ }{
49
+ {"1.1.1.1" , 1 },
50
+ {"1.1.1.2" , 0 },
51
+ {"8.8.8.8" , 0 },
52
+ {"8.8.4.4" , 2 },
53
+ }
54
+
55
+ for _ , test := range tests {
56
+ ipaddr := net .ParseIP (test .ip )
57
+ got := Run (checkers , ipaddr )
58
+ if got != test .suspicious {
59
+ t .Fatalf ("%s considered suspiscious by %d info checkers" , test .ip , got )
60
+ }
61
+ }
30
62
}
You can’t perform that action at this time.
0 commit comments