What is Bashlite?
Bashlite (also known as Gafgyt, Qbot, Lizkebab, or Torlus) is a Linux-based malware family discovered in September 2014 that targets Internet of Things (IoT) devices to build devastating distributed denial-of-service (DDoS) botnets. The source code of Bashlite was leaked online in 2015, which led to the creation of many variants by different cybercriminal groups. This open availability made Bashlite one of the most widespread IoT malware families.
How Bashlite works:
- Scans for vulnerable internet-connected devices: Probes exposed IoT and Linux systems for reachable services such as Telnet and SSH.
- Exploits default and weak credentials: Tries common usernames and passwords or known vulnerabilities to gain remote access.
- Downloads the malware payload: Retrieves a device-compatible Bashlite binary or script from attacker-controlled infrastructure.
- Connects to command-and-control servers: Establishes communication with remote servers so operators can manage the infected device.
- Receives and executes attack commands: Waits for instructions to launch DDoS attacks, update malware, or perform other malicious actions.
- Adds compromised devices to a botnet: Enrolls each infected system into a remotely controlled network that can act at scale.
Prevention measures:
- Replace default usernames and passwords: Use unique, strong credentials on every IoT and network device.
- Disable unnecessary Telnet and remote access: Turn off insecure or unused management services and use protected alternatives where remote administration is required.
- Keep firmware and software updated: Apply vendor patches promptly to close vulnerabilities used by Bashlite variants.
- Restrict internet access to management interfaces: Allow administrative access only from trusted networks, VPNs, or approved IP addresses.
- Segment IoT devices from critical networks: Place IoT systems on separate VLANs or network zones with tightly controlled communication.
- Monitor devices for abnormal traffic: Detect unusual scanning, outbound connections, or traffic spikes that may indicate compromise.
This is part of a series of articles about bot protection.
In this article:
Bashlite poses risks because it targets devices that are often overlooked from a security standpoint. Many IoT devices lack protections such as strong authentication or regular security updates, making them easy targets. Once compromised, these devices can be remotely controlled without the owner's knowledge, turning everyday appliances into tools for cyberattacks. A single Bashlite infection can quickly spread across thousands of devices.
The consequences of a Bashlite-driven attack extend beyond the infected devices. Botnets created by Bashlite have been used to disrupt online services, impact critical infrastructure, and cause financial losses to businesses. The scale and automation of these attacks make them difficult to stop once underway. The presence of Bashlite on a device often goes unnoticed, allowing attackers to maintain long-term control and repeatedly exploit compromised systems.
Related content: Read our guide to bot attacks.
1. Scans for Vulnerable Internet-Connected Devices
Bashlite begins its attack by scanning the internet for devices that are accessible over common network ports, such as Telnet or SSH. These scans are automated, enabling the malware to identify potential targets quickly. Devices with open ports and minimal security are vulnerable, as Bashlite can attempt to connect and probe for weaknesses.
The scanning process often targets device types known to have weak or default credentials and outdated firmware. By focusing on these groups, the malware increases its chances of successful infection. The distributed nature of these scans, often performed by compromised devices, makes it difficult for defenders to block or trace the initial source of the attack.
2. Exploits Default and Weak Credentials
After identifying a target, Bashlite attempts to gain access by exploiting default or weak login credentials. Many IoT devices are shipped with preset usernames and passwords, which users frequently fail to change. Bashlite uses brute-force techniques, cycling through common credential combinations to gain unauthorized entry.
Once it logs in, Bashlite can execute commands on the device, paving the way for further compromise. The reliance on weak credentials is a primary reason for the malware's effectiveness, as it requires no sophisticated exploits, only the ability to guess or know factory-default passwords. This approach remains effective due to poor security practices across many IoT deployments.
3. Downloads the Malware Payload
Once access is gained, Bashlite downloads its main malware payload onto the compromised device. This is typically done using shell commands that retrieve malicious binaries from attacker-controlled servers. The downloaded files are often tailored to the device's architecture.
The payload is then executed, embedding Bashlite into the device's operating system. The malware may attempt to ensure persistence by modifying startup scripts or hiding its processes. This allows Bashlite to survive device reboots and continue operating without detection, making removal more challenging without a complete device reset or firmware update.
4. Connects to Command-and-Control Servers
After installation, Bashlite connects to a remote command-and-control (C2) server operated by the attacker. This connection allows the attacker to manage the infected device, issue commands, and coordinate actions such as DDoS attacks. Communication is typically maintained over standard internet protocols, making it difficult to distinguish from legitimate device traffic.
The C2 infrastructure is often decentralized, with multiple backup servers to maintain control if some servers are taken offline. This structure makes it difficult for defenders to disrupt Bashlite's operations. The C2 channel also allows attackers to push updates to the malware or switch tactics.
5. Receives and Executes Attack Commands
Once linked to the C2 server, Bashlite-infected devices wait for instructions from the attacker. The most common command is to participate in DDoS attacks, where each device sends traffic to a designated target. Bashlite supports several attack types, including TCP, UDP, and HTTP floods.
The ability to execute commands remotely also allows attackers to update the malware, install additional payloads, or pivot to new targets. This flexibility enables ongoing exploitation and adaptation to security countermeasures. The device owner typically remains unaware that their hardware is being used for malicious activity.
6. Adds Compromised Devices to a Botnet
Each infected device becomes part of a larger botnet, a network of compromised systems under unified control. Bashlite botnets can range from a few hundred to hundreds of thousands of devices. The collective power of these devices enables attackers to launch high-volume attacks capable of overwhelming well-defended targets.
The distributed nature of the botnet increases its resilience. If some devices are cleaned or taken offline, the remaining nodes can continue operating. Bashlite botnets are often rented to other criminals, creating a black-market ecosystem where access to compromised devices is monetized. This model supports the continued spread of Bashlite across the internet.
Dhanesh Ramachandran
Dhanesh is a Product Marketing Manager at Radware, responsible for driving marketing efforts for Radware Bot Manager. He brings several years of experience and a deep understanding of market dynamics and customer needs in the cybersecurity industry. Dhanesh is skilled at translating complex cybersecurity concepts into clear, actionable insights for customers. He holds an MBA in Marketing from IIM Trichy.
Tips from the Expert:
In my experience, here are tips that can help you better defend IoT and Linux environments against Bashlite:
1. Baseline outbound behavior per device class: Build network baselines by device model and function, not just by subnet. A camera suddenly initiating connections to dozens of unrelated internet hosts is a much stronger signal when compared with its peers.
2. Control egress as aggressively as ingress: Many defenses concentrate on preventing initial access. Restrict IoT devices to explicitly required DNS, NTP, update, telemetry, and application destinations so a successful compromise has difficulty reaching C2 or retrieving secondary payloads.
3. Sinkhole unexpected DNS traffic: Force IoT DNS through controlled resolvers and block direct DNS to the internet. Logging newly observed domains and unusual resolution patterns can expose C2 changes before traffic-volume alerts detect an attack.
4. Treat architecture probing as an indicator: Bashlite deployment infrastructure commonly has to accommodate multiple embedded CPU architectures. Commands or requests associated with identifying ARM, MIPS, x86, or other architectures can therefore provide valuable detection opportunities during the post-compromise stage.
5. Use device-class allowlists for protocols: Instead of asking whether an IoT connection is generally suspicious, define exactly which protocols each device class should initiate. A CCTV camera initiating IRC-like, arbitrary TCP, or unexpected HTTP communications deserves immediate investigation even at low volume.
Bashlite primarily targets internet-connected devices that run Linux-based operating systems and expose remote management services. Attackers focus on devices with weak security settings, default credentials, or outdated firmware because they can often be compromised without exploiting software vulnerabilities:
- Home routers: Frequently targeted because many use default usernames and passwords or outdated firmware.
- IP cameras and CCTV systems: Common targets due to poor security configurations and internet exposure.
- Digital video recorders (DVRs): Widely attacked because many models ship with factory-default credentials that users never change.
- Network-attached storage (NAS) devices: Targeted when remote management services such as Telnet or SSH are enabled and protected by weak credentials.
- Embedded Linux devices: Includes smart home hubs, industrial controllers, and other embedded systems running Linux.
- Small office and enterprise networking equipment: Some switches, gateways, and firewalls can be targeted if remote administration is exposed to the internet and secured with weak passwords.
- Cloud-hosted Linux servers: Some variants attempt to compromise Linux servers with exposed Telnet or SSH services using brute-force credential attacks.
- Internet-exposed devices with Telnet or SSH enabled: Systems that allow remote login and use default or weak credentials are primary targets.
Telnet Credential Brute-Forcing
One of the most common ways Bashlite spreads is through brute-forcing Telnet credentials:
- The malware attempts to connect to devices with Telnet enabled, trying combinations of default and weak usernames and passwords.
- Many IoT devices still ship with Telnet active and factory-set credentials.
- When a successful login occurs, Bashlite gains command-line access to the device, allowing it to download and install its payload.
Unsecured Telnet services on internet-connected hardware remain a major infection vector.
Exploitation of Known Vulnerabilities
Bashlite also spreads by exploiting known software vulnerabilities in device firmware or operating systems:
- Attackers use automated scripts to identify devices running outdated or unpatched versions that are susceptible to remote code execution or privilege escalation flaws.
- Once a vulnerability is found, Bashlite can be installed without valid credentials.
- These exploits are often publicly available, making it easy for attackers to incorporate them into infection routines.
- Delayed patching and unpatched devices leave systems exposed for extended periods.
Shellshock Exploitation
Bashlite was among the first malware families to leverage the Shellshock vulnerability, a critical bug in the bash shell discovered in 2014:
- Shellshock allows attackers to execute arbitrary commands on systems that use vulnerable versions of bash, which is common in many Linux-based IoT devices.
- Bashlite automates exploitation by scanning for susceptible devices and injecting malicious commands.
- Once exploited, Shellshock gives Bashlite control over the device, enabling installation of the malware payload.
- Many devices remain unpatched due to lack of user awareness or manufacturer support.
Exposed Remote Management Interfaces
Another infection method involves targeting devices with remote management interfaces exposed to the internet:
- Web-based configuration panels or remote command-line access points are often left open for convenience, exposing them to automated attacks.
- Bashlite scans for these interfaces and attempts to gain access using known exploits or brute-force techniques.
- Once access is gained, attackers can deploy Bashlite and take control of the device without the owner's knowledge.
Malicious Scripts and Payload Downloads
Attackers also infect devices by using malicious shell scripts that download and execute the Bashlite binary:
- After obtaining access through stolen credentials or an exploited vulnerability, they run commands with utilities such as wget, curl, or tftp to retrieve the malware from attacker-controlled servers.
- The scripts typically detect the device's processor architecture and download the correct binary.
- These download scripts can be modified quickly as attackers update their infrastructure or release new variants.
- If a download server is blocked or taken offline, the scripts can switch to alternate hosting locations to maintain the infection process.
Bashlite is designed to operate quietly, so infected devices often continue functioning normally while participating in malicious activity. However, several indicators can suggest that an IoT device has been compromised and is communicating with a Bashlite botnet:
- Unusually slow device performance: The device may become less responsive because malware consumes CPU, memory, and network resources.
- Unexpected spikes in network traffic: Infected devices often generate large volumes of outbound traffic, especially during DDoS attacks.
- Unknown outbound connections: The device connects to unfamiliar IP addresses or command-and-control (C2) servers.
- High CPU or memory usage: Resource utilization remains elevated when the device is idle or performing minimal tasks.
- Changes to system configuration: Startup scripts, scheduled tasks, or system files may be modified.
- Failed or unauthorized login attempts: System logs may show repeated Telnet or SSH login attempts.
- Unexpected processes running: Unknown or suspicious processes may appear in the device's process list.
- Security features being disabled: Logging, firewall rules, or other security settings may be altered.
- Device participating in suspicious network activity: The device sends large numbers of TCP, UDP, or HTTP requests without a legitimate reason.
- Alerts from security tools: Intrusion detection systems, endpoint security software, or network monitoring platforms may detect known indicators or malicious communication patterns.
Related content: Read our guide to botnet detection techniques.
Here are some of the measures used to protect against Bashlite.
1. Replace Default Usernames and Passwords
Changing factory-default usernames and passwords helps prevent Bashlite infections. Use unique, strong passwords for every device, and avoid common or easily guessed credentials. Where possible, change the default administrator username. Organizations should maintain an inventory of device credentials and enforce password management policies across IoT deployments. Devices that do not support strong authentication should be replaced or isolated from internet-facing networks.
Action items:
- Change factory credentials before deployment.
- Use unique passwords for every device.
- Disable or rename default administrator accounts where possible.
- Store credentials in an approved password manager.
- Replace devices that cannot support strong authentication.
2. Disable Unnecessary Telnet and Remote Access
Telnet should be disabled whenever possible because it transmits credentials without encryption and is a primary target for Bashlite. If remote administration is required, use SSH with strong authentication. Disable remote services that are not needed. Remote management interfaces should not be exposed directly to the internet. Require administrators to connect through a VPN or other secure access solution before managing devices.
Action items:
- Disable Telnet on all devices where possible.
- Use SSH instead of plaintext remote administration.
- Turn off unused remote management services.
- Require VPN access for remote administration.
- Review exposed management ports regularly.
3. Keep Firmware and Software Updated
Install firmware and software updates provided by device manufacturers to address known vulnerabilities. Many Bashlite variants exploit weaknesses that have already been patched but remain present because updates were not applied. Establish a routine process for checking available updates and replace devices that no longer receive security patches. Unsupported hardware should not remain connected to production networks.
Action items:
- Enable automatic updates where supported.
- Track firmware versions across the device inventory.
- Apply critical security patches promptly.
- Monitor vendor advisories for newly disclosed vulnerabilities.
- Retire devices that no longer receive security updates.
4. Restrict Internet Access to Management Interfaces
Administrative web interfaces, SSH services, and other management ports should only be accessible from trusted networks or authorized IP addresses. Firewalls and access control lists can prevent unauthorized users from reaching these services from the public internet. If remote management is not required, disable it. Limiting access reduces opportunities for brute-force attacks and prevents automated malware from discovering administrative services.
Action items:
- Block public access to management ports by default.
- Allow administration only from trusted IP addresses or networks.
- Place management interfaces behind a VPN or secure gateway.
- Use firewall rules and ACLs to restrict access.
- Audit internet-exposed services regularly.
5. Segment IoT Devices from Critical Networks
Place IoT devices on separate network segments or VLANs instead of allowing them to share the same network as business systems or sensitive servers. Network segmentation limits the damage if a device becomes compromised by preventing attackers from moving to other systems. Communication between IoT devices and critical resources should be restricted to what is necessary. Applying least-privilege network rules reduces the impact of infections and makes suspicious traffic easier to detect.
Action items:
- Place IoT devices on dedicated VLANs or network segments.
- Restrict communication between IoT and business systems.
- Apply least-privilege firewall rules between segments.
- Prevent direct access from IoT networks to sensitive servers.
- Monitor cross-segment traffic for unusual activity.
6. Monitor Devices for Abnormal Traffic
Monitor network traffic generated by IoT devices for signs of scanning, unexpected outbound connections, or high traffic volumes. These behaviors may indicate that a device has been recruited into a Bashlite botnet or is attempting to infect other systems. Network intrusion detection systems, firewall logs, and endpoint monitoring tools can help identify compromised devices. Isolate and investigate suspicious devices to reduce the likelihood of further infections.
Action items:
- Alert on unusual outbound traffic spikes.
- Detect repeated scanning or connection attempts.
- Monitor connections to unfamiliar external IP addresses.
- Review firewall, IDS, and device logs regularly.
- Isolate and investigate devices showing suspicious behavior.
Botnets like Bashlite exist for one purpose: to launch DDoS attacks at a scale that overwhelms the targets they are aimed at. Radware Cloud DDoS Protection Services give organizations adaptive, AI-powered protection against today's most advanced DDoS attacks. The service uses advanced behavioral algorithms to detect and mitigate threats with or without sharing certificates, and its automated, AI-powered protection delivers real-time detection of the latest DDoS attacks, stopping both infrastructure and application-layer assaults before they disrupt the business.
Key capabilities of Radware Cloud DDoS Protection Services:
- Wide security coverage: Behavioral-based detection combined with automatic signature creation stops all types of DDoS attacks, including the volumetric floods generated by IoT botnets.
- Flexible deployment: Protects any network topology or threat profile through on-demand, always-on, or hybrid deployment models.
- Mitigation in seconds: A comprehensive service level agreement (SLA) commits Radware to timely detection, mitigation, and uptime.
- Hybrid protection with no gaps: Traffic is diverted to the cloud through real-time sharing of baselines and attack footprints between the on-premises device and cloud DDoS protection, with mitigation starting on-premises in real time.
- Global capacity close to the attack source: A worldwide network of 25 fully connected scrubbing centers with 30 Tbps of mitigation capacity mitigates attacks closer to their point of origin.
- Radware expertise as a managed service: Radware's battle-proven Emergency Response Team delivers DDoS protection expertise as a fully managed service.
- Unified visibility: Attack data is analyzed in one place, drilling down into the asset view to see all current and historical information.
- Expandable protection layers: Optional add-ons include Cloud Web DDoS Protection against application-layer (L7) and Web DDoS Tsunami attacks, Threat Intelligence Service, Firewall as a Service, Network Analytics, and Radware AI SOC Xpert.
Learn more about Radware Cloud DDoS Protection Services