This article details the process of setting up some localized flight tracking on CSI Linux using a Software Defined Radio (SDR), decoding the aircraft's Automatic Dependent Surveillance–Broadcast (ADS-B) transmissions, and correlating the data on to a map using Virtual Radar Server.
ADS-B
https://en.wikipedia.org/wiki/Automatic_Dependent_Surveillance%E2%80%93Broadcast
"Automatic Dependent Surveillance–Broadcast (ADS-B) is an aviation surveillance technology ... in which an aircraft determines its position via satellite navigation ... and ... broadcasts its position and other related data, enabling it to be tracked. The information can be received by ... ground-based ... receivers"
https://www.navcanada.ca/en/air-traffic/space-based-ads-b/ads-b-performance-requirements.aspx
SDR
https://en.wikipedia.org/wiki/Software-defined_radio
"Software-defined radio (SDR) is a radio communication system where components that conventionally have been implemented in analog hardware ... are instead implemented by means of software on a computer or embedded system."
Basically, using this setup, we will be able to track "local" aircraft using ADS-B, the GPS location (and other) data that the aircraft are broadcasting. I've seen it referred to as a "radar" before, but while this setup allows us to "track" aircraft, similar to radar, we're not sending out any "pings" that reflect off the aircraft itself and return to us; we're passively listening in on a radio station and the aircraft broadcasting it's location and data. Using this setup, I have been able to "see" aircraft over 200 KMs away (that's about 125 miles for you Americans), but it all depends on altitude and that radio transmission; I have also been unable to see closer aircraft, but lower and "behind" a mountain. It's also worth noting that NOT all aircraft require ADS-B transmitters. Military aircraft are a simple example (though some do). But, depending on the precise nature of the aviation laws in your jurisdiction, others too. For example, here in Canada, a private aircraft that does not surpass 3,800 Meters (12,500 feet) in height and does not cross any international borders (like a small bushplane and flight) does not require ADS-B. It's pretty safe to say that most/all International flights DO have ADS-B. So depending on the precisely who/what/where/why you are looking for, it might not be visible to this solution.
Equipment Needed
- CSI Linux (CSIL) installed on a laptop
- USB SDR Dongle + Antenna
- There are many, I am specifically using:
- https://www.nooelec.com/store/sdr/sdr-receivers/nesdr-mini.html
- Unobstructed access to the sky
- Optional: Altitude or Height. The higher* up you can place the antenna and receiver, the better.
*Note: Lightning can wreak havoc on such sensitive equipment. It doesn't even need to be a direct strike to damage receivers. So if you are placing this outside or anywhere else lightning may strike, be sure to take proper precautions. A rooftop could be idea in terms of height and lack of obstructions, but you will need to consider lightning arresters and proper shielding and isolation.
The Initial Setup
The Ideal Setup would have CSI Linux installed on actual laptop hardware, not just in a VM. Technically speaking, a VM COULD work just fine, but there may be additional concerns passing the USB attached SDR through the host OS and in to the CSI Linux VM. We're also going with a laptop here as we need access to the sky. It can sometimes work on a higher level residential building (not as much concrete ans steel) , but your milage will vary. Suffice to say, you won't be plugging in the USB SDR in to a VM server deep in your server room or basement or something like that.
I have managed to get CSI Linux installed on a laptop, but I'm not super fond of my process... I hope to eventually sort something out a bit better, a bit more explicitly in-line with the Official CSI Linux documentation. I mean, it's not like it's all that far off, but it still requires non-CSIL stuff so it's not quite "perfect". But I am also mid-work on a couple other projects tangential and parallel to this, and the real focus of this article is on the ADS-B setup, so we're not going to spend too much time on this here. But in the meantime, here's the higher level point-form approach I took in case it has any significant impacts later on in your work.
- Ventoy USB, boot live Kali
- USB2, uncompressed CSIL bootable image
- In Kali, open Disks
- Laptop HDD, remove all existing partitions
- Restore image, select CSIL, restore to laptop HDD
- Reboot in to CSIL
- gparted, grow HDD
- Update (apt & powerup)
- Reboot
Virtual Radar Server
https://www.virtualradarserver.co.uk/
Sure, we could JUST listen in to the ADS-B broadcasts and log them, but where's the fun in that? I mean, we "know" where these aircraft are according to GPS coordinates, but where in realspace does that work out to? Virtual Radar Server (VRS) gives us that solution. It takes the ADS-B data and puts it out on to a map and serves it up in a webpage, all prettied up.
I've manually done all the work to set this up a few times before, but there's a lot of room for error and it's a generally painful process for mediocre results in comparison. And then I stumbled across this little project here:
https://github.com/mypiaware/virtual-radar-server-installation
And wow. Just wow. It takes a process I would pay to avoid going through again (not just the install process itself, but all the extras), and makes it as simple as answering a few prompts. And the end results are far more superior than anything I've been able to accomplish (not in the main parts, but the fine details, the extras). So rather than indulge in our masochistic tendencies, let's just make life easy for ourselves this time.
We just start the VRS install process as per their documentation:
bash -c "$(wget -qO - https://github.com/mypiaware/virtual-radar-server-installation/raw/master/virtual_radar_server_install.sh)"
We will need to be careful with our answers and selections though, not all options available work flawlessly on all OSes.
Use the following answers for the install prompts:
- Version, select "3. Preview 3.xxx"
- Yes to all extra downloads
- Yes to fix libpng warning
- Port Number: default 8090
- Language: Your choice (4 for me)
- Optional longitude and latitude: (this is for the WebUI map) Enter your location.
- Add receiver: yes
- Name: SDR Dongle
- Data Source: 1
- IP Address: 127.0.0.1
- Port: 30005
Let the install process complete. Note the cronjobs in the final outputs, enter them in another bash window/tab. Run command:
sudo crontab -e
Enter the following:
0 3 * * * /usr/bin/bash "/home/jon/VirtualRadarServer/VRS-Extras/Databases/DatabaseBackup/backupvrsdb.sh"
*/1 * * * * /usr/bin/bash "/home/jon/VirtualRadarServer/VRS-Extras/Watchdog/vrs_watchdog.sh"
Save and exit.
Next, run command “vrs -webadmin” to set a WebAdmin username and password (use csi/csi, just like the base OS CSIL).
Then run command "vrs -enable" to configure VRS to start on boot.
Poweroff the laptop, plug in your USB SDR, and then power it back on. We don't need to power off the laptop to plug in the SDR, but we need to go through the whole boot process with the SDR plugged in to make sure everything initializes properly. Once we're booted back up, open a web browser and go to:
http://127.0.0.1:8090/VirtualRadar/desktop.html
Et Voila, if your SDR is receiving any ADS-B data, you should start seeing aircraft info. If you are not, there are either just no aircraft broadcasting ADS-B in range (I live within range of an international airport, this happens), or your receiver/antenna is too obstructed. Refer to the VRS website, documentation, and forums for further assistance if required.
And that's it. If all you wanted to do was set something up to quickly start gathering data, you are ready to go. BUT, we can take it a few steps further. As previously mentioned, BEST results for this have you putting the receiver and antenna (and ostensibly the laptop itself) up high, and maybe not the most physically comfortable position. You can easily make the laptop and services remotely accessible, that way you can, for example, leave the SDR laptop in a weatherproof enclosure on top of a building, and yourself be inside on another device (even your phone), accessing and viewing the WebUI and data. If this is of interest to you, check out my article on my CSI Linux Post-Install qualify of life improvements over here:
https://jonmoore.duckdns.org/index.php/forensics/124-csi-linux-2023-2-post-install
And be sure to review the "Remote Accesses" section.
EXTRA BONUS
Do you hate dictators? I sure do. Want to help track the aircrafts of authoritarian regimes? Check out the Dictator Alert project:
All you need to do is feed your captured ADS-B data up in to the ADSBExchange:
https://www.adsbexchange.com/ways-to-join-the-exchange/existing-equipment/
It's as simple as running the following commands:
curl -L -o /tmp/axfeed.sh https://www.adsbexchange.com/feed.sh
curl -L -o /tmp/axstats.sh https://www.adsbexchange.com/stats.sh
sudo bash /tmp/axfeed.sh
sudo bash /tmp/axstats.sh
DONE!