mirror of
https://github.com/bettercap/bettercap
synced 2025-07-10 23:33:28 -07:00
new: login manager abuser caplet and script
This commit is contained in:
parent
5b969ffa9e
commit
aa25dae73c
5 changed files with 134 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue