kgretzky / evilginx2

Standalone man-in-the-middle attack framework used for phishing login credentials along with session cookies, allowing for the bypass of 2-factor authentication
BSD 3-Clause "New" or "Revised" License
10.72k stars 1.94k forks source link

Failed to start nameserver on port 53 #125

Closed git78 closed 5 years ago

git78 commented 5 years ago

Hello, I have an error when I run evilginx2 his puts me "Failed to start nameserver on port 53" an answer ?

kgretzky commented 5 years ago

Port 53 is used by other service or you need root privileges.

git78 commented 5 years ago

Le port 53 est utilisé par un autre service ou vous avez besoin de privilèges root.

okay, thanks, but how can I close the listening service on the port 53 ?

azamet90 commented 4 years ago

Port 53 is used by other service or you need root privileges.

lsof -i :53 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME systemd-r 1445 systemd-resolve 12u IPv4 29095 0t0 UDP localhost:domain systemd-r 1445 systemd-resolve 13u IPv4 29096 0t0 TCP localhost:domain (LISTEN)

It's a DNS resolver. DNS resolvers always listen on port 53. how to fix it?

freelatter commented 4 years ago

netstat -tunalp

Answer:

udp 0 0 127.0.0.53:53 0.0.0.0:* 193/systemd-resolve

Decision:

sudo systemctl stop systemd-resolved

Logicmn commented 4 years ago

Decision:

sudo systemctl stop systemd-resolved

Tried this, but stopping name resolution triggers another error upon launching evilginx2:

Screen Shot 2019-11-29 at 11 58 40 PM

Is there a way around this?

freelatter commented 4 years ago

Is there a way around this?

You are missing SSL Certificate

https://letsencrypt.org/getting-started/

Logicmn commented 4 years ago

Is there a way around this?

You are missing SSL Certificate

https://letsencrypt.org/getting-started/

Thanks. Turns out I had my DNS set up incorrectly and evilginx was not registering the SSL cert properly.

For anyone reading who is having similar issues, make sure your domain nameservers are pointing towards your evilginx server. Google Domains requires you to create registered hosts (ns1.yourdomain.com, ns2.yourdomain.com) and point them at your server's IP before you can add them as nameservers.

Ck1998 commented 4 years ago

Is there a way around this?

You are missing SSL Certificate https://letsencrypt.org/getting-started/

Thanks. Turns out I had my DNS set up incorrectly and evilginx was not registering the SSL cert properly.

For anyone reading who is having similar issues, make sure your domain nameservers are pointing towards your evilginx server. Google Domains requires you to create registered hosts (ns1.yourdomain.com, ns2.yourdomain.com) and point them at your server's IP before you can add them as nameservers.

can you let me know how did you set up your dns I looked at various posts online but couldn't find anything i created my nameservers ns1.domain.com and ns2.domain.com pointed them to my server and added them as the nameservers after removing the default Name.com nameservers still can't get evilginx to work

mRanonyMousTZ commented 2 years ago

Le port 53 est utilisé par un autre service ou vous avez besoin de privilèges root.

okay, thanks, but how can I close the listening service on the port 53 ?

Edit /etc/systemd/resolved.conf with a text editor (as root), e.g. open it with Nano console text editor:

sudo nano /etc/systemd/resolved.conf

And uncomment (remove # from the front of the line) the DNS= line and the DNSStubListener= line. Next, change the DNS= value in this file to the DNS server you want to use (e.g. 127.0.0.1 to use a local proxy, 1.1.1.1 to use the Cloudflare DNS, etc.), and also change the DNSStubListener= value from yes to no

This is how the file should look after you've made these changes (I'm using 1.1.1.1 as the DNS server here, which is the Cloudflare DNS):

[Resolve] DNS=1.1.1.1

FallbackDNS=

Domains=

LLMNR=no

MulticastDNS=no

DNSSEC=no

DNSOverTLS=no

Cache=no

DNSStubListener=no

ReadEtcHosts=yes

To save the file using Nano text editor, press Ctrl + x, then type y and press Enter

Create a symbolic link for /run/systemd/resolve/resolv.conf with /etc/resolv.conf as the destination:

sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

Reboot your system.

Port 53 should now be free on your Ubuntu system, and you shouldn't be getting errors like "listen tcp 127.0.0.1:53: bind: address already in use" anymore.

ENJOY

@mranonymoustz@tutanota.com

kdperkin commented 2 years ago

Le port 53 est utilisé par un autre service ou vous avez besoin de privilèges root.

okay, thanks, but how can I close the listening service on the port 53 ?

Edit /etc/systemd/resolved.conf with a text editor (as root), e.g. open it with Nano console text editor:

sudo nano /etc/systemd/resolved.conf

And uncomment (remove # from the front of the line) the DNS= line and the DNSStubListener= line. Next, change the DNS= value in this file to the DNS server you want to use (e.g. 127.0.0.1 to use a local proxy, 1.1.1.1 to use the Cloudflare DNS, etc.), and also change the DNSStubListener= value from yes to no

This is how the file should look after you've made these changes (I'm using 1.1.1.1 as the DNS server here, which is the Cloudflare DNS):

[Resolve] DNS=1.1.1.1 #FallbackDNS= #Domains= #LLMNR=no #MulticastDNS=no #DNSSEC=no #DNSOverTLS=no #Cache=no DNSStubListener=no #ReadEtcHosts=yes

To save the file using Nano text editor, press Ctrl + x, then type y and press Enter

Create a symbolic link for /run/systemd/resolve/resolv.conf with /etc/resolv.conf as the destination:

sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

Reboot your system.

Port 53 should now be free on your Ubuntu system, and you shouldn't be getting errors like "listen tcp 127.0.0.1:53: bind: address already in use" anymore.

ENJOY

@mranonymoustz@tutanota.com

this solved my issue perfectly. as visual learner this referenced helped as well.

https://www.linuxuprising.com/2020/07/ubuntu-how-to-free-up-port-53-used-by.html

larryxp commented 4 months ago

netstat -tunalp

Answer:

udp 0 0 127.0.0.53:53 0.0.0.0:* 193/systemd-resolve

Decision:

sudo systemctl stop systemd-resolved

This worked for me on debian