Use of stolen credentials is the biggest web threat, says the most recent Verizon Data Breach Report.
Month: February 2015
Hijacking 1 million accounts for $3
Our last post covered how credential stuffing poses a significant danger to consumer and enterprise websites.
But how much does it cost to actually execute this powerful attack?
Learn about how an adversary can hijack one million accounts for less than a fast food meal.
Credential stuffing is a dangerous threat. Using simple mathematics and publicly available data we’ve been able to show how attackers are using botnets to try to hijack 1 million online accounts for just $3. Assuming a 1% success rate, attackers are still netting 10,000 accounts for $3.
The economics of botnet technology makes credential stuffing a growing threat for consumers and enterprises.
To highlight the economics of credential stuffing, let’s compare labor costs between a single human, a bot, and a botnet to test 1 million credentials. According to WSJ, a botnet costs $2 to rent.
Using a botnet, an attacker can test 1 million accounts in a matter of hours (100 minutes to be exact). Credential stuffing is a web threat enabled by the rise of cheap botnets. In years past, testing 10 million passwords against a given website was both expensive to do, and easy to detect. Today, cheap botnets consisting of end-user machines have turbocharged credential stuffing. Now, the attack is cheap to perform and very hard to detect. Attackers regularly cycle through 10,000 to 100,000 IP addresses a day, making detection challenging.
Prior to the development of these technologies, the cost and time commitment required to launch this kind of brute force attack was prohibitive to attackers. The advent of botnets allowed credential stuffing attacks to be done in as little as a few days, while avoiding the IP reputation and throttling controls that prevent repeated login attempts. Cheap, easy-to-use botnets are plentiful on the black market, and potential attackers are more comfortable with using technology than ever before.
Market-Driven Attackers
The attackers who control these botnets are still held to the same economics as white-market products and services. Criminal entrepreneurs need to weigh the costs of infrastructure, labor, and profits to justify testing millions of credentials. And as they race against the clock for consumers to change their passwords, criminals become desperate for tools that make account takeover easier, faster, and more profitable for their enterprise.
In the last 5 years, bot technology has innovated the black market economy. As a result, we have seen a dramatic increase in automated, scripted attacks amongst our customers. If you would like to read more about the lifecycle of an automated attack, you can read our previous blog here.
Contact us to learn how Shape Security can protect your site.
[update] In this updated version of this blog post we refer to a single node bot. In a previous version of the same blog post we referred to a click-farm.
Rising Attack Vector: Credential Stuffing
Credential stuffing is a growing threat to the web community. As more companies are offering their goods and services online, customers practicing bad password hygiene are in danger of having their account stolen whenever a website is breached.
Read more about the rise of credential stuffing below.
Credential stuffing is taking lists of breached credentials from one website and testing them against another. According to the most recent Verizon Data Breach report, it’s one the fastest rising attack vectors.
The list of major companies that have fallen to this attack is impressive: Sony ‘11, Yahoo ‘12, Dropbox ‘12, and JPMC ‘14.
Credential stuffing is a general concept, but the outcome of successfully taking over user accounts results in more specific attack in various industries: stealing hotel reward points, pilfering airline frequent flier miles, and committing gift card fraud, to name just a few.
The Definition of Credential Stuffing
Credential stuffing is the automated testing of breached username/password pairs in order to fraudulently gain access to user accounts. This attack involves checking large numbers of spilled credentials against various websites to uncover credentials that are valid on a target website. Attackers then hijack those accounts and commit various types of fraud.
The Anatomy of Credential Stuffing Attack
- The attacker acquires spilled usernames and passwords from a website breach or password dump site.
- The attacker uses an account checker to test the stolen credentials against many websites (for instance, social media sites or online marketplaces).
- Successful logins (usually 0.1-1% of the total login attempts) allow the attacker to take over the account matching the stolen credentials.
- The attacker drains stolen accounts of stored value, credit card numbers, and other personally identifiable information
- The attacker may also use account information going forward for other nefarious purposes (for example, to send spam or create further transactions)
How is Credential Stuffing Different from Existing Threats?
We’ve classified credential stuffing as a renewed form of attack because the primary vector for account takeover has changed from the breaching of databases to automated web injection.
According to our analysis, credential stuffing is now the most popular method used by attackers to achieve account takeover. This is particularly dangerous to both consumers and enterprises because of the ripple effects of these breaches.
Credential Stuffing was the Attack Vector Used in the Sony, Yahoo, Dropbox and JPMC Breaches
Below are excerpts taken from publications analyzing these large-scale breaches. There is evidence to support that these breaches were connected by credential stuffing.
- Sony, 2011 breach: “I wish to highlight that two-thirds of users whose data were in both the Sony data set and the Gawker breach earlier this year used the same password for each system.” Source: Agile Bits
- Yahoo, 2012 breach: “What do Sony and Yahoo! have in common? Passwords!”. Source: Troy Hunt
- Dropbox, 2012 breach: “The usernames and passwords referenced in these articles were stolen from unrelated services, not Dropbox. Attackers then used these stolen credentials to try to log into sites across the internet, including Dropbox”. Source: Dropbox
- JPMC, 2014 breach: “[The breached data] contained some of the combinations of passwords and email addresses used by race participants who had registered on the Corporate Challenge website, an online platform for a series of annual charitable races that JPMorgan sponsors in major cities and that is run by an outside vendor. The races are open to bank employees and employees of other corporations”. Source: NY Times
Anatomy of the 2011 credential stuffing attack on Sony. Credentials from smaller sites are leaked and injected into Sony’s login pages to test for credential reuse. The attacker gained access to any Sony accounts which used the same credentials as were leaked from the smaller sites.
Using botnets, Sony credentials were tested on Sony’s login page. According to Wired, this resulted in 93,000 breached accounts. In other words, the credential stuffing attack that led to the Sony breach was made possible by prior breaches of smaller sites.
This connected chain of events from Sony to Yahoo to Dropbox excludes JPMC. The JPMC breach came from a separate and unrelated source. We know that the JPMC breach was caused by attackers targeting an unrelated third-party athletic race/run site for credentials to use against JPMC.
What Can SysAdmins Do to Prevent Attackers from Hijacking User Accounts by Credential Stuffing?
The answer requires an understanding of the technical mechanism by which credential stuffing works.
Like account checkers, credential stuffing works by using the static form elements of the login page as an implicit API. The attacker references various form element names (email and password) in order to interact with the target webpage. Since most websites accept such traffic as normal (having no means to distinguish between intended and malicious use), the attacker can automate the attack by using scripts and account checkers to easily run through millions of tests per unit time. Using a large-scale distributed botnet and a huge number of IP addresses allows the attacker avoid rate and volume limits which might otherwise prevent such a large number of login attempts. Thus, it is trivial even for unsophisticated attackers to launch attacks of this nature and scale against some of the largest websites in the world.
To defend websites against such activity, which we call “unwanted automation,” Shape Security uses an approach that is familiar to attackers: we dynamically change the underlying code of the site each time a page is viewed to defeat the types of scripts used in credential stuffing attacks. Just as malware authors have long used polymorphic code to evade antivirus products by constantly presenting different signatures, Shape’s solution creates a moving target which frustrates potential attackers attempting to automate easy credential testing on the website using scripts. The effort an attacker must invest to successfully automate login attempts on a given website without changing the front-end use experience.
Of course, savvy readers will point out numerous ways these measures can be circumvented. While, it is beyond the scope of this article (but perhaps the subject of future pieces) to consider such attacks (DOM, GUI, and others), Shape is keenly focused on comprehensively defeating them and has solutions at each of those levels.
Contact us to learn how Shape Security can protect your site.
Reducing with the Shift Reducer
What is a Reducer?
A reducer is an actor that takes something large and turns it into something smaller. In programming it is a construct that recursively applies a function over a data structure in order to produce a single value.
In JavaScript, you could reduce an array of integers to a single sum with the following code.
var integers = [1, 2, 3, 4, 5, 6];
var sum = integers.reduce(function(memo, next){ return memo + next; }, 0);
// sum === 21
Shift Reducer
Shape Security has provided a reducer to use in building tooling for the Shift format AST. The reducer folds a Shift format AST into a summary value, much like Array.prototype.reduce
folds an array. Of course, reducing an array is much less complex than reducing an AST. Only one function is required to reduce an array, while reducing an AST requires one function for each different type of node.
Shape’s reducer library exposes a single function that runs the reduction, and two base structures that are meant to be extended with your own reducing behaviors: Reducer
and MonoidalReducer
.
Reducer
Use Reducer
when the reduction requires unique behavior for each different type of node. It is a clean slate. Extending Reducer
requires every single reduction method (reduceXXX
) to be overridden. Code generation or AST serialisation are examples of when it is appropriate to base your reducer on Reducer
.
MonoidalReducer
The majority of Shift implementations will benefit from basing their reducer off of MonoidalReducer
. Extending MonoidalReducer
requires that the summary value that each reduction method returns is a Monoid. Its default implementations of the reduction methods take advantage of the monoidal structure of your summary value so that only the reduction methods for the pertinent nodes need to be overridden by you. For all others, the Monoid’s identity will be used.
That may have been a lot to take in. Don’t worry if you’re not familiar with the terminology! As a programmer, you likely run into Monoids every single day, but the term can cause confusion. Let’s see if we can clear up the term a little bit.
Monoids
A monoid is structure that relates the elements in a set with a closed, associative, binary operation that we will call append
, coupled with one special element in that set that we will call the identity
element.
Let’s break monoids down a little further.
What is a binary operation?
A binary operation is an operation that operates on two inputs.
0 + 1; // + is a binary operator
function append(a, b){} // append is a binary function
What is a closed operation?
An operation is closed if performing the operation on members of a set always produces a member of the same set.
What is associativity?
We learned the concept of associativity back in elementary school and it is core to our understanding of algebraic operations. Associativity, as the name implies, means that grouping of operations does not affect the result.
(a + b) + c === a + (b + c)
Remember, associativity is not commutativity. That would mean that the order of the values given to the operation does not affect the result.
a + b + c === c + b + a
What is an identity?
An identity is a value for a specific operation that when passed to an operator with any other value returns the other value. You may remember this via the additive identity, 0
, or the multiplicative identity, 1
.
x + 0 === x;
0 + x === x;
x * 1 === x;
1 * x === x;
append(x, identity) === x;
append(identity, x) === x;
Putting it all together
Using the above examples we could write out the Sum Monoid in arithmetic expressions.
sumIdentity = 0
sumAppend(x, y) = x + y
Or we could write the Sum Monoid JavaScript implementation. For this, we will use the conventional Fantasy Land names, empty
and concat
.
//es6
class Sum {
constructor(number) {
this.value = number;
}
// always return the identity element
static empty() {
return new Sum(0);
}
// the binary operation acts on its `this` value and its parameter
concat(other) {
return new Sum(this.value + other.value);
}
}
new Sum(5).concat(new Sum(2)).value; // 7
Walkthrough: Making something with the MonoidalReducer
Now that we understand monoids, let’s walk through making a small program with the Shift MonoidalReducer
that counts how many identifiers are in a program.
Setup
Install dependencies.
$ npm install --save shift-reducer shift-parser 6to5
Making an Identifier counter
First we need to flesh out our basic program.
//es6
import parse from "shift-parser";
import reduce, {MonoidalReducer} from "shift-reducer";
// a monoid over integers and addition
class Sum() {
constructor(number) {
this.value = number;
}
// by default reduce any node to the identity, zero
static empty() {
return new Sum(0);
}
// combine Sum instances by summing their values
concat(other) {
return new Sum(this.value + other.value);
}
}
class IdentifierCounter extends MonoidalReducer {
constructor() {
// let MonoidalReducer know that we're going to use Sum as our monoid
super(Sum)
}
// a convenience function for performing the reduction and extracting a result
static count(program) {
return reduce(new this, program).value;
}
// add 1 to the count for each IdentifierExpression node
reduceIdentifierExpression(node) {
return new Sum(1);
}
/*
In this case, the only node we care about overriding is the
IdentifierExpression node; the rest can be reduced using the default
methods from MonoidalReducer.
*/
}
// test program code
var program = "function f() { hello(world); }";
console.dir(IdentifierCounter.count(parse(program)));
Run it!
$ node_modules/.bin/6to5-node count-identifiers.js
Wrapping Up
Let’s walk through what’s been done. We’ve created a new Reducer by extending the MonoidalReducer
, overridden the necessary reduction methods (in this case only reduceIdentifierExpression
), and parsed and run our new reducer over a program.
We wrote this example in ES6 because we believe it’s clearer. An ES5 version of the identifier counter is available in this gist.
Taking it Further
At this point, we’ve used a fairly trivial example in order to expose the fundamentals of using the MonoidalReducer
. Next, we will look at the design of a more significant project that makes use of theMonoidalReducer
: the Shift Validator.
Shift Validator
The Shift Validator validates a Shift format AST from the bottom up. But how does it do this when many of the restrictions it is enforcing are context sensitive? The ValidationContext
object that the Validator uses allows possible errors to be registered on it and, if we determine (with new information about the possible error’s context) that the error actually does not apply, it can clear possible errors as well. Only when we are certain an error will not be cleared do we move it from its temporary error list to the official errors
list in the ValidationContext
object. Let’s look at a concrete example:
When the Validator reduces a ReturnStatement
, we call the addFreeReturnStatement
helper method of our ValidationContext
state object, giving it an error that this ReturnStatement
must be contained within a function (top-level return is illegal in JavaScript). We don’t know whether this ReturnStatement
is actually in an illegal position, but we assume it is until we better understand its context. In the reduction methods for FunctionDeclaration
, FunctionExpression
, Getter
, and Setter
nodes, we then call the clearFreeReturnStatements
helper method of our ValidationContext
state object clearing out all of the ReturnStatement
errors we collected while reducing ReturnStatement
nodes below us in the AST. Finally, when we reduce a Script
node (the head of the AST), we move the ReturnStatement
errors from their temporary holding list to the confirmed errors list using theenforceFreeReturnStatementErrors
helper method. We do this at this point because we know we won’t be reducing any more functions that will cancel out a ReturnStatement
error.
Final Round Up
To pull it all together, we’ve gone over the Shift Reducer
and MonoidalReducer
. Both can be used to build tooling based on the Shift AST. We’ve gone over the fundamentals behind the MonoidalReducer
and explored both a simple MonoidalReducer
example, as well as a more complex example, the Shift Validator. Hopefully, now you feel comfortable building your own tools based on Shift’s AST.
3 Steps for CISOs to Protect Login Accounts
As web security moves from an IT problem to a C-Level and board problem, CISOs should create a strategy for protecting their customers and their enterprise from account hijackers. Below we provide 3 easy checks that companies can use to secure their customer credentials.
If 2014 was the year of the breach, then 2015 will be the year of account hijacking at a scale we’ve never seen before. The huge sets of credentials stolen in the past will be tested on just about every major website (and lots of minor ones), and roughly 0.1% to 20% of them will be valid. A Microsoft study found the typical consumer has terrible password hygiene and re-uses the same username / password combination across sites. Specifically, the study found the typical user has 6.5 passwords per 25 accounts, meaning that each user password is shared across 3.9 different sites. Due to frequent password reuse, credentials stolen during the breach of one site are also likely to be valid on 3.9 other unrelated sites. Each breach is also a breach of other sites on which the same credentials are valid.
Why is this so important? According to the 2014 Verizon Data Breach Investigations Report, compromised credentials are now the most commonly-used threat action. Almost every major website, including those with fully-patched, up-to-date security, is susceptible to account takeover and the use of account checker scripts to hijack accounts. Attackers use scripts to take over an account, drain its funds or other assets, and resell the drained account so it can be used for spam, money or reputation ‘laundering’. On our customers’ sites, an average of 60% of login page traffic is caused by malicious bots testing stolen credentials, up 10% from the same time last year.
Here’s a 3-step approach which SysAdmins can implement to help mitigate this vulnerability and protect user accounts.
Step 1. Diagnose if the site already has account hijackers
The first step is to measure whether criminals are actively testing stolen credentials against your website. The easiest metrics to deploy is to inspect failed logins versus successful logins over a typical one-week window. For most enterprises, the graph should have the following characteristics:
- Failed logins should be a small percent of successful logins, typically under 10% (this varies widely, but if failed logins are over 100% of successful logins there is a very strong probability of a serious problem).
- Failed logins should follow roughly the same pattern as successful logins.
- Failed logins should not have large bursts of activity.
Look out for hijackers guessing at your usage bursts and trying to hide within that. Also, look for DDOSing attackers who hide within a large amount of fake web traffic that they create. There are many patterns and signs to evaluate. The techniques above can help you determine whether you have a problem.
Step 2. Recognize that old traps don’t stop new login attackers
The traditional approaches to stopping account takeover (throttling, reputation, and CAPTCHA) are not current. They are outdated and ineffective. Don’t get caught deploying a solution easily defeated by criminals.
- Throttling solutions: Throttles won’t help, but they can hurt.
Brute force throttling solutions will not reliably protect your website because determined adversaries will reduce the speed of their attack to fall below the threshold for detection, or source the attack from a diverse set of source IPs to spread out their traffic. Even unsophisticated crooks will quickly realize that web security throttles initially let the attack go unabated, typically for the first 60-90 seconds. Typical customers using rate-limiting heuristics find that 5,000 login attempts can occur in the first 90 seconds. If we assume a 1% success rate, which is conservative, each IP address used for the 90 second window will give the attacker access to 50 accounts. If we assume an average loss of $200 per account, the crook will net an estimated $10,000 per incident, with no real limit on the number of incidents beyond the availability of credentials to test.
- Reputation solutions: Reputation isn’t what it used to be.
Reputation solutions, especially IP-based products, are increasingly easy to circumvent given rentable legal (like Rackspace and Amazon) and illegal infrastructure (from crimeware-as-a-service botnet creators who, according to Gartner, rent 10,000 clean IP nodes for $1.50 per hour). Botnets are especially damaging to the efficacy of IP reputation services, since botnets are comprised of zombified computers and therefore appear to be valid residential IPs. We can expect the botnet problem to get worse with the end of support for Windows XP.
- CAPTCHA solutions: This antiquated method disrupts customers, not fraudsters.
CAPTCHA is disintermediated by commercial bypass services. Search for “CAPTCHA bypass service” to find a list of services that provide 1000 solved CAPTCHAs for as little as $1.39, with 95% accuracy. As the average user is only 71% accurate when solving CAPTCHAs, bypass services are 25% more accurate than legitimate users. This is equally true for niche CAPTCHAs like Confident Technologies’ implementation, mainstream CAPTCHAs like Google’s reCAPTCHA, and even reCAPTCHA v2.
Step 3. Implement user interface security on the login page
To protect user login accounts from being hijacked, we propose a solution that has been long-theorized but undeployable till now. We suggest that sites make critical elements of the underlying code dynamic, rendering machine automated attacks impractical to implement. We call this “user interface security” because it protects the user interface’s HTML, DOM, CSS and JavaScript from attack. This new method of defense defeats script attacks on web applications, and can be home-grown or purchased from Shape Security as a network appliance.
Malware has long used polymorphic code to hide itself from antivirus products by looking unique every time it infects a new machine. SysAdmins can invert this concept and use polymorphism to disable an attacker’s capability to script commands against targeted sites.
This technique is both cutting-edge and effective. Our chief scientist, Xinran Wang, Bob Blakley of Citibank, and Professor Tadayoshi Kohno of the University of Washington authored an academic paper on making web elements dynamic to defeat web automation. The paper was presented at the 2014 International Conference on Applied Cryptography and Network Security.
Keep an eye out for forthcoming articles where we will categorize threats that rely on automation and the appropriate anti-automation control.
Contact Shape to protect your web application’s user interface.