new: login manager abuser caplet and script

This commit is contained in:
evilsocket 2018-01-08 02:34:00 +01:00
parent 5b969ffa9e
commit aa25dae73c
5 changed files with 134 additions and 4 deletions

View file

@ -2,6 +2,7 @@ package session_modules
import (
"fmt"
"io/ioutil"
"net/http"
)
@ -17,6 +18,7 @@ type JSRequest struct {
Hostname string
Headers []JSHeader
Body string
req *http.Request
}
func NewJSRequest(req *http.Request) JSRequest {
@ -33,9 +35,18 @@ func NewJSRequest(req *http.Request) JSRequest {
Path: req.URL.Path,
Hostname: req.Host,
Headers: headers,
req: req,
}
}
func (j *JSRequest) ReadBody() string {
return "TODO: read body"
raw, err := ioutil.ReadAll(j.req.Body)
if err != nil {
log.Errorf("Could not read request body: %s", err)
return ""
}
j.Body = string(raw)
return j.Body
}