You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesión a prueba de IA

Antes: $249

Currency
$209
Suscríbete

Termina en:

2 Días
14 Hrs
53 Min
4 Seg

DNS Spoofing

12/33
Resources

How to amplify an AirPuffin attack with DNS spoofing?

In the fascinating and challenging world of computer security, one of the most critical aspects is to understand how certain attacks can be conducted to effectively protect ourselves. This article delves into how to extend an AirPuffin attack by implementing DNS spoofing attacks. Get ready to delve into advanced traffic infiltration and redirection techniques as we explain the methodology and steps involved in this process.

What is and how do I set up an attack environment in Kali Linux?

To begin with, it is vital to set up a controlled environment where you can safely execute attacks. Using Kali Linux, you are going to simulate a Man-in-the-Middle attack with a tool known as ettercap:

  1. Configure ettercap:

    • Start ettercap with the Unified option to use a single interface:
      ettercap -at eth0
      .
    • Stop conflicting processes before starting capture with ettercap --silent.
  2. Host scan:

    • Perform a scan to identify the IP addresses of devices present on the network segment.
    • Assign the target IP address as target 1 and the gateway IP as target 2.
  3. Initiate ARP attack:

    • Launch the ARP spoofing attack to intercept traffic between the client and the server.

How to configure a DNS spoof attack?

Once you have successfully intercepted the traffic, it is time to configure the DNS spoof attack, which will allow you to redirect the domains requested by the victim to IP addresses of your choice.

  1. Edit ettercap configuration files:

    • Modify the etter.dns file to specify the resolution of domain names you want to intercept:
      *.twitter.com TO 10.0.0.3*.facebook.com TO 10.0.0.3.
    • Make sure that the IP corresponds to that of your attacking machine.
  2. Configuration of permissions and privileges:

    • Verify that in the etter.conf file, the ec_uid and ec_gid values are set to zero to allow ettercap to run with administrator privileges:
      ec_uid = 0ec_gid = 0.
  3. Traffic redirection:

    • Enable traffic redirection so that traffic to the spoofed domain is answered by your own server in Kali Linux.

How to verify and adjust the spoofing operation?

To confirm that the attack is running successfully, a couple of additional actions and checks can be performed:

  1. Execute DNS queries from the victim machine:

    • Use tools to send DNS requests and verify that you are receiving the spoofed DNS traffic:
      dig @8.8.8.8.8 twitter.com
    • Check that the DNS response comes from the IP configured in etter.dns.
  2. Start an Apache web server:

    • Make sure you have an Apache server running to serve a fake web page when directing traffic to your server's IP address:
      sudo service apache2 start
      .
  3. Modify the web content:

    • Edit the default page to reflect the fake content you want to display to the user.

What can we learn and how to practice more?

The success of these attack tactics underscores the vital importance of computer security. To further deepen and practice, Platzi offers various courses in HTML, CSS, web design and Linux server administration. This will help you get better at not only building better fake web pages, but also at understanding the broader network and server infrastructure.

In addition, an interesting challenge would be to experiment with translating domain names for different IP addresses and different services. This practice may reveal subtleties and variations in behavior depending on the domain and network environment. Try different combinations and share your results and observations in the comments section!

Contributions 17

Questions 9

Sort by:

Want to see more contributions, questions and answers from the community?

DNS Spoofing en 2022:
En mi caso para que funcione el ataque tuve que realizar configuraciones extra para que Ettercap no crashee:

#Estando como sudo

#Cambiar "enp2s0" porel nombre de tu interfaz de red.
echo 0 > /proc/sys/net/ipv6/conf/enp2s0/use_tempaddr

#Habilitamos el reenvío de paquetes en el sistema. 
echo 1 > /proc/sys/net/ipv4/ip_forward

Tambien, en el archivo “/etc/ettercap/etter.conf” hay que descomentar las lineas de redireccion IPv6:

#---------------
#     Linux 
#---------------

   redir_command_on = "iptables -t nat -A PREROUTING -i %iface -p tcp -d %destination --dport %port -j REDIRECT --to-port %rport"
   redir_command_off = "iptables -t nat -D PREROUTING -i %iface -p tcp -d %destination --dport %port -j REDIRECT --to-port %rport"

# pendant for IPv6 - Note that you need iptables v1.4.16 or newer to use IPv6 redirect
   redir6_command_on = "ip6tables -t nat -A PREROUTING -i %iface -p tcp -d %destination --dport %port -j REDIRECT --to-port %rport"
   redir6_command_off = "ip6tables -t nat -D PREROUTING -i %iface -p tcp -d %destination --dport %port -j REDIRECT --to-port %rport"

Así y todo el ataque tiene problemas a la hora de spoofear paginas que tengan certificado SSL.

Yo creo que tendría que explicar un poco mas técnico lo que se esta haciendo.

