github.com/HXSecurity/DongTai-agent-go@v0.4.2/core/http/httpHeaderGet/install.go (about) 1 package httpHeaderGet 2 3 import ( 4 "fmt" 5 "github.com/HXSecurity/DongTai-agent-go/model" 6 "github.com/brahma-adshonor/gohook" 7 "net/http" 8 ) 9 10 func init() { 11 model.HookMap["httpHeaderGet"] = new(HttpHeaderGet) 12 } 13 14 type HttpHeaderGet struct { 15 } 16 17 func (h *HttpHeaderGet) Hook() { 18 var header http.Header 19 err := gohook.HookMethod(header, "Get", Get, GetT) 20 if err != nil { 21 fmt.Println(err, "HttpHeaderGet") 22 } else { 23 fmt.Println("HttpHeaderGet") 24 } 25 } 26 27 func (h *HttpHeaderGet) UnHook() { 28 var header *http.Header 29 gohook.UnHookMethod(header, "Get") 30 }