From Zero to Hero Phishing Company (ONSEC).pdf
If you are having issues with delivering emails due to email filtering, consider using Microsoft 365 and Azure IPP to send encrypted emails to your targets!
[email protected]
but it's really from [email protected]
(Technical people can easily figure this out though)Steps
Screenshot
Building Evilginx Phishlets
Securing Evilginx Infra tips -
- Remove IOCs (X-Evilginx header and Default Cert Details)
- Modify Unauth redirect static contents
- Modify code to request wildcard certificates for root domain from Let'sEncrypt other than requesting for each subdomains (As mentioned in Kuba's blog) - Check this repo for reference <https://github.com/ss23/evilginx2>
- Put evilginx behind a proxy to help against TLS fingerprinting (JA3 and JA3S)
- Use cloudflare in between if possible/feasible (You have to configure the SSL Settings correctly, change it to Full in cloudflare settings)
- Use some known ASN blacklist to avoid getting detected like here (<https://github.com/aalex954/evilginx2-TTPs#ip-blacklist>)
- Reduce the Number of proxyhosts in phishlet if possible to reduce content loading time.
- Host Evilginx at Azure and use their domain (limit proxy host in phishlet to 1 or find a way , may be create multiple azure sub domains and try with that)
- Add some sub_filters to modify the content of the pages to avoid content based detections, like (Favicon, form title font or style, or anything which seems relevant)
- Block the feedback/telemetry/logs/analytics subdomains using the phishlet sub_filters which can log the domain or may help later on analysis.
- See if js-injected is static or dynamic , if static modify the evilginx js-inject code to create dynamic/obfuscated version of your js for each user/target.
- Make sure to not leak your Evilginx infra IP, Check the DNS history to make sure its not stored anywhere (Analysts may look for older DNS Records of the domain)
- Be aware of this research : <https://catching-transparent-phish.github.io/catching_transparent_phish.pdf> , repo - <https://catching-transparent-phish.github.io/>
Remove X-Evilginx header (Check all the code lines with req.Header.Set
and comment relevant functions)
Search for <html>
in core/http_proxy.go file and modify the html code to remove any static signatures.
Also to avoid the static injected js code signature detection , You can modify the code as below
Make sure to add "github.com/tdewolff/minify/js" in imports
re := regexp.MustCompile(`(?i)(<\\\\s*/body\\\\s*>)`)
var d_inject string
if script != "" {
minifier := minify.New() // "github.com/tdewolff/minify/js"
minifier.AddFunc("text/javascript", js.Minify)
obfuscatedScript, err := minifier.String("text/javascript", script)
if err != nil {
// Handle error - Obfuscation failed
d_inject = "<script" + js_nonce + ">" + "function doNothing() {var x =0};" + script + "</script>\\\\n${1}"
}
d_inject = "<script" + js_nonce + ">" + "function doNothing() {var x =0};" + obfuscatedScript + "</script>\\\\n${1}"
//d_inject = "<script" + js_nonce + ">" + "function doNothing() {var x =0};" + script + "</script>\\\\n${1}"
} else if src_url != "" {
d_inject = "<script" + js_nonce + " type=\\\\"application/javascript\\\\" src=\\\\"" + src_url + "\\\\"></script>\\\\n${1}"
} else {
return body
}
Modify core/cert.db file as well
Change “rid”
for gophish.