尝试post请求的抓取

main
zhengbaoyang 8 years ago
parent 3d4555e1df
commit 1c14528edc
  1. 11
      dump.go
  2. 4
      mitm.go

@ -34,16 +34,9 @@ func httpDump(req *http.Request, resp *http.Response) {
} }
if req.Method == "POST" { if req.Method == "POST" {
fmt.Println(Green("URLEncoded form")) fmt.Println(Green("URLEncoded form"))
err := req.ParseForm()
fmt.Printf("%#v\n", req.Form)
fmt.Printf("%#v\n", req.PostForm)
if err != nil { for k, v := range req.Form {
logger.Println("parseForm error:", err) fmt.Printf("%s: %s\n", Blue(k), v)
} else {
for k, v := range req.Form {
fmt.Printf("%s: %s\n", Blue(k), v)
}
} }
} }

@ -179,7 +179,11 @@ func (hw *HandlerWrapper) DumpHTTPAndHTTPs(resp http.ResponseWriter, req *http.R
} }
func (hw *HandlerWrapper) ServeHTTP(resp http.ResponseWriter, req *http.Request) { func (hw *HandlerWrapper) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
err := req.ParseForm()
if err != nil {
logger.Println("parseForm error:", err)
}
raddr := *hw.MyConfig.Raddr raddr := *hw.MyConfig.Raddr
if len(raddr) != 0 { if len(raddr) != 0 {
hw.Forward(resp, req, raddr) hw.Forward(resp, req, raddr)

Loading…
Cancel
Save