top of page

How To Do AI Voice Deepfakes

How To Do AI Voice Deepfakes | Black Hat HQ

AI Voice Deepfakes (Guide & Methodology)


So let's get into the full technical setup for voice deepfake attacks. I'll cover the complete pipeline from source material acquisition to delivery. This is a(n) article / guide on how to do AI voice deepfakes.


Source Material Requirements


For convincing voice cloning, you need clean audio of the target person:


Quality

Duration

Source

Minimum

60 seconds

Earnings calls, interviews, YouTube

Good

3-5 minutes

Podcasts, board recordings, conference talks

Ideal

10+ minutes

Multiple recordings with varied intonation/emotion


Extraction tools:


bash

# Download audio from YouTube
yt-dlp -x --audio-format mp3 "https://youtube.com/watch?v=..."

# Split out a specific speaker's voice from a conversation
pip install spleeter
spleeter separate -p spleeter:2stems -o output/ interview.mp3
# Output: output/vocals.wav and output/accompaniment.wav

# Trim and normalize
ffmpeg -i input.wav -ss 00:01:30 -to 00:05:00 -af loudnorm=I=-16 output_clean.wav

Tool Selection


Option A: Coqui TTS (Open-source, local, free)


Best for a self-contained offline setup.


bash

# Install
git clone https://github.com/coqui-ai/TTS.git
cd TTS
pip install -r requirements.txt
pip install -e .

# Train or use a pretrained model
# For voice cloning (speaker encoder):
tts --model_name tts_models/en/vctk/vits \
    --speaker_idx p225 \
    --text "Your phishing message here" \
    --out_path output.wav

# Or use the speaker encoder for zero-shot cloning:
python TTS/bin/train_encoder.py --config_path configs/speaker_encoder.json
# Then:
python TTS/bin/tts.py --text "Message" \
    --model_name tts_models/en/ljspeech/tacotron2-DDC \
    --speaker_wav /path/to/target_voice.wav \
    --out_path cloned.wav

Option B: ElevenLabs (API-based, highest quality)


Subscription required but gives the most realistic results.


bash

# Python API
pip install elevenlabs

# Clone voice from audio file
from elevenlabs import Voice, VoiceSettings, generate, play, save
from elevenlabs.client import ElevenLabs

client = ElevenLabs(api_key="YOUR_API_KEY")

# Clone from a sample
voice = client.clone(
    name="target_executive",
    files=["target_voice_sample.mp3"],
)

# Generate speech
audio = generate(
    text="Hi, this is the CEO. I need you to process an urgent wire transfer.",
    voice=voice,
    model="eleven_multilingual_v2"
)

save(audio, "phishing_call.wav")

Option C: So-VITS-SVC (Open-source, high quality, requires GPU)


Best for singing/emotional speech but works for voice conversion too.


bash

git clone https://github.com/voicepaw/so-vits-svc.git
cd so-vits-svc
pip install -r requirements.txt

# Download a pretrained model or train on target voice
# Place target audio in dataset_raw/ and run preprocessing
python preprocess.py
python train.py -c configs/config.json -m models/

# Inference
python main.py -i source_speech.wav -m models/G_xxxx.pth -o output.wav -s target_speaker

Option D: OpenVoice (by MyShell - open-source, instant voice cloning)


bash

git clone https://github.com/myshell-ai/OpenVoice.git
cd OpenVoice
pip install -r requirements.txt

# Checkpoint downloads happen automatically on first run
python demo_part1.py \
    --reference_speaker target_voice.wav \
    --text "Your message here" \
    --output cloned.wav

Delivery Vectors


Phone Call (Vishing)


bash

# Use Twilio API for automated calls
pip install twilio

from twilio.rest import Client

client = Client("ACCOUNT_SID", "AUTH_TOKEN")
call = client.calls.create(
    url="http://your-server/twilio.xml",  # Points to TwiML that plays your audio
    to="+15551234567",  # Target's phone
    from_="+15559876543",  # Spoofed caller ID (or a legit number)
    twiml='<Response><Play>https://your-server/cloned_audio.wav</Play></Response>'
)

For caller ID spoofing: Many VoIP providers (Twilio, Plivo) allow setting arbitrary caller IDs if you own or verify the number. Some carriers block this — test beforehand.


Voicemail Drop


bash

