What is HackRF? | GPS Spoofing with HackRF #1

Good day, Turk Hack Team family.
Today, I will talk to you about the HackRF device and how to perform GPS spoofing with HackRF.
This content has been prepared solely for educational purposes.
CF6Me3F.jpg

What is HackRF?
6OfL8I.gif

HackRF is a software-defined radio (SDR) device that can operate in a wide frequency range (1 MHz to 6 GHz). This device is capable of receiving and transmitting RF signals, including RF/IF or RFID/LF modulated signals, and digitizing and processing them.


This device possesses features such as analyzing, generating, and manipulating RF signals, allowing cybersecurity researchers and professionals to use it for tasks such as detecting, preventing, and analyzing cyberattacks.

As the Internet of Things (IoT) continues to gain popularity, HackRF can be used to analyze and conduct penetration testing on IoT devices. Additionally, it can be connected to other hardware like Raspberry Pi for the development of various projects.


There are several models of HackRF available, and since it is entirely open-source, you can opt for more affordable versions produced in China compared to the original. I will be demonstrating my tutorials using the HackRF One model.
wp4ixh8.png


Some potential vectors related to HackRF:

Capturing and analyzing drone control signals
Capturing and analyzing car key system signals
Capturing and analyzing GPS device data
Capturing and analyzing mobile phone data
Capturing and analyzing data from household appliances
Capturing and analyzing data from wireless headphones
Capturing and analyzing data from free Wi-Fi networks
Capturing and analyzing data from RFID systems
And many more... There are numerous possible vectors.

Is It Legal to Use HackRF?


6OfL8I.gif




As a HackRF user of four years, I remember when I first acquired this hardware and used to carry it in my backpack. I often wondered if it was illegal to possess this device. I contemplated this for quite some time. After conducting research, I couldn't find any direct sources or information related to HackRF and the laws. That's why I wanted to address this topic



343_1e534105-8677-4f29-a6b9-7c2d523f1726.png




It's important to note that broadcasting radio waves outside of specific frequency ranges is prohibited, not only with HackRF but with any hardware, my friends. Many activities, research, and analyses conducted with HackRF may require specific licenses. To use HackRF more freely and legally, you can obtain an Amateur Radio License. Amateur radio is a significant topic and a rewarding hobby. If you're interested, you can apply through the General Directorate of Coastal Safety and take the exams to obtain an Amateur Radio License.



The exams generally cover topics related to radio communication standards, basic-level electrical and electronic principles, and wireless communication. There are three different license classes: A/B/C. Depending on your exam score, you can obtain any one of these licenses. Class A licenses grant the broadest spectrum of operating privileges. Answers to the exam questions can be found online.






Q1ItWtN.png


Engaging in harmful activities is strictly prohibited.

An Amateur Radio License grants you privileges such as conducting research, analysis, and using frequencies. These privileges are solely for authorized purposes.

Due to its capabilities, HackRF is widely accepted and used by amateur radio enthusiasts worldwide.



GPS Spoofing Preparation


6OfL8I.gif


First and foremost, I must mention that there's a fresh and promising new Linux distribution called DragonOS. This distribution comes with a variety of SDR (Software-Defined Radio) tools pre-installed and provides services similar to what Kali Linux offers, specifically tailored for wireless devices. If you have HackRF or similar tools, or if you're interested in them, I recommend using DragonOS as a virtual machine.





eI21ZuA.png




To be able to mimic GPS signals, you'll need an antenna that can operate in the L1 band and work at a frequency of 1575.42 MHz. The antennas that come with HackRF when you purchase it should suffice for your needs.



GPS Spoofing


6OfL8I.gif




Firstly, we download the necessary software for HackRF. It is available by default in DragonOS.




Kod:
sudo apt install gnuradio libhackrf0 hackrf libhackrf-dev





After completing the installation, let's check our TCXO output.

TCXO (Temperature Controlled Crystal Oscillator) is a high-precision crystal oscillator used to enhance the accuracy of GPS systems.





Kod:
hackrf_debug --si5351c -n 0 -r




bM1Uc4K.png




From the terminal, we obtained the output: [ 0] -> 0x01, which indicates that it is working smoothly without issues.



Let's download and compile the GPS SDR SIM software from GitHub.





Kod:
git clone https://github.com/osqzss/gps-sdr-sim.git
cd gps-sdr-sim
gcc gpssim.c -lm -O3 -o gps-sdr-sim





oLMV6uc.png




Now, let's go to Google Maps and get the coordinates of the location where we want to generate GPS signals. Additionally, I should mention that gps-sdr-sim supports two different modes: static mode and dynamic mode. For the dynamic mode feature, you can create a CSV file and input your coordinates into it.





HYn2BQ9.png




I selected a location in Sweden and obtained its coordinates.



Then,



Kod:
./gps-sdr-sim -e brdc0010.22n -l 59.331646, 18.065687 -b 8




We start generating our GPS data with the command ./gps-sdr-sim -e brdc0010.22n -l latitude, longitude -b bit (default is 16).





BKnJgwZ.png




After the process is completed, a file named gpssim.bin will be created inside the folder. Then, we can broadcast the generated GPS signal to GPS receivers.



Kod:
hackrf_transfer -t gpssim.bin -f 1575420000 -s 2600000 -a 0 -x 0 -R 100




mYawhZu.png




Now, nearby phones have started capturing this GPS data. When I view my coordinates from my iOS phone, it appears as follows:



rONx3fc.png




You might ask, "Why does the location not appear in Sweden?" There is a straightforward reason for this. Phones verify their location by receiving GPS data from multiple satellites. In my current location, apart from the GPS signals I'm broadcasting, it also receives data from other satellites, which leads to this result.



Conclusion:




6OfL8I.gif




In this training content, we learned how to perform GPS spoofing with HackRF. I hope it has been helpful. In the future, whenever I find the time, I will continue to share different HackRF topics.



Have a great day!






Source : @Enistein https://www.turkhackteam.org/konular/hackrf-nedir-hackrf-ile-gps-spoofing-1.2032856/

11.png
 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.