Get a Pentest and security assessment of your IT network.

Cyber Security

Fix BadUSB Attacks

TL;DR

BadUSB attacks reprogram your USB device to act like a keyboard or network adapter, potentially taking control of your computer. This guide shows you how to detect and mitigate these threats.

Detecting BadUSB Devices

  1. Visually Inspect the Device: Look for physical tampering. A modified USB device might have unusual markings or openings.
  2. Check Device Manager (Windows):
    • Press Win + X and select ‘Device Manager’.
    • Look for unknown devices, especially those with yellow exclamation marks.
    • Expand ‘Human Interface Devices’ and ‘Network adapters’ to check for suspicious entries.
  3. Use USB Device Tree Viewer (Windows): This tool provides detailed information about connected USB devices.
    • Download from USBView.
    • Run the application as administrator.
    • Examine the device descriptors for inconsistencies or unexpected manufacturer/product IDs.
  4. Scan with Anti-Malware Software: Run a full system scan with up-to-date anti-malware software. Some solutions can detect BadUSB payloads.

Mitigating BadUSB Attacks

  1. Disable Autorun (Windows): This prevents malicious scripts from automatically running when a USB device is connected.
    • Open ‘Control Panel’ and search for ‘AutoPlay’.
    • Uncheck ‘Use AutoPlay for all media and devices’.
    • Alternatively, disable autorun specifically for removable drives via Group Policy (gpedit.msc) under Computer Configuration > Administrative Templates > Windows Components > AutoPlay Policies.
  2. Restrict USB Access: Control which USB devices are allowed to connect to your computer.
    • Group Policy (Windows Pro/Enterprise): Configure USB storage access policies under Computer Configuration > Administrative Templates > System > Removable Storage Access. You can deny execute access or completely disable all removable storage.
    • Third-Party Software: Use software that allows you to whitelist specific USB devices based on their VID (Vendor ID) and PID (Product ID).
  3. Keep Your System Updated: Regularly update your operating system and security software to patch vulnerabilities.
  4. Be Careful with Unknown Devices: Avoid connecting USB devices from untrusted sources. Always scan them before use.
  5. Firmware Updates (If Available): If the USB device manufacturer provides firmware updates, install them to address potential security flaws.
  6. BIOS/UEFI Settings: Some BIOS/UEFI settings allow you to disable USB boot or restrict USB access at a hardware level. Check your motherboard documentation for details.

Advanced Detection (Linux)

  1. lsusb command: Use the lsusb command in the terminal to list connected USB devices and their IDs.
    lsusb

    Compare the output with known good device information.

  2. dmesg command: Check the kernel message buffer for suspicious activity related to USB devices.
    dmesg | grep usb
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation