mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
still working on #154
This commit is contained in:
parent
741d9d8f6e
commit
2d53890501
3 changed files with 70 additions and 3 deletions
|
@ -42,7 +42,7 @@ type HTTPProxy struct {
|
|||
|
||||
isTLS bool
|
||||
isRunning bool
|
||||
stripSSL bool
|
||||
stripper *SSLStripper
|
||||
sniListener net.Listener
|
||||
sess *session.Session
|
||||
}
|
||||
|
@ -60,8 +60,8 @@ func NewHTTPProxy(s *session.Session) *HTTPProxy {
|
|||
Name: "http.proxy",
|
||||
Proxy: goproxy.NewProxyHttpServer(),
|
||||
sess: s,
|
||||
stripper: NewSSLStripper(false),
|
||||
isTLS: false,
|
||||
stripSSL: true,
|
||||
Server: nil,
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ func (p *HTTPProxy) doProxy(req *http.Request) bool {
|
|||
func (p *HTTPProxy) Configure(address string, proxyPort int, httpPort int, scriptPath string, stripSSL bool) error {
|
||||
var err error
|
||||
|
||||
p.stripSSL = stripSSL
|
||||
p.stripper.Enabled = stripSSL
|
||||
p.Address = address
|
||||
|
||||
if scriptPath != "" {
|
||||
|
@ -295,6 +295,13 @@ func (p *HTTPProxy) Start() {
|
|||
go func() {
|
||||
var err error
|
||||
|
||||
strip := core.Yellow("enabled")
|
||||
if p.stripper.Enabled == false {
|
||||
strip = core.Dim("disabled")
|
||||
}
|
||||
|
||||
log.Info("%s started on %s (sslstrip %s)", core.Green(p.Name), p.Server.Addr, strip)
|
||||
|
||||
if p.isTLS == true {
|
||||
err = p.httpsWorker()
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue