How to Change a Phone's Coordinates by Spoofing Wi-Fi Geolocation Hotspots « Null Byte :: WonderHowTo

In many urban areas, GPS doesn't work well. Buildings reflect GPS signals on themselves to create a confusing mess for phones to sort out. As a result, most modern devices determine their location using a blend of techniques, including nearby Wi-Fi networks. By using SkyLift to create fake networks known to be in other areas, we can manipulate where a device thinks it is with anESP8266 microcontroller.For devices with limited access to GPS, Wi-Fi networks are a reliable way of finding out where a device is located. Hackers can exploit the flaw by broadcasting signals that appear to be from known networks. While the tactic doesn't work in areas with a lot of other Wi-Fi networks or a clear GPS signal, it works very well in sites that force smart devices to rely on aGPS.Don't Miss:Inconspicuously Sniff Wi-Fi Data Packets Using an ESP8266How Do Smart Devices Do Geolocation?The problem of locating a device is not new, and most smart devices have a range of options besides GPS for determining where it's located. It can involve things like cell phone towers, which do not move and are useful for determining the relative location of a user. As demand for fast GPS devices began to increase, Assisted GPS, or aGPS, became a way for devices to get around the long signal acquisition time it took to get a traditional GPS lock.To help with the problem of finding where a device with little or no GPS reception is, most smartphones continuously record the location of nearby Wi-Fi networks. These are added to a massive database of located networks that have been geolocated by multiple users, providing the information needed to determine where a device is by which Wi-Fi networks it can see.It shouldn't surprise anyone familiar withwardriving, as projects likeKismethave done so for quite some time. TheWigle.net projectlets hackers upload the data and determine where each network is located, making it easy to identify where a device might be if it comes in range of a network with a known location. The difference between aGPS and a traditional GPS lock is that with aGPS, a device will call an API to derive its position from the name, MAC address, and signal strength of nearby Wi-Fi networks compared against a known database of geotagged networks.Networks tagged with geolocation data on Wigle.net.How Do We Spoof aGPS?Now that we know how aGPS works, we can start looking for ways to abuse it. One of the most obvious ways is to simply find areas that rely more on aGPS than traditional GPS to determine a location. It can be anywhere that lacks a line of sight to the sky or deep inside buildings or parking garages where GPS signals cannot penetrate. Those conditions force smart devices to rely on less accurate data to find their geolocation, like any nearby Wi-Fi networks.Once we force smartphones into a condition where they are relying on aGPS more than GPS to determine their location, using a project called SkyLift, we can broadcast Wi-Fi beacon frames of networks with a previously logged geolocation to begin confusing the device. It will only work if there are few competing networks, as in a dense urban area, the results can range from moving around randomly to completely failing when real known networks are nearby.If we're in an excellent location to force phones to use aGPS to know where they are, we can also pick specific locations we want to spoof. To do so, we can either go to the site and record Wi-Fi traffic or use Wigle.net to query which networks are present at a location we want to spoof and then copy the network details.Don't Miss:Use an ESP8266 Beacon Spammer to Track Smartphone UsersWhat You'll NeedTo follow this guide, you'll need anESP8266-based microcontroller. It can be anything from aD1 Minito aNodeMCU, which can be found for very cheap online. For the MCU's setup, you'll need abreadboard,jumper wires,Micro-USB cable, and aWi-Fi antenna and SMA cable. I do not go over putting the MCU together since I have covered doing so inmany previous ESP8266 guides. Please refer to those if you need help or ask questions in the comments.D1 Mini Board:Buy on Amazon(Alt) |AliExpressOr a D1 Mini Board with Antenna:Buy on Amazon|AliExpressOr a NodeMCU Board:Buy on Amazon|AliExpressMicro-USB cable:Buy on Amazon|AliExpress(Alt)Breadboards:Buy on Amazon|AliExpressBreadboard jumper wires:Buy on Amazon(Alt)Antenna w/Cable (if not included with the board):Buy on AmazonImage by Kody/Null ByteYou'll also need an internet-connected computer with Arduino IDE installed. We'll use it to program the microcontroller, and the Micro-USB data cable is used to connect the ESP8266 to the computer for power and programming.Step 1: Add the ESP8266 Board to ArduinoWe will use the free and cross-platformArduino IDE, which will allow us to prototype what we need quickly. Arduino IDE (the IDE stands for "integrated development environment") will enable you to write and upload scripts to Arduino-like microcontroller devices easily.You candownload the Arduino IDE from the official website. Once it's installed, you'll need to click on the "Arduino" drop-down menu, then select "Preferences." Next, paste the following URL into the Additional Boards Manager URLs field.http://arduino.esp8266.com/stable/package_esp8266com_index.jsonOnce that's complete, click "OK" to close the menu.Next, you'll need to add the NodeMCU to the Boards Manager. Click on "Tools," then hover over the "Board" section to see the drop-down list. At the top, click "Boards Manager" to open the window that will allow us to add more boards.When the Boards Manager window opens, type "esp8266" into the search field. Select "esp8266" by "ESP8266 Community" and install it.You should be ready to program your ESP8266-based microcontroller now. Plug your ESP8266 into your computer. When you click on "Tools," you should see the correct port auto-selected.Select the "NodeMCU 1.0," or whichever ESP8266 you are using, from the "Board" menu. If you're using a bad USB cable, the port may not show up, so if you don't see anything after you've completed the other steps, try another cable first.There are two main buttons up top. The checkmark compiles and checks our code for mistakes, and the right arrow pushes the code to the NodeMCU.Step 2: Download SkyLiftNow that we have Arduino IDE set up, we'll need to download the SkyLift demo. We can cloneits GitHub repositoryby typing the following into a new terminal window.~$ git clone https://github.com/adamhrv/skylift.gitOnce it has completed, we can change directories into the folder that was downloaded and open the sketch in Arduino IDE.~$ cd skylift
~$ cd skylift_demo/
~$ open skylift_demo.inoHere, you'll see configuration files as well as the main script.For our demo, we won't be modifying it. We can plug in our ESP8266 and, provided we see the LED on it flash, move on to the next step.Step 3: Push the Code to the ESP8266Now, it's time to push our code to the ESP8266, which should be plugged in via a Micro-USB cable to our computer running Arduino IDE.Make sure that the correct board is selected in Arduino and that the port is set to the right interface for the ESP8266. Once you're sure the settings are correct, you can click the arrow icon to upload the code to your ESP8266-based board. It shouldn't take long, and when it's complete, you should see several open networks being broadcast nearby.In our example, the open networks are the signals we are spoofing, as they are known networks that have been geolocated to Facebook's headquarters. If we can put a smart device in a position where it has only those signals to determine it's likely location, we can trick it into believing it's near the networks at Facebook's HQ instead of its actual location.Step 4: Test the Demo in a Suitable LocationOnce you've pushed the code to the ESP8266, it's time to test it out in a good location. You can useWigle WiFion Android to measure the number of nearby networks and hunt for places with poor reception of other networks. Once you find a location with lousy GPS reception, turn off the geolocation services on your phone, and then turn them back on again.When your phone attempts to locate itself, it will have only the spoofed signals from the ESP8266 to rely on. Because these aren't reliable, it should determine its location as Facebook HQ.The location should be encoded into photos taken with geolocation enabled, suggested by apps the target is using, and it will persist until you stop broadcasting spoofed networks or the target gets a good signal from a GPS satellite or a legitimate nearby network with a known location.A-GPS Is Easy to Spoof in the Right AreasSmart devices have many ways of determining their location, and hackers can use them to create a situation where a device will rely on false information. It has been used for everything from art projects in which devices are spoofed, to the pools of the rich and famous, to situations where manipulating directions could give hackers an advantage. While it may not be an issue in every environment, be extra wary of GPS locations that are derived deep inside buildings or other areas that force devices to rely on easily spoofed signals.I hope you enjoyed this guide on spoofing aGPS locations using an ESP8266 microcontroller! If you have any questions about this tutorial on spoofing aGPS with Arduino, please ask below. And if you have a comment or idea for a future episode, feel free to reach me on Twitter@KodyKinzie.Don't Miss:Stealing Wi-Fi Passwords with an Evil Twin AttackWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Kody/Null ByteRelatedHow To:Share Your Windows 8 PC's Internet with a Phone or Tablet by Turning It into a Wi-Fi HotspotHow To:Automatically Connect to Free Wi-Fi Hotspots (That Are Actually Free) on Your Samsung Galaxy Note 2How To:Find & Share Local Wi-Fi Passwords for Free Internet Everywhere You GoHow To:Turn on Google Pixel's Wi-Fi Assistant to Get Secure Access on Open NetworksWiFi Prank:Use the iOS Exploit to Keep iPhone Users Off the InternetHow To:Hack WiFi Passwords for Free Wireless Internet on Your PS3Hacking Android:How to Create a Lab for Android Penetration TestingHow To:Turn your Motorola Droid 3 smartphone into a mobile Wi-Fi hotspotHow To:What All the Bluetooth & Wi-Fi Symbols Mean in iOS 11's New Control Center (Blue, Gray, or Crossed Out)How To:Save Battery Power by Pairing Wi-Fi Connections with Cell Tower Signals on Your Galaxy Note 3How To:USB Tether Your Android Device to Your Mac—Without RootingHow To:Save Cellular Data by Using Wi-Fi Only for FaceTime Audio & Video CallsHow To:Convert a Wi-Fi Apple iPad into a 3G iPad with MiFiHow To:Having Connection Issues on Android Pie? Turn Off 'Turn on Wi-Fi Automatically'How To:Hack Open Hotel, Airplane & Coffee Shop Wi-Fi with MAC Address SpoofingHow To:Get the Strongest Wi-Fi Connection on Your Android Every TimeHow To:Share Your iPhone's Internet Connection with Other DevicesHow To:Fix the Wi-Fi Roaming Bug on Your Samsung Galaxy S3How To:PAIRS Is the Easy Way to Restore Wi-Fi & Bluetooth Connections After Wiping Your PhoneHow To:Connect to Protected Wi-Fi Hotspots for Free Without Any PasswordsNews:Opera's Android Browser Just Got Native Ad-BlockingHow To:Fake Your GPS Location on Android to Trick Apps & Targeted AdsHow To:The Beginner's Guide to Defending Against Wi-Fi HackingHow To:Turn your Motorola Droid Bionic smartphone into a mobile Wi-Fi hotspotHow To:Your iPhone's Using More Data Than It Needs, but This Could Stop ItNews:Project Zero Finds iPhone & Android Open to Bugs in Broadcom's Wi-Fi ChipsHow To:Check Wi-Fi Reliability & Speed at Hotels Before Booking a RoomHow To:iOS 6 Broke Your Wi-Fi? Here's How to Fix Connection Problems on Your iPhone or iPadHow To:Find Saved WiFi Passwords in WindowsAndroid Basics:How to Connect to a Wi-Fi NetworkHow To:Enable Free WiFi Tethering on Android MarshmallowHow To:Easily Share Your Complicated Wi-Fi Password Using Your Nexus 5How To:Stop Retail Stores from Tracking You While Shopping with Your Galaxy Note 3How To:This DIY WiFi-Detecting 'Sting' Blade Is Perfect for Any Hobbit Looking for a HotspotHow To:Auto-Toggle Your Android Device's Wi-Fi On and Off When Near or Away from a HotspotHow To:Hack Anyone's Facebook, Twitter or YouTube Account with Your Android DeviceHow To:Get Free Wi-Fi from Hotels & MoreHow To:Get Free Wi-Fi Through Facebook's New Hotspot Check-In ProgramHow To:Change Your Android Device's Wi-Fi Country Code to Access Wireless Networks AbroadHow To:Use Your Chromecast Without WiFi