Skip to content
KitploitKITPLOIT
StrumentiBlog
Invia
StrumentiBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
Strumenti/GitHubGitHub/an0nud4y/evilginx-phishing-infra-setup
Strumenti di PhishingEvasione IDS/IPSPhishingCommand and ControlIngegneria SocialeApprendimento e FormazioneRed TeamingRisorse CurateSicurezza Email

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Condividi
GitHuban0nud4y/evilginx-phishing-infra-setup

Evilginx-Phishing-Infra-Setup

Guida per la configurazione dell'infrastruttura di phishing Evilginx - Proteggere l'infrastruttura Evilginx e Gophish, Rimuovere gli IOCs, TTP di phishing

Vedi Repository
59811561 anno faRevisionato da Kitploit

Guida all'Infrastruttura per Engagement di Phishing

Nota: Queste sono copie delle mie note personali. Per favore, non fare completo affidamento su di esse.

Indice

  • Blog/Interventi
  • Automazione Infrastruttura Red Team/Phishing
  • Acquisto Domini e Tecniche di Categorizzazione
  • Migliorare la Scrittura di Email di Phishing Usando Strumenti
  • Test di Spam delle Email
  • Emulare Email di Phishing / Purple Team Phishing
  • Awesome Enterprise Email Security
  • Consegnare Email nella Posta in Arrivo
  • Engagement di Phishing Con Evilginx
    • Costruire Phishlets di Evilginx
    • Script di Installazione di Evilginx
    • Suggerimenti per Proteggere l'Infrastruttura Evilginx
    • Blog/Ricerca su Evilginx
    • Tattiche Difensive Contro Evilginx
  • Proteggere l'Infrastruttura GoPhish
    • Blog/Ricerca su GoPhish
    • Alternative a Gophish
  • Post Sfruttamento AiTM / Blog/Ricerca sul Phishing
  • Altre Tecniche/Blog/Ricerche
  • Interventi di Ricerca sul Phishing

Blog/Interventi

  • BHIS | How to Build a Phishing Engagement - Coding TTP's : https://m.youtube.com/watch?si=YTjMa8XBusj_tPdc&v=VglCgoIjztE&feature=youtu.be

Automazione Infrastruttura Red Team/Phishing

  • https://github.com/dazzyddos/HSC24RedTeamInfra/blob/main/RedTeamInfraAutomation.pdf
  • OFFENSIVEX 2024 - Vincent Yiu - Red Team Tips in 2024 : https://youtu.be/ECIBCbMfeo4?feature=shared
  • https://github.com/bluscreenofjeff/Red-Team-Infrastructure-Wiki
  • Deploy a phishing infrastructure on the fly : https://github.com/VirtualSamuraii/flyphish
  • https://labs.jumpsec.com/putting-the-c2-in-c2loudflare/

Acquisto Domini e Tecniche di Categorizzazione

  • Controlla Domini Scaduti e Possibilmente Acquista Quelli Buoni

    • https://expireddomains.net/
  • Categorizzazione Domini

    • Bluecoat/Symantec - https://sitereview.bluecoat.com/#/
    • McAfee - https://www.trustedsource.org
    • Palo Alto Wildfire - https://urlfiltering.paloaltonetworks.com
    • Websense - https://csi.forcepoint.com & https://www.websense.com/content/SiteLookup.aspx (richiede registrazione)
    • FortiGuard - https://www.fortiguard.com/webfilter
    • IBM X-force - https://exchange.xforce.ibmcloud.com
    • Cyren - https://www.cyren.com/security-center/url-category-check-gate
    • Checkpoint - https://www.checkpoint.com/urlcat/main.htm (richiede registrazione)
    • Trend Micro - https://global.sitesafety.trendmicro.com/
    • Sophos - https://secure2.sophos.com/en-us/support/contact-support.aspx (solo invio; nessun controllo) (Clicca Submit a Sample -> Web Address)
    • BrightCloud - http://www.brightcloud.com/tools/url-ip-lookup.php
    • LightSpeed Systems - https://archive.lightspeedsystems.com/
  • Automazione Controllo/Invio Reputazione Dominio

    • Domainhunter: https://github.com/threatexpress/domainhunter
    • Chameleon : https://github.com/mdsecactivebreach/Chameleon

Migliorare la Scrittura di Email di Phishing Usando Strumenti

  • mgeeky : https://github.com/mgeeky/Penetration-Testing-Tools/tree/master/phishing
  • HTML-Linter (evita parole comuni di phishing) : https://github.com/mgeeky/Penetration-Testing-Tools/blob/master/phishing/phishing-HTML-linter.py
  • Decode-Spam-Headers : https://github.com/mgeeky/decode-spam-headers

Test di Spam delle Email

  • https://www.mail-tester.com/

Emulare Email di Phishing / Purple Team Phishing

  • https://delivr.to/

Awesome Enterprise Email Security

  • https://github.com/0xAnalyst/awesome-email-security
  • Gartner Magic Quadrant for Email Security Platforms email-security-providers