“La suplantación de DNS, también conocida como envenenamiento por caché DNS, es una forma de piratería informática en la que se introducen datos corruptos del DNS en la caché del solucionador de DNS, lo que hace que el servidor de nombres devuelva un registro de resultados incorrecto, por ejemplo, una dirección IP. Esto da lugar a que el tráfico se desvíe al equipo del atacante (o a cualquier otro equipo).” Wikipedia.

Kali tiene herramientas que permiten crear una página identica a la que quieres suplantar

Hice los pasos en los archivos etter.dns y etter.conf exactamente como en el video, ademas de iniciar el servicio apache2. Cuando en la maquina de lubuntu inicio twitter o facebook, no se redirige a la pagina de apache de la maquina de kali… sino a la pagina oficial. Si alguien sabe porque o tiene algun consejo se lo agradeceria

hey listen! :v
-Confirmo un comentario de @Kevin Reyes, no se puede con paginas tan populares, es mas, ni tumblr y esa cosa esta bien abandonada.
intenten con paginas mas básicas/impopulares por cuestión de practica, pero si realmente lo quieren hacer buscaran 😃
-si ettercap se cierra en el momento que ponen la palomita del inicio, posiblemente siguieron la recomendación del compañero que sugiere cambiar el par de líneas de “etter.conf”, regrésenlas como estaban.

la herramienta SET Toolkit esta muy bien, clona una web para capturar las contraseñas

Cual seria una medida de control valida para impedir el dns Spoofing ?

Actualamente ettercap tiene otras configuraciones. Abajo o arriba mi compañero valentin explcia las configuracioenes.

DNS spoofing es un método para alterar las direcciones de los servidores DNS que utiliza la potencial víctima y de esta forma poder tener control sobre las consultas que se realizan.

Si no les sale el apache al entrar a la pagina, intenten poner una menos reconocida y menos segura que no se porque pero con las mas famosas no me permite hacer el fake

Me pare muy buen programa, pero seria aun mas completo si nos mostraras también la FORMA de como repeler este tipo de Ataques ARP.

actualmente casi no funciona para ningúna web, se ha mejorado mucho la seguridad desde entonces.

Increíble , hay que estar mas alertas a este tipo de ataques.

Hola Platzi, me pueden ayudar. Hice todos los pasos del profesor pero no me resulta.
Entre a mi maquina Kali, desde terminal 

dhclient -r eth0
dhclient eth0
Tengo salida con ping 8.8.8.8
Tengo respuesta con host www.platzi.com
Alcanzo mi maquina Ubuntu con un ping
Abrí ettercap en eth0
puse stop en ettercap
busque host (me detecto mi maquina Ubuntu y mi puerta predeterminada)
coloque Target 1 la maquina Ubuntu
Target 2 mi puerta predeterminada
inicie ARP poisoning desde MITM
habilite plugin de dns_spoof
fui a mi terminal y coloque gedit /etc/ettercap/etter.dns
Agregue el siguiente codigo
twitter.com      A   ipKali
*.twitter.com    A   ipKali
www.twitter.com  PTR ipKali     # Wildcards in PTR are not allowed


facebook.com      A   ipKali
*.facebook.com    A   ipKali
www.facebook.com  PTR ipKali     # Wildcards in PTR are not allowed

Luego coloque gedit /etc/ettercap/etter.conf
coloque el siguiente codigo
ec_uid = 0            # nobody is the default
ec_gid = 0                # nobody is the default

#---------------
#     Linux 
#---------------
   redir_command_on = "iptables -t nat -A PREROUTING -i %iface -p tcp -s %source -d %destination --dport %port -j REDIRECT --to-port %rport"
   redir_command_off = "iptables -t nat -D PREROUTING -i %iface -p tcp -s %source -d %destination --dport %port -j REDIRECT --to-port %rport"


Leí un comentario de la comunidad de Platzi en donde te dicen que intentes colocar la siguiente configuración. Lo hice, primero resetee los valores a default de los archivos etter.dns y etter.conf y luego apague mi maquina, volví hacer los pasos igual a los ya mencionados hasta este punto configure en la parte de Linux estos nuevos parametros. Y seguí igual con los siguientes pasos.

#---------------
#     Linux 
#---------------
redir_command_on = "iptable -t nat -A PREROUTING -i %iface -p tcp --dport %port -j REDIRECT --to-port %rport"

redir_command_off = "iptable -t nat -D PREROUTING -i %iface -p tcp --dport %port -j REDIRECT --to-port %rport"

Di start en attercap
Abrí wireshark desde Kali en eth0.

En ambas ocasiones continue los pasos pero al ingresar en la terminal de Ubuntu el comando host twitter.com
me arroja twitter.com has address 104.244.42.1
Ni siquiera me reconoce que redireccione a la ip de Kali. Continue con la clase pero me redirecciona al sitio oficial.


Les dejo las versiones que estoy usando.
ettercap 0.8.3
Debian 5.7.6-1kali2

Excelente clase

Excelente.