Bots are playing an increasingly prominent role in cyberattacks. For instance, cyberattackers recently used bots to steal patient pharmacy accounts and resell prescriptions.; and, the “Grinch bots” were used during the holidays last year to purchase popular items en masse, only for organizations to resell them at a huge markup on the black market. 

Bot use doesn’t stop with stolen logins and prescriptions, however. As the war in Ukraine continues on both the physical battlefield and cyberspace, Ukrainian cyber police uncovered and shut down a 1,000,000-bot farm. Many of these bots were used to peddle Russian disinformation and propaganda on social media. This comes on the heels of a Federal Bureau of Investigation (FBI) operation earlier this year that disrupted another Russian botnet that distributed the Cyclops Blink malware.

While these attacks underscore the range of bots being used for malicious purposes, they also highlight their popularity as a tool for both state-sponsored groups and cybercriminals alike. Bots aren’t going to go away anytime soon, so it is imperative that we fully understand what bots are and how they are used to better mitigate the threat that they pose. 

Bot 101, or rather, 01100010 01101111 01110100 

A “bot” is really just a robot, but not like the ones you may see in a science fiction movie. At a foundational level, a bot is a program that can send HTTP traffic to a system from an IP address. A botnet is a network of bots that can leverage several IP addresses. 

Defending against bots is challenging because they can be difficult to detect. Further,  you can’t possibly be expected to block all IP addresses because this would seriously degrade your enterprise’s ability to operate - imagine what blocking all online traffic would do for a retail store’s bottom line. This is why, historically, bots have been used to overwhelm defenses for distributed denial of service (DDoS) attacks. For example, the Mantis botnet was responsible for one of the largest DDoS attacks in history, with 26 million requests per second. 

How bots can be used to attack APIs

While any instance of bots being used in cyberattacks is a cause for concern, bots have been used more often in API attacks. One of the main reasons for this is that APIs are built for multiple clients, so they are more likely to expose too much information and be left unsecured. 

Botnets enable threat actors to automate many of their processes and tactics when attacking APIs. For instance, bots can improve discovery for threat actors looking to probe for weak spots in your defenses. They can map web apps, identify vulnerabilities while remaining under the detection threshold, and avoid triggering tripwires in defenses. A good way to think about this is if they know that three failed login attempts in a credential stuffing attack result in one of their IP addresses getting blocked, then they’ll make two failed login attempts and move on to the next IP address. 

Threat actors also use bots as a distraction. In this instance, botnets trigger hundreds, or thousands, of alerts that security teams need to follow up on. This allows threat actors to obscure their true intentions, like enumerating IDs, while security teams are tied up in investigations.  

Additionally, the more bots a threat actor has, the faster they can move while conducting their operations. What all this comes down to is that threat actors may throw a bunch of bots at an API endpoint, hoping that there is no authentication and they can bring back a bunch of data. 

Protecting your APIs from bots

When it comes to protecting your APIs from bots, remember that threat actors often want to follow the path of least resistance and want to automate their hacking capabilities. When designing a strategy to defend APIs, security teams and developers should make it too painful and expensive for threat actors to keep attacking, knowing that they do not want their stolen IP addresses to be blocked, as that will cost both time and money. So, every time an IP address that threat actors paid for is permanently blocked, they have one less IP address to use for bot attacks. Bonus points for sharing that blocked IP address across customers, which further constrains the use of that specific IP address.

Consider it this way: in the gaming community, it’s a commonplace for some gamers to try and cheat by abusing inherent game mechanics, allowing them to gain an advantage. Ultimately, some developers have decided to build defenses that would make the time spent trying to cheat or break the game more than the time spent enjoying the game. This changes the calculus for someone deciding how to spend their time.

Bots aren’t going away anytime soon. In fact, we can expect that their use will only continue to increase. Understanding how bots are attacking APIs is a great way to begin working to mitigate the threat.