From 4ac66fd52ac4b038ef5f7fda05b6890f1ec90327 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Mon, 14 Jan 2019 12:24:42 +0100 Subject: [PATCH] fix: fixed a bug in sslstripper (fixes #400) --- modules/http_proxy_base_sslstriper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/http_proxy_base_sslstriper.go b/modules/http_proxy_base_sslstriper.go index 77bea60f..6e0094c8 100644 --- a/modules/http_proxy_base_sslstriper.go +++ b/modules/http_proxy_base_sslstriper.go @@ -300,11 +300,11 @@ func (s *SSLStripper) Process(res *http.Response, ctx *goproxy.ProxyCtx) { // are we getting redirected from http to https? if orig.Scheme == "http" && location.Scheme == "https" { - log.Info("[%s] Got redirection from HTTPS to HTTP: %s -> %s", tui.Green("sslstrip"), tui.Yellow("http://"+origHost), tui.Bold("https://"+newHost)) + log.Info("[%s] Got redirection from HTTP to HTTPS: %s -> %s", tui.Green("sslstrip"), tui.Yellow("http://"+origHost), tui.Bold("https://"+newHost)) // if we still did not reach max redirections, strip the URL down to // an alternative HTTP version - if s.isMaxRedirs(origHost) { + if !s.isMaxRedirs(origHost) { strippedURL := s.processURL(newURL) u, _ := url.Parse(strippedURL) hostStripped := u.Hostname()