Consegnare Email nella Posta in Arrivo

  • Metodo -1 : Usare Fornitori di Servizi Email

    • Usa SendGrid - http://sendgrid.com/
      • servizio utile ma onestamente, hai bisogno del piano Pro per avere fortuna a non finire in una lista di spam
    • MailGun - https://app.mailgun.com/
      • non ho mai avuto problemi
    • Amazon AWS SES
    • Brevo : https://www.brevo.com/free-smtp-server/
    • Outlook
    • Gmail
    • Imposta un Tenant Azure per ottenere un dominio onmicrosoft.com come attackdomain.onmicrosoft.com che può essere usato sia per l'invio di email che per il phishing come dominio
    • LarkSuite (permette domini personalizzati) : https://www.larksuite.com/
    • Zoho (Usa l'opzione email "Gratuita a Vita" di Zoho) : https://www.zoho.com/mail/custom-domain-email.html
    • Yandex : https://360.yandex.com/business/domain-mail/
  • Metodo - 2 : Tecniche Casuali

    • Tecnica 1 : Di Andre Rosario - Dal Discord BreakDev Red

      • Se hai problemi con la consegna delle email a causa del filtraggio email, considera l'uso di Microsoft 365 e Azure IPP per inviare email crittografate ai tuoi target!
        • Le email provengono da legittimi server SMTP Microsoft quindi non possono essere bloccate.
        • I target che ricevono l'email crittografata sono gli unici che possono aprirla; se la inoltrano al loro DFIR, dovranno accedere come quell'utente per vedere il tuo messaggio.
        • Facile orchestrazione nel portale di amministrazione Microsoft di domini personalizzati, creare un sacco di account falsi.
        • M365 permette di impostare nomi visualizzati arbitrari. Quindi nell'outlook di un target l'email può apparire come proveniente da [email protected] ma in realtà è da (Le persone tecniche possono però capirlo facilmente)

Engagement di Phishing Con Evilginx

  • Costruire Phishlets di Evilginx

    • Evilginx Mastery Course : https://academy.breakdev.org/evilginx-mastery
    • Evilginx Docs : https://help.evilginx.com/
    • Evilginx Phishlets Collections : https://github.com/An0nUD4Y/Evilginx2-Phishlets
    • Evilginx Less Known Techniques : https://github.com/An0nUD4Y/Evilginx2-Phishlets?tab=readme-ov-file#some-less-known-techniques
  • Script di Installazione di Evilginx

    • https://gist.github.com/dunderhay/d5fcded54cc88a1b7e12599839b6badb
  • Suggerimenti per Proteggere l'Infrastruttura Evilginx -

    • https://github.com/An0nUD4Y/Evilginx2-Phishlets#securing-evilginx-infra-tips

      root@kitploit:~
      - Riscrivi gli URL sulle Pagine di Phishing per evitare il rilevamento tramite pattern matching del percorso URL (di Kuba).
      - Rimuovi gli IOCs (intestazione X-Evilginx e Dettagli Certificato Predefiniti)
      - Modifica i contenuti statici di reindirizzamento per utenti non autenticati
      - Modifica il codice per richiedere certificati wildcard per il dominio radice da Let'sEncrypt invece di richiederli per ogni sottodominio (Come menzionato nel blog di Kuba) - Controlla questo repo come riferimento https://github.com/ss23/evilginx2
      - Metti evilginx dietro un proxy per aiutare contro il fingerprinting TLS (JA3 e JA3S)
      - Usa cloudflare tra, se possibile/fattibile (Devi configurare correttamente le impostazioni SSL, impostalo su Full nelle impostazioni di cloudflare)
      - Usa qualche blacklist di ASN noti per evitare di essere rilevato come qui (https://github.com/aalex954/evilginx2-TTPs#ip-blacklist)
      - Riduci il numero di proxyhosts nel phishlet se possibile per ridurre i tempi di caricamento dei contenuti.
      - Ospita Evilginx su Azure e usa il loro dominio (limita proxy host nel phishlet a 1 o trova un modo, magari crea più sottodomini Azure e prova con quelli)
      - Aggiungi alcuni sub_filters per modificare il contenuto delle pagine per evitare rilevamenti basati sul contenuto, come (Favicon, font o stile del titolo del modulo, o qualsiasi cosa sembri rilevante)
      - Blocca i sottodomini di feedback/telemetria/log/analytics usando i sub_filters del phishlet che potrebbero registrare il dominio o aiutare in seguito nell'analisi.
      - Verifica se js-injected è statico o dinamico, se statico modifica il codice js-inject di evilginx per creare una versione dinamica/offuscata del tuo js per ogni utente/target.
      - Assicurati di non esporre l'IP della tua infrastruttura Evilginx, Controlla la cronologia DNS per assicurarti che non sia memorizzato da nessuna parte (Gli analisti potrebbero cercare vecchi record DNS del dominio)
      - Sii consapevole di questa ricerca : https://catching-transparent-phish.github.io/catching_transparent_phish.pdf , repo - https://catching-transparent-phish.github.io/
      
root@kitploit:~
            orig_sub: ''
            domain: 'okta.com'
            search: 'X-Frame-Options: DENY'
            replace: 'Test: test'
            mimes: ['text/html', 'charset=utf-8']
          ```
            - Frame Busting Techniques Generally used
              - https://en.wikipedia.org/wiki/Framekiller
              - https://seclab.stanford.edu/websec/framebusting/framebust.pdf
                - Common Techniques to Detect Presence of iframe
                  ```
                    if (top != self)
                    if (top.location != self.location)
                    if (top.location != location)
                    if (parent.frames.length > 0)
                    if (window != top)
                    if (window.top !== window.self)
                    if (window.self != window.top)
                    if (parent && parent != window)
                    if (parent && parent.frames && parent.frames.length>0)
                    if((self.parent&&!(self.parent===self))&&(self.parent.frames.length!=0))
                  ```
                - Websites may use following method once iframe detected to perform redirection
                   ```
                   top.location.replace(self.location)
                    top.location.href = window.location.href
                    top.location.replace(document.location)
                    top.location.href = window.location.href
                    top.location.href = "URL"
                    document.write(’’)
                    top.location = location
                    top.location.replace(document.location)
                    top.location.replace(’URL’)
                    top.location.href = document.location
                    top.location.replace(window.location.href)
                    top.location.href = location.href
                    self.parent.location = document.location
                    parent.location.href = self.document.location
                    top.location.href = self.location
                    top.location = window.location
                    top.location.replace(window.location.pathname)
                    window.top.location = window.self.location
                    setTimeout(function(){document.body.innerHTML=’’;},1);
                    window.self.onload = function(evt){document.body.innerHTML=’’;}
                    var url = window.location.href; top.location.replace(url)
                   ```
                
### Blog e Talk di Ricerca su Evilginx:
- Un mare calmo non ha mai fatto un pescatore esperto - Kuba Gretzky (x33fc0n 2024):
    - Talk: [https://youtu.be/Nh99d3YnpI4?si=Ltwus2PS0z97gf2R](https://youtu.be/Nh99d3YnpI4?si=Ltwus2PS0z97gf2R)
    - Slide: [https://github.com/kgretzky/talks/blob/main/2024/x33fcon/a-smooth-sea-never-made-a-skilled-phisherman.pdf](https://github.com/kgretzky/talks/blob/main/2024/x33fcon/a-smooth-sea-never-made-a-skilled-phisherman.pdf)
- La tri-forza dell'accesso iniziale: [https://trustedsec.com/blog/the-triforce-of-initial-access](https://trustedsec.com/blog/the-triforce-of-initial-access)
    - Bobber: [https://github.com/Flangvik/Bobber](https://github.com/Flangvik/Bobber)
- Bypassare il rilevamento Canary AiTM: [https://insights.spotit.be/2024/06/03/clipping-the-canarys-wings-bypassing-aitm-phishing-detections/](https://insights.spotit.be/2024/06/03/clipping-the-canarys-wings-bypassing-aitm-phishing-detections/)
- Proteggere Evilginx usando Cloudflare e offuscamento HTML: [https://www.jackphilipbutton.com/post/how-to-protect-evilginx-using-cloudflare-and-html-obfuscation](https://www.jackphilipbutton.com/post/how-to-protect-evilginx-using-cloudflare-and-html-obfuscation)
- (Migliorare la fiducia nella consegna email di Evilginx) Aggiungere record SPF, DMARC, DKIM, MX: [https://fortbridge.co.uk/research/add-spf-dmarc-dkim-mx-records-evilginx/](https://fortbridge.co.uk/research/add-spf-dmarc-dkim-mx-records-evilginx/)
    - [https://m3rcer.netlify.app/redteaming/spamfilterbypass/](https://m3rcer.netlify.app/redteaming/spamfilterbypass/)
- Tattiche di phishing e OPSEC: [https://mgeeky.tech/uploads/WarCon22 - Modern Initial Access and Evasion Tactics.pdf](https://mgeeky.tech/uploads/WarCon22%20-%20Modern%20Initial%20Access%20and%20Evasion%20Tactics.pdf)
- Evilginx + BITB + Tattiche di evasione: [https://youtu.be/p1opa2wnRvg](https://youtu.be/p1opa2wnRvg)
- Hook, Line e Phishlet - Conquistare AD FS con Evilginx: [https://research.aurainfosec.io/pentest/hook-line-and-phishlet/](https://research.aurainfosec.io/pentest/hook-line-and-phishlet/)
- Infrastruttura di phishing O365 - [https://badoption.eu/blog/2023/12/03/PhishingInfra.html](https://badoption.eu/blog/2023/12/03/PhishingInfra.html)
- Non puoi vedermi – Proteggere la tua infrastruttura di phishing: [https://redsiege.com/blog/2024/01/you-cant-see-me-protecting-your-phishing-infrastructure/](https://redsiege.com/blog/2024/01/you-cant-see-me-protecting-your-phishing-infrastructure/)
- [https://janbakker.tech/evilginx-resources-for-microsoft-365/](https://janbakker.tech/evilginx-resources-for-microsoft-365/)
- Evilginx + BITB - [https://www.youtube.com/watch?v=luJjxpEwVHI&feature=youtu.be](https://www.youtube.com/watch?v=luJjxpEwVHI&feature=youtu.be)
- Hook, Line e Sinker: Phishing di Windows Hello for Business usando Evilginx: [https://medium.com/@yudasm/bypassing-windows-hello-for-business-for-phishing-181f2271dc02](https://medium.com/@yudasm/bypassing-windows-hello-for-business-for-phishing-181f2271dc02)
- Phishing del resistente - Phishing del token di aggiornamento primario in Microsoft Entra di Dirk Jan: [https://youtu.be/tNh_sYkmurI?si=qcb917IB5zHU1fQk](https://youtu.be/tNh_sYkmurI?si=qcb917IB5zHU1fQk)
- X33fcon 2024 - [https://youtu.be/Nh99d3YnpI4?si=Ltwus2PS0z97gf2R](https://youtu.be/Nh99d3YnpI4?si=Ltwus2PS0z97gf2R)
- Come sparare ai pesci in un barile - Bypassare i crawler di link: [https://posts.specterops.io/like-shooting-phish-in-a-barrel-926c1905bb4b](https://posts.specterops.io/like-shooting-phish-in-a-barrel-926c1905bb4b)
- Bevi come un pesce - Come far mimetizzare i tuoi siti di phishing: [https://posts.specterops.io/drink-like-a-phish-b9e91d0b5677](https://posts.specterops.io/drink-like-a-phish-b9e91d0b5677)
- Nutrire i pesci: [https://posts.specterops.io/feeding-the-phishes-276c3579bba7](https://posts.specterops.io/feeding-the-phishes-276c3579bba7)
- [https://posts.specterops.io/phish-out-of-water-aaeb677a5af3](https://posts.specterops.io/phish-out-of-water-aaeb677a5af3)
- [https://youtu.be/6jYZQKDlKco?si=cpfd4tWQ4V8ZAZaI](https://youtu.be/6jYZQKDlKco?si=cpfd4tWQ4V8ZAZaI)
- [https://posts.specterops.io/one-phish-two-phish-red-teams-spew-phish-1a2f02010ed7](https://posts.specterops.io/one-phish-two-phish-red-teams-spew-phish-1a2f02010ed7)
- Rilevamento degli strumenti di phishing Push Security: [https://gist.github.com/rad9800/bb73de360fc07ac544f0bc9faac9082d](https://gist.github.com/rad9800/bb73de360fc07ac544f0bc9faac9082d)
    - L'estensione Chrome di Push Security rileva evilginx con alcune regole piuttosto fragili
        - Regola 1: Nome cookie=XXXX-XXXX e valore=64_hex_chars
        - Regola 2: Percorso script=/s/64_hex_chars.js con content-length=0
        - Regola 3: Entrambe le Regole 1 e 2 presenti
        - la logica completa dello snippet JS blob è qui [https://gist.github.com/rad9800/bb73de360fc07ac544f0bc9faac9082d](https://gist.github.com/rad9800/bb73de360fc07ac544f0bc9faac9082d)
- [https://janbakker.tech/evilginx-loves-temporary-access-passes-too/](https://janbakker.tech/evilginx-loves-temporary-access-passes-too/)
          
### Tattiche difensive contro Evilginx
- Svelare e contrastare il phishing Avversario nel mezzo - X33fcon 2024 - [https://youtu.be/-W-LxcbUxI4](https://youtu.be/-W-LxcbUxI4?feature=shared)
- Usare HoneyTokens per rilevare AiTM: [https://zolder.io/using-honeytokens-to-detect-aitm-phishing-attacks-on-your-microsoft-365-tenant/](https://zolder.io/using-honeytokens-to-detect-aitm-phishing-attacks-on-your-microsoft-365-tenant/)
- Proteggersi contro il phishing moderno: [https://bleekseeks.com/blog/how-to-protect-against-modern-phishing-attacks](https://bleekseeks.com/blog/how-to-protect-against-modern-phishing-attacks)
- [https://www.youtube.com/watch?v=wTLB0Yh70_0](https://www.youtube.com/watch?v=wTLB0Yh70_0)
- Rilevare evilginx usando l'impronta digitale JA3, JA3S, JA4
    - Database JA4: [https://ja4db.com/](https://ja4db.com/)
    

    



## Mettere in sicurezza l'infrastruttura GoPhish

> Queste modifiche funzioneranno anche con l'ultima versione di evilginx + gophish, ovvero evilginx3.3
> 
- Suggerimenti: Usa il parametro {{.URL}} nel modello di phishing quando usi evilginx ( [https://github.com/kgretzky/evilginx2/issues/1042#issuecomment-2052073864](https://github.com/kgretzky/evilginx2/issues/1042#issuecomment-2052073864))
- Modifiche nel codice sorgente e nella struttura dei file di gophish per mettere in sicurezza l'infrastruttura GoPhish
    - Rimuovere le istanze di `X-Gophish` (`X-Gophish-Contact`, `X-Gophish-Signature`)
    - Rimuovere `const ServerName= "gophish"` e cambiarlo in `const ServerName= "IGNORE"` nel file `config/config.go`
    - Cambiare la porta predefinita del server Admin nel file `config.json`.
    - Modificare le firme dei messaggi email di test, per evitare il rilevamento durante i test SMTP.
        
        ```yaml
        Controllers > api > util.go
        models > testdata > email_request.go
        models > testdata > email_request_test.go
        models > testdata > maillog.go
        models > testdata > maillog_test.go
        models > testdata > smtp_test.go
        ```
        
    - Cambiare la risposta 404
        - Aggiungere la funzione personalizzata qui sotto nel file `controllers/phish.go`
            
            ```go
            func customNotFound(w http.ResponseWriter, r *http.Request) {
            	http.Error(w, "Try again!", http.StatusNotFound)
            }
            ```
            
        - Ora sostituisci tutte le istanze di `http.NotFound(w, r)` con `customNotFound(w, r)`
    - Rimuovere la risposta hardcoded di robots.txt e modificarla nel file `controllers/phish.go`
        - Modificare il codice corrispondente nel file phish.go con quello sotto.
            
            ```go
            //Risposta modificata
            // RobotsHandler impedisce ai motori di ricerca, ecc. di indicizzare materiali di phishing
            func (ps *PhishingServer) RobotsHandler(w http.ResponseWriter, r *http.Request) {
            	fmt.Fprintln(w, "User-agent: *\nDisallow: /*/*\nDisallow: /.git/*")
            }
            ```
            
    - Modificare il parametro GET `"rid"` nelle richieste
        - Assicurati di modificare tutte le istanze di `"rid"` in qualcos'altro.
        - Questi sono presenti anche nel codice sorgente di evilginx3.3, quindi assicurati di modificarli anche lì.
    - Per prevenzioni avanzate, puoi modificare anche la cartella static e rinominarla in qualcos'altro, così come rinominare i file al suo interno per evitare il rilevamento basato sul percorso. Non dimenticare di modificare anche il codice sorgente pertinente.
        - Come i nomi delle immagini, ad esempio: pixel.png, modificalo in qualcos'altro.
    - Cambiare le proprietà del certificato nel file `util/util.go`
        
        ```go
        	template := x509.Certificate{
        		SerialNumber: serialNumber,
        		Subject: pkix.Name{
        			//Organization: []string{"Gophish"},
        			Organization: []string{"Microsoft Corporation"},
        		},
        ```
        
    - Usa Nginx per proxyare il traffico attraverso di esso per evitare qualsiasi impronta del server Golang
        - `service nginx start`
        - Devi cambiare il `config.json` di gophish per cambiare le porte per http da 80 a 8080 e https da predefinita a 60002, come mostrato sotto
            
            ```yaml
            {
            	"admin_server": {
            		"listen_url": "127.0.0.1:60002",
            		"use_tls": true,
            		"cert_path": "gophish_admin.crt",
            		"key_path": "gophish_admin.key",
            		"trusted_origins": []
            	},
            	"phish_server": {
            		"listen_url": "127.0.0.1:8080",
            		"use_tls": false,
            		"cert_path": "example.crt",
            		"key_path": "example.key"
            	},
            	"db_name": "sqlite3",
            	"db_path": "gophish.db",
            	"migrations_prefix": "db/db_",
            	"contact_address": "",
            	"logging": {
            		"filename": "",
            		"level": ""
            	}
            }
            ```
            
        - La configurazione qui sotto bloccherà tutte le richieste con user agent contenente “Bot” o “bot”
            
            ```yaml
            # /etc/nginx/nginx.conf
            
            events {
                # Define event processing parameters here
                worker_connections 1024; # Adjust according to your requirements
            }
            
            http {
            
                upstream backend {
                    server localhost:8080;
                }
                # HTTP server
                server {
                    listen 80 default_server;
                    
            
                    # Reject requests with "bot" or "Bot" in User-Agent
                    if ($http_user_agent ~* (bot|Bot)) {
                        return 403;
                    }
            
                    location / {
                        proxy_pass http://backend;
                        proxy_set_header Host $host;
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_set_header X-Forwarded-Proto $scheme;
                    }
                }
            
                upstream backend_https {
                    server localhost:60002;
                }
                # HTTPS server
                server {
                    listen 60001 ssl default_server;
            
                    ssl_certificate /root/Phishing/gophish-mod/gophish_admin.crt;
                    ssl_certificate_key /root/Phishing/gophish-mod/gophish_admin.key;
            
                    # Reject requests with "bot" or "Bot" in User-Agent
                    if ($http_user_agent ~* (bot|Bot)) {
                        return 403;
                    }
            
                    location / {
                        proxy_pass https://backend_https;
                        proxy_set_header Host $host;
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_set_header X-Forwarded-Proto $scheme;
                    }
                }
            }
            
            ```
            
        - Per permettere solo un user agent specifico, usa la configurazione qui sotto. Questo bloccherà tutte le richieste e permetterà solo quelle con user agent “`iamdevil`”.
            
            ```yaml
            # /etc/nginx/nginx.conf
            
            events {
                # Define event processing parameters here
                worker_connections 1024; # Adjust according to your requirements
            }
            
            http {
            
                upstream backend {
                    server localhost:8080;
                }
            
                # HTTP server
                server {
                    listen 80 default_server;
            
                    # Reject requests with user agent other than "iamdevil"
                    if ($http_user_agent != "iamdevil") {
                        return 403;
                    }
            
                    location / {
                        proxy_pass http://backend;
                        proxy_set_header Host $host;
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_set_header X-Forwarded-Proto $scheme;
                    }
                }
            
                upstream backend_https {
                    server localhost:60002;
                }
            
                # HTTPS server
                server {
                    listen 60001 ssl default_server;
            
                    ssl_certificate /root/Phishing/gophish-mod/gophish_admin.crt;
                    ssl_certificate_key /root/Phishing/gophish-mod/gophish_admin.key;
            
                    # Reject requests with user agent other than "iamdevil"
                    if ($http_user_agent != "iamdevil") {
                        return 403;
                    }
            
                    location / {
                        proxy_pass https://backend_https;
                        proxy_set_header Host $host;
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_set_header X-Forwarded-Proto $scheme;
                    }
                }
            }
            ```
            
    - Modificare la firma del pixel di tracciamento di Gophish per evitare il rilevamento basato sul pixel di tracciamento firmato.
    - Cambiare il pattern della sequenza delle intestazioni email di gophish. Può essere usato per rilevare gophish (dalla community BreakDev Red).
    - Configurare PostFix davanti a gophish per rimuovere IOCs e altri rilevamenti e la natura spam delle email, e anche rimuovere e correggere le intestazioni.

- **Blog e talk di ricerca su GoPhish:**
    - [https://edermi.github.io/post/2021/modding_gophish/](https://edermi.github.io/post/2021/modding_gophish/)
    - [https://www.sprocketsecurity.com/resources/never-had-a-bad-day-phishing-how-to-set-up-gophish-to-evade-security-controls](https://www.sprocketsecurity.com/resources/never-had-a-bad-day-phishing-how-to-set-up-gophish-to-evade-security-controls)
    - [https://cyberwarfare.live/wp-content/uploads/2023/08/OPSEC-on-the-High-Seas_-A-Gophish-Adventure.pdf](https://cyberwarfare.live/wp-content/uploads/2023/08/OPSEC-on-the-High-Seas_-A-Gophish-Adventure.pdf)
    - [https://www.sprocketsecurity.com/resources/never-had-a-bad-day-phishing-how-to-set-up-gophish-to-evade-security-controls](https://www.sprocketsecurity.com/resources/never-had-a-bad-day-phishing-how-to-set-up-gophish-to-evade-security-controls)
    - [https://github.com/puzzlepeaches/sneaky_gophish](https://github.com/puzzlepeaches/sneaky_gophish)
    - [https://cybercx.co.nz/blog/identifying-gophish-servers/](https://cybercx.co.nz/blog/identifying-gophish-servers/)
    - [https://github.com/gophish/gophish/issues/1553#issuecomment-523969887](https://github.com/gophish/gophish/issues/1553#issuecomment-523969887)

- **Alternative a Gophish:**
    - SniperPhish: https://github.com/GemGeorge/SniperPhish
    - Mailcow: https://github.com/mailcow/mailcow-dockerized


## Blog e talk di ricerca su Post-Exploitation / Phishing AiTM

- AiTM (Post-Exploitation): https://www.youtube.com/live/WY4mH-8TbWY?si=LkZ1LuduDln1vRuj
    - https://youtu.be/py68OE4tQ4Q?si=n6QlNuro88c1PRzn
- https://trustedsec.com/blog/the-triforce-of-initial-access
- https://www.youtube.com/live/tOzURCc-qUc?si=DMkLwXHVQomRMEJD## Altre Tecniche/Blog/Ricerche
- Per abusare di siti legittimi per il Phishing : https://lots-project.com/
- Muraena : https://github.com/muraenateam/muraena
- NecroBrowser : https://github.com/muraenateam/necrobrowser
- BITB : https://mrd0x.com/browser-in-the-browser-phishing-attack/
    - Frameless-bitb : https://github.com/waelmas/frameless-bitb
        - https://youtu.be/luJjxpEwVHI?si=sk8kMfdfhZbTz8qR
    - CuddlePhish : https://github.com/fkasler/cuddlephish
    - https://pushsecurity.com/blog/phishing-2-0-how-phishing-toolkits-are-evolving-with-aitm/
    - Okta concatenato con Azure con auto MFA Subscription per Okta e Frame Buster Bypass per eseguire BITB : https://x.com/otterhacker/status/1929487165458641045?s=46&t=mlJvZy0Zrkrxzuvtt7m2cQ
        - https://github.com/OtterHacker/OktaGinx/
- Progressive Web Apps (PWA) Phishing : https://mrd0x.com/progressive-web-apps-pwa-phishing/
- noVNC Phishing : https://adepts.of0x.cc/novnc-phishing/
    - EvilnoVNC : https://github.com/JoelGMSec/EvilnoVNC
    - MultiEvilnoVNC : https://blog.wanetty.com/blog/tools/multievilnovnc
    - https://fhlipzero.io/blogs/6_noVNC/noVNC.html
    - Delusion (Toolkit basato su NoVNC) : https://cloud.google.com/blog/topics/threat-intelligence/session-stealing-browser-in-the-middle
    - Rilevamento di NoVNC : https://gist.github.com/rad9800/bb73de360fc07ac544f0bc9faac9082d
- noVNC e Docker : https://powerseb.github.io/posts/Another-phishing-tool/
    - https://github.com/powerseb/NoPhish
    - https://fhlipzero.io/blogs/6_noVNC/noVNC.html
    - https://github.com/Macmod/YesPhish/tree/patchright-chrome
- EvilQR - QR Phishing
    - Genera QR : https://github.com/Flangvik/QRucible
    - https://badoption.eu/blog/2024/01/08/mobilephish.html
    - QR2Ascii : https://github.com/Jojodicus/qr2eascii
    - https://github.com/kgretzky/evilqr , https://breakdev.org/evilqr-phishing/
    - https://github.com/swagkarna/EvilJack
    - https://techcommunity.microsoft.com/t5/microsoft-security-experts-blog/hunting-for-qr-code-aitm-phishing-and-user-compromise/bc-p/4054850
- NoPhish (docker e noVNC) : https://github.com/powerseb/NoPhish e https://badoption.eu/blog/2023/07/12/entra_phish.html
- EvilGoPhish : https://github.com/fin3ss3g0d/evilgophish
- Smishing : https://blog.shared-video.mov/systematic-destruction-hacking-the-scammers-pt.-2
- Phishing con CloudFlare Workers
    - TryCloudflare : https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/trycloudflare/
    - https://github.com/zolderio/AITMWorker
    - https://gist.github.com/RedTeamOperations/33f245a777c9b322b0466b59d6687f15
    - https://cyberwarfare.live/wp-content/uploads/2023/08/Certified-Red-Team-CredOps-Infiltrator-CRT-COI-1.pdf
- Phishing con Cloudflare Public Buckets : https://developers.cloudflare.com/r2/buckets/public-buckets/
    - https://medium.com/trac-labs/aitm-phishing-hold-the-gabagool-analyzing-the-gabagool-phishing-kit-531f5bbaf0e4
- Google Open Redirection per phishing
    - https://untrustednetwork.net/en/2024/02/26/google-open-redirect/
    - Open Redirect non funzionante : https://googleweblight.com/i?u=m4lici0u5.com
    - Open Redirect : https://www.google.com/url?q=https://m4lici0u5.com
    - Open Redirect : https://business.google.com/website_shared/launch_bw.html?f=https://m4lici0u5.com
    - Altri possono essere trovati su : https://lots-project.com/
- https://blog.delivr.to/delivr-tos-top-10-payloads-dec-24-pastejacking-image-less-qr-codes-and-concatenated-zip-a32e668106dd#878d
- Phishing oltre i controlli di protezione della posta utilizzando Azure Information Protection
    - https://youtu.be/tHNi5BzScVo?si=H2czog19AmTp_O26
    - https://youtu.be/EYUp_MNtJIk?si=sg_9RQggDvqOSLNL
    - https://youtu.be/KhdzIPPW4W0?si=E4CmWx0iO8EaR6JF
- https://nicolasuter.medium.com/aitm-phishing-with-azure-functions-a1530b52df05
- https://pushsecurity.com/blog/a-new-class-of-phishing-verification-phishing-and-cross-idp-impersonation/
- https://blog.delivr.to/delivr-tos-top-10-payloads-dec-24-pastejacking-image-less-qr-codes-and-concatenated-zip-a32e668106dd#878d
- https://trustedsec.com/blog/oops-i-udld-it-again
- Phishing di credenziali tramite abuso di Docusign : https://sublime.security/blog/living-off-the-land-credential-phishing-via-docusign-abuse/
- Phishing di credenziali nascosto con allegati EML : https://sublime.security/blog/hidden-credential-phishing-within-eml-attachments/
- https://sublime.security/blog/talking-year-end-credential-phishing-scams-over-turkey/
- Utilizzo di Microsoft Customer Voice per Phishing : https://cofense.com/blog/microsoft-customer-voice-urls-used-in-latest-phishing-campaign
- https://www.youtube.com/live/tOzURCc-qUc?si=DMkLwXHVQomRMEJD
- DoubleClickJacking : https://www.paulosyibelo.com/2024/12/doubleclickjacking-what.html
    - https://safetyscience.info/labs/doubleclickjacking/
- Confronto tra varie tecniche : https://blog.quarkslab.com/technical-dive-into-modern-phishing.html
- https://cloud.google.com/blog/topics/threat-intelligence/session-stealing-browser-in-the-middle
- Abuso di webhook in arrivo di Microsoft Teams per phishing : https://www.blackhillsinfosec.com/wishing-webhook-phishing-in-teams/
    - https://www.youtube.com/live/kMMZrd9intI?si=rd_EKWmXeKbbGAEI
- Rogue RDP o RDP (.rdp) per phishing : https://github.com/GoSecure/pyrdp
    - https://cloud.google.com/blog/topics/threat-intelligence/windows-rogue-remote-desktop-protocol
    - https://www.blackhillsinfosec.com/rogue-rdp-revisiting-initial-access-methods/
- https://easydmarc.com/blog/google-spoofed-via-dkim-replay-attack-a-technical-breakdown/
- SVG per phishing : https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/pixel-perfect-trap-the-surge-of-svg-borne-phishing-attacks/
- Utilizzo di ClickOnce con Phishing per accesso iniziale  : https://www.netspi.com/blog/technical-blog/adversary-simulation/all-you-need-is-one-a-clickonce-love-story/
- https://denniskniep.github.io/posts/09-device-code-phishing/
- https://badoption.eu/blog/2025/04/25/github.html
- https://atticsecurity.com/blog/aitm-for-whfb-persistence/
- [Da controllare] Evilworker : https://github.com/Ahaz1701/EvilWorker
    - https://medium.com/@ahaz1701/evilworker-da94ae171249

## Talk di Ricerca sul Phishing
- https://youtu.be/zmo_tPbCXtA?si=4imjZtwQ6I9iu_tP
Scarica lo strumento
  • Blog

    • https://medium.com/@frsfaisall/mastering-modern-red-teaming-infrastructure-leveraging-old-domains-for-reputation-based-bypasses-1fd8cc1768f7
  • [email protected]
  • Le email provengono da IP e domini legittimi Microsoft, quindi non devi preoccuparti della categorizzazione del dominio o della durata di vita poiché è Microsoft.
  • Tecnica 2 : Usare la funzionalità di Invito Esterno di Azure - Dal Discord BreakDev Red

    • L'invito esterno di Azure può essere usato per inviare un'email con link di reindirizzamento a un URL di phishing
    • Le email in blocco possono essere inviate, per riferimento controlla : https://learn.microsoft.com/it-it/entra/external-id/tutorial-bulk-invite
  • Suggerimenti Casuali per Aiutare a Far Entrare le Email nella Posta in Arrivo.

    • Avere un dominio con buona reputazione, Controlla la categorizzazione del dominio
    • Avere un dominio più vecchio di 1 anno o usa expireddomain
    • Avere DKIM, DMARC e SPF validi.
      • Mailgoose (controlla se le loro configurazioni SPF, DMARC e DKIM sono impostate correttamente) : https://github.com/CERT-Polska/mailgoose
    • Aggiungere un link di cancellazione nell'email
    • Inviare prima email benigne (Potrebbe aiutare con la reputazione)
    • Avere un link nell'email con lo stesso dominio usato per inviare l'email.
  • Blog/Interventi/Riferimenti

    • Outlook_Email_Auth_Bypass : https://gitlab.com/hxxpxxp/outlook_email_auth_bypass (Nell'app desktop e web di Outlook, il "nome visualizzato" dell'intestazione "Da" dell'email può manipolare l'email del mittente mostrata all'utente, il che può portare a email di phish più convincenti)
    • Spy Pixel - Pixel immagine per tracciare le email : https://github.com/collinsmc23/spy-pixel
    • EchoSpoofing : https://labs.guard.io/echospoofing-a-massive-phishing-campaign-exploiting-proofpoints-email-protection-to-dispatch-3dd6b5417db6
    • Blackhat USA 2024 - Novel Email Spoofing Attack Patterns : https://github.com/onhexgroup/Conferences/blob/main/Black Hat USA 2024 slides/Hao Wang %26 Caleb Sargent %26 Harrison Pomeroy %26 Renana Friedlich_Into the Inbox Novel Email Spoofing Attack Patterns.pdf
  • Rimuovi l'intestazione X-Evilginx (Controlla tutte le righe di codice con req.Header.Set e commenta le funzioni rilevanti nel file core/http_proxy.go)

    root@kitploit:~
      // commenta la riga 469
      req.Header.Set(p.getHomeDir(), o_host)
      
      //commenta la riga 659
      req.Header.Set(p.getHomeDir(), o_host)
      
      // commenta la funzione alla riga 1791-1793
      func (p *HttpProxy) getHomeDir() string {
      	return strings.Replace(HOME_DIR, ".e", "X-E", 1)
      }
      
      // commenta le righe 52-54
      const (
      	HOME_DIR = ".evilginx"
      )
    
  • Per Modificare i contenuti statici di reindirizzamento per utenti non autenticati, Cerca <html> nel file core/http_proxy.go e modifica il codice html per rimuovere eventuali firme statiche.

  • Anche per evitare il rilevamento della firma del codice js iniettato statico, Puoi modificare il codice come segue

    • Assicurati di aggiungere "github.com/tdewolff/minify/js" negli import

      root@kitploit:~
      	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 {
      			// Gestisci l'errore - Offuscamento fallito
      			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
      	} 
      
  • Modifica anche il file core/cert.db

  • Cambia “rid” per gophish.

  • Usa nginx, caddy o altri proxy davanti a evilginx.

  • Usa Redirector

    • Usa cloudflare turnstile come redirector per evilginx e blocca i bot.
      • https://github.com/kgretzky/evilginx2/blob/master/redirectors/turnstile/index.html
    • Offusca redirector basati su html/js
      • Lista Suspicious HTTP User agents : https://github.com/mthcht/awesome-lists/blob/main/Lists/suspicious_http_user_agents_list.csv
      • https://github.com/DosX-dev/WebSafeCompiler
    • Metodi di rilevamento bot usati dal kit di phishing gabagool : https://medium.com/@traclabs_/aitm-phishing-hold-the-gabagool-analyzing-the-gabagool-phishing-kit-531f5bbaf0e4
    • Tag html Meta per reindirizzamento
      • <meta http-equiv="refresh" content="5;url=https://example.com">
  • Cambia il pattern predefinito dell'URL lure che è una stringa casuale di lunghezza 8.

    root@kitploit:~
       // Riga 728 nel file core/terminal.go
      		l := &Lure{
      			Path:     "/" + GenRandomString(8),
      			Phishlet: args[1],
      		}
    
  • Riscrivi gli URL sulle Pagine di Phishing per evitare il rilevamento tramite pattern matching del percorso URL (di Kuba). [Questa funzionalità non è disponibile nella Versione Pubblica di Evilginx, Devi implementarla tu stesso.]

    root@kitploit:~
    # Funziona solo nella Versione Pro di Evilginx
    # Funzionalità simile può essere implementata anche nella versione pubblica.
    rewrite_urls:
    
    trigger:
    domains: ['www.linkedin.com']
    paths: ['^/login$']
    rewrite:
    path: '/this/is/not/the/path/you/are/looking/for.php'
    query:
    
        {key:'a', value: 'HOW'}
        {key:'b', value: 'MUCH'}
        {key:'d', value: 'IS'}
        {key:'e', value: 'THE'}
        {key:'f', value: 'PHISH'}
        {key:'q', value: '{id}'}
    
    

    Untitled

  • Modifica il pattern e il valore dei cookie di identificazione del lure/sessione (di @rad9800 )

    • Regola 1: Nome cookie=XXXX-XXXX & valore=64_hex_chars - https://gist.github.com/rad9800/bb73de360fc07ac544f0bc9faac9082d#file-index-js-L130
      • Funzionalità del codice Evilginx responsabile (Per il Nome cookie) : https://github.com/kgretzky/evilginx2/blob/9e32484719681892945130187ea52737b3d72051/core/http_proxy.go#L1984
      • Funzionalità del codice Evilginx responsabile (Per il Valore cookie) : https://github.com/kgretzky/evilginx2/blob/9e32484719681892945130187ea52737b3d72051/core/http_proxy.go#L895
    • Regola 2: Percorso script=/s/64_hex_chars.js con content-length=0
    • Regola 3: Sia Regola 1 che Regola 2 presenti
      • la logica completa dello snippet js blob è qui https://gist.github.com/rad9800/bb73de360fc07ac544f0bc9faac9082d
  • Blocca le intestazioni Referrer per evitare che il tuo nome dominio di phishing venga divulgato - controlla questo blog di ricerca come riferimento :

    • Aggiungi la riga seguente nel file http_proxy.go qui (Chrome non rispetta questo e quando la richiesta è iniziata dalla funzione CSS url() - controlla il blog per maggiori informazioni)
      • resp.Header.Set("Referrer-Policy", "no-referrer")
      • Per automatizzare dal phishlet controlla questa PR : https://github.com/kgretzky/evilginx2/pull/1006
  • Definisci la tua CSP (Content Security Policy) per evitare telemetria/canary/rilevamento tramite divulgazione del dominio di phishing.

    • Leggi questo per maggiori informazioni : https://insights.spotit.be/2024/06/03/clipping-the-canarys-wings-bypassing-aitm-phishing-detections/
  • Controlla se il sito target utilizza qualche tipo di canary token (CSS, JS) e evitali

    • Bypass del Rilevamento AiTM tramite Canary (CSS,JS) : https://insights.spotit.be/2024/06/03/clipping-the-canarys-wings-bypassing-aitm-phishing-detections/
    • https://blog.thinkst.com/2024/01/defending-against-the-attack-of-the-cloned-websites.html
  • Evasione del fingerprint JA4

    • https://github.com/refraction-networking/utls
    • https://github.com/juzeon/spoofed-round-tripper
  • BITB + evilginx + Bypass Frame Busting

    • https://x.com/otterhacker/status/1929487165458641045?s=46&t=mlJvZy0Zrkrxzuvtt7m2cQ
      • OktaGinx : https://github.com/OtterHacker/OktaGinx/blob/main/okta.yaml#L17
    • https://github.com/waelmas/frameless-bitb
    • Esempio di Subfilter per Bypass Frame Busting da : https://github.com/OtterHacker/OktaGinx/blob/44fed02954b6cd65e17ab581209a4d0f3b734c24/okta.yaml#L124 e https://github.com/OtterHacker/OktaGinx/blob/44fed02954b6cd65e17ab581209a4d0f3b734c24/okta.yaml#L82
      root@kitploit:~
      - triggers_on: 'login.microsoftonline.com'
      orig_sub: ''
      domain: 'okta.com'
      search: 'if\(e.self===e.top\){'
      replace: 'if(true){window.oldself=e.self;e.self=e.top;'
      mimes: ['text/html', 'charset=utf-8']