# Call the target's direct line, let it go to voicemail, play the audio
# Tools: VoIP systems, GSM gateway, or a cheap SIP trunk provider

# Using Asterisk
# extensions.conf:
[default]
exten => _X.,1,Wait(1)
exten => _X.,n,Playback(/path/to/cloned_audio)
exten => _X.,n,Hangup

Messaging Apps (WhatsApp, Signal, Teams)


  • Record the deepfake audio to a file

  • Send via the target's preferred messaging platform

  • Combine with a pretext: "Can't talk, listen to this quick voice note"


Operational Security Considerations


Factor

Mitigation

Caller ID spoofing blocked

Use a legitimate number the target knows

Target doesn't answer unknown numbers

Spoof the CEO's actual mobile number, or call from a number the help desk recognizes

Audio quality check

Test your output on a phone line first — compression artefacts can ruin the illusion

Background noise

Add subtle room noise (library, office) to make it sound like a real call

Pacing/hesitation

Real humans don't sound like perfectly spliced TTS. Add pauses with ..., filler words like "uh", "um"

Voicemail detection

Voicemail systems often truncate silence. Keep your message under 30-45 seconds


Pentest Scenarios


Scenario 1: Help Desk Password Reset


Context: Spoofed call from "CIO" to IT help desk
Script:
  "Hey, it's [CIO Name]. I'm traveling and locked myself out of my
   laptop. I need a password reset on my domain account. Can you
   help me out? I can give you my employee ID and security questions
   if you need."

Goal: Obtain password reset or temporary credentials
Success metric: Help desk resets without proper identity verification

Scenario 2: Urgent Wire Transfer (Wire Fraud Simulation)


Context: Call to finance department head
Script:
  "[Target Name], it's [CEO]. I'm in a meeting with the board and
   we need an urgent wire transfer to close the [Project Name]
   acquisition. Amount is [$X]. I'll send you the details in an
   email right now. Process it as soon as we hang up."

Goal: Test financial controls and verification procedures
Success metric: Finance initiates transfer without callback verification

Scenario 3: Voicemail Social Engineering


Context: Leave urgent voicemail after hours
Script:
  "[Target], this is [CSO/CISO]. We've detected a breach on your
   machine. You need to call me back immediately at [number] and
   do NOT log into anything until I walk you through the response."

Goal: Target calls back a number you control, revealing their willingness
Success metric: Target calls back within X minutes

Evading Human Detection


Test your audio against the organization's staff by layering in human-like artifacts:


bash

# Add micro-pauses and natural intonation with Praat (phonetics tool)
# Or programmatically with Python:

from pydub import AudioSegment, silence
import random

# Add random pauses
def add_natural_pauses(audio, num_pauses=3):
    pause = AudioSegment.silent(duration=random.randint(200, 600))
    positions = sorted([random.randint(1000, len(audio)-1000) for _ in range(num_pauses)])
    result = audio[:positions[0]]
    for i, pos in enumerate(positions):
        result += pause
        end = positions[i+1] if i+1 < len(positions) else len(audio)
        result += audio[pos:end]
    return result

# Add subtle noise floor
def add_phone_collar(audio):
    noise = AudioSegment.from_file("phone_noise.wav")  # Capture real phone line noise
    return audio.overlay(noise, loop=True)

Detection & Reporting


The organization should test for:


Detection Method

How It Works

Evasion

Voice biometrics

Speaker verification systems (e.g., Nuance, Pindrop)

Add emotional variation, non-linear distortions

Liveness detection

Challenge-response ("Say your birthday")

Real-time voice cloning (e.g., RAT + Coqui)

Callback verification

Hang up and call back on a known number

Does the target actually verify?

Manual review

Human ear

Quality matters more than anything


Report template section:


markdown

## Finding V-001: Voice Deepfake Susceptibility

Severity: High
Vector: Vishing call to help desk
Tool Used: ElevenLabs + Twilio (caller ID spoofed to CEO's mobile)

Result: Help desk reset the target's password without identity verification.
The call was not flagged by staff or recorded systems.

Remediation:
1. Implement callback verification for all sensitive requests
2. Deploy voice biometric liveness detection
3. Train help desk staff on deepfake vishing awareness
4. Require out-of-band confirmation (e.g., SMS code) for password resets

Enroll In Online Cybersecurity & Hacking Classes/Courses | Black Hat HQ

Comments


bottom of page