-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvulncheck.go
49 lines (40 loc) · 849 Bytes
/
vulncheck.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
48
49
package main
import "strings"
import "fmt"
type VCheck struct {
url string
post string
oldparam string
normal int
test int
R *Requests
}
type Result struct {
words int
normal bool
}
func NewVCheck() *VCheck {
vc := new(VCheck)
vc.R = NewRequests()
return vc
}
func (v *VCheck) c(newparam string) *Result {
var url string = ""
var post string = ""
var w int
url = strings.Replace(v.url, v.oldparam, newparam, -1)
post = strings.Replace(v.post, v.oldparam, newparam, -1)
html, code, _ := v.R.GetOrPost(url, post)
v.R.QuitOnFail(code, "Can't connect")
w = len(strings.Split(html, " "))
if w == v.normal {
if *verbose {
fmt.Printf("[+] %s\n", newparam)
}
return &Result{normal: true, words: w}
}
if *verbose {
fmt.Printf("[-] %s\n", newparam)
}
return &Result{normal: true, words: w}
}