Programming, Hacking, Math, and Art

Recently, I was curious if I could generate a digital radio signal from scratch just using math, and use that signal to control this radio-controlled outlet that I have.

I want to be able to generate modulated digital signals such as this one...

This is a binary signal coded with On-off keying (also known as Amplitude-shift keying).

I'm taking the long pulses to mean "1" and the short pulses to mean "0", so this signal is transmitting the digital code, "0110100010000000".

In [2]:
# Imports and boilerplate to make graphs look better
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy
import wave
from ...

HackRF Replay Attack Jeep

I've recently been getting into Software-defined Radio (SDR), mostly using a HackRF - a radio tranceiver capable of operating from 1MHz to 6GHz (which is a huge range).

One of the most simple (and most interesting attacks) which can be done with SDR is what's called a Replay Attack. It works by simply recording a signal, and then rebroadcasting it. I was able to use this attack to lock and unlock my Jeep Patriot (2006) with my computer. Here's how...

First I recorded the "unlock" and "lock" signals from my keyless entry remote using this "flowgraph" in Gnu Radio Companion:

• The frequency is 315 MHz (the frequency at which pretty much all keyless entry)
• It records at ...

You can capture radio signals with Software-defined Radios (SDR), such as the HackRF. Gnu Radio is the main software I use for receiving and transmitting radio signals, but I've found Audacity, a program meant primarily for editing sound files, to be a great program for viewing and editing radio signals.

So I had these remote-controlled outlets (which I bought at Home Depot):

And I wanted to see what their wireless communication looked like...

So first I recorded the signals of the different outlets with this Gnu Radio Companion flowgraph:

• It records at around 315 MHz, the frequency at which the remote transmits (which I found by looking up it's FCC ID code online)
• It records 2 million samples ...

HackRF Setup OSX 2016

These are some pretty raw notes I took while installing the software for using a HackRF on OSX. This is the software I installed:

• gqrx

brew update

brew tap robotastic/homebrew-hackrf

brew install hackrf


This got GNU Radio and GNU Radio Companion installed, but then I needed to install the Osmocom Gnu Radio Blocks so that Gnu Radio could communicate with the HackRF.

brew install --HEAD gr-osmosdr