NUIT Attack (unable to work)

41 views (last 30 days)
Giovanni
Giovanni on 8 Nov 2024 at 8:01
Edited: Giovanni on 16 Nov 2024 at 6:17
One of the projects from a graduate course involves recreating a Near Ultrasound Inaudible Trojan (NUIT) as seen on the Near-Ultrasound Inaudible Trojan (Nuit): Exploiting Your Speaker to Attack Your Microphone | USENIX paper as well as NEAR ULTRASONIC ATTACK AND DEFENSIVE COUNTERMEASURES.
Reading the papers it seems all that must be done to achieve a NUIT is to do uppper band SSB-AM modulation with the carrier wave at a frequency of 16 Khz on a wav file that contains the commands aimed at a voice controlled system.
I have some code that does the ssb_mod as well as apply filtering and the TukeyWindow that the paper also describes.
I am unable to make the NUIT attack work on any voice controlled system. Why is this so?
Here is the webpage that shows how it should work.
% Parameters
input_file = 'hey_google(16).wav'; % Input WAV file
output_file = 'NUIT_hey(16).wav'; % Output WAV file
carrier_freq = 16000; % Carrier frequency fr SUSBAM (16 kHz)
lp_cutoff = 5000; % Low-pass filter cutoff frequency (Hz)
tukey_alpha = 0.5; % Tukey window taper ratio
% Step 1: Read the Input WAV File
[input_audio, fs] = audioread(input_file); % Read audio file
input_audio = input_audio(:, 1); % Ensure the audio is mono
disp(['Loaded input audio file with sampling frequency: ', num2str(fs), ' Hz']);
disp(['Audio length: ', num2str(length(input_audio)/fs), ' seconds']);
% Step 2: Low-Pass Filter the Input Audio
[b_lp, a_lp] = butter(6, lp_cutoff / (fs / 2), 'low'); % 6th-order Butterworth low-pass filter
filtered_audio = filter(b_lp, a_lp, input_audio); % Apply the filter
disp('Applied low-pass filter.');
% Step 3: Create a 90° Phase-Shifted Signal Using the Hilbert Transform
hilbert_transform = imag(hilbert(filtered_audio)); % Imaginary component (90-degree phase shift)
disp('Computed Hilbert transform.');
% Step 4: Generate Carrier Signals
t = (0:length(filtered_audio)-1)' / fs; % Time vector
carrier_cos = cos(2 * pi * carrier_freq * t); % Cosine carrier for original signal
carrier_sin = sin(2 * pi * carrier_freq * t); % Sine carrier for phase-shifted signal
% Step 5: Perform SUSBAM Modulation
susbam_signal = filtered_audio .* carrier_cos - hilbert_transform .* carrier_sin;
disp('Performed SUSBAM modulation.');
% Step 6: Apply a Tukey Window
tukey_window = tukeywin(length(susbam_signal), tukey_alpha); % Generate Tukey window
susbam_signal = susbam_signal .* tukey_window; % Apply Tukey window
disp('Applied Tukey window.');
% Step 7: Normalize and Convert to 16-bit PCM Format
susbam_signal = susbam_signal / max(abs(susbam_signal)); % Normalize to [-1, 1]
susbam_signal = int16(susbam_signal * 32767); % Convert to 16-bit integer PCM format
disp('Normalized and converted to 16-bit PCM format.');
% Step 8: Save the Modulated Signal as a New WAV File
audiowrite(output_file, susbam_signal, fs, 'BitsPerSample', 16);
disp(['Saved modulated audio to: ', output_file]);
% Visualization: Input Audio, Modulated Signal, and Spectrogram
figure;
% Plot the Input Audio Signal
subplot(3, 1, 1);
plot((0:length(input_audio)-1)/fs, input_audio);
title('Input Audio Signal');
xlabel('Time (s)');
ylabel('Amplitude');
% Plot the SUSBAM Modulated Signal
subplot(3, 1, 2);
plot((0:length(susbam_signal)-1)/fs, double(susbam_signal) / 32767);
title('SUSBAM Modulated Signal with Tukey Window');
xlabel('Time (s)');
ylabel('Amplitude');
% Display the Spectrogram of the Modulated Signal
subplot(3, 1, 3);
spectrogram(double(susbam_signal) / 32767, 1024, 512, 1024, fs, 'yaxis');
title('Spectrogram of the Modulated Signal');
disp('Visualization complete.');

Answers (0)

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!