You don’t need printer security

So there’s this tweet:

The guy at the HP printer security booth seriously told a customer that he needs print security “because stuxnet exploits the print spooler” pic.twitter.com/WRyfEGj9hR

— Jake Williams (@MalwareJake) February 15, 2017

What it’s probably refering to is this:

This is an obviously bad idea.

Well, not so “obvious”, so some people have ask me to clarify the situation. After all, without “security”, couldn’t a printer just be added to a botnet of IoT devices?

The answer is this:

Fixing insecurity is almost always better than adding a layer of security.

Adding security is notoriously problematic, for three reasons

  1. Hackers are active attackers. When presented with a barrier in front of an insecurity, they’ll often find ways around that barrier. It’s a common problem with “web application firewalls”, for example.
  2. The security software itself can become a source of vulnerabilities hackers can attack, which has happened frequently in anti-virus and intrusion prevention systems.
  3. Security features are usually snake-oil, sounding great on paper, with with no details, and no independent evaluation, provided to the public.

It’s the last one that’s most important. HP markets features, but there’s no guarantee they work. In particular, similar features in other products have proven not to work in the past.

HP describes its three special features in a brief whitepaper [*]. They aren’t bad, but at the same time, they aren’t particularly good. Windows already offers all these features. Indeed, as far as I know, they are just using Windows as their firmware operating system, and are just slapping an “HP” marketing name onto existing Windows functionality.

HP Sure Start: This refers to the standard feature in almost all devices these days of having a secure boot process. Windows supports this in UEFI boot. Apple’s iPhones work this way, which is why the FBI needed Apple’s help to break into a captured terrorist’s phone. It’s a feature built into most IoT hardware, though most don’t enable it in software.

Whitelisting: Their description sounds like “signed firmware updates”, but if that was they case, they’d call it that. Traditionally, “whitelisting” referred to a different feature, containing a list of hashes for programs that can run on the device. Either way, it’s a pretty common functionality.

Run-time intrusion detection: They have numerous, conflicting descriptions on their website. It may mean scanning memory for signatures of known viruses. It may mean stack cookies. It may mean double-checking kernel modules. Windows does all these things, and it has a tiny benefit on stopping security threats.

As for traditional threats for attacks against printers, none of these really are important. What you need to secure a printer is the ability to disable services you aren’t using (close ports), enable passwords and other access control, and delete files of old print jobs so hackers can’t grab them from the printer. HP has features to address these security problems, but then, so do its competitors.

Lastly, printers should be behind firewalls, not only protected from the Internet, but also segmented from the corporate network, so that only those designed ports, or flows between the printer and print servers, are enabled.

Conclusion

The features HP describes are snake oil. If they worked well, they’d still only address a small part of the spectrum of attacks against printers. And, since there’s no technical details or independent evaluation of the features, they are almost certainly lies.

If HP really cared about security, they’d make their software more secure. They use fuzzing tools like AFL to secure it. They’d enable ASLR and stack cookies. They’d compile C code with run-time buffer overflow checks. Thety’d have a bug bounty program. It’s not something they can easily market, but at least it’d be real.

If you cared about printer security, then do the steps I outline above, especially firewalling printers from the traditional network. Seriously, putting $100 firewall between a VLAN for your printers and the rest of the network is cheap and easy way to do a vast amount of security. If you can’t secure printers this way, buying snake oil features like HP describes won’t help you.

Continue reading You don’t need printer security

Posted in SBN

You don’t need printer security

So there’s this tweet:

The guy at the HP printer security booth seriously told a customer that he needs print security “because stuxnet exploits the print spooler” pic.twitter.com/WRyfEGj9hR

— Jake Williams (@MalwareJake) February 15, 2017

What it’s probably refering to is this:

This is an obviously bad idea.

Well, not so “obvious”, so some people have ask me to clarify the situation. After all, without “security”, couldn’t a printer just be added to a botnet of IoT devices?

The answer is this:

Fixing insecurity is almost always better than adding a layer of security.

Adding security is notoriously problematic, for three reasons

  1. Hackers are active attackers. When presented with a barrier in front of an insecurity, they’ll often find ways around that barrier. It’s a common problem with “web application firewalls”, for example.
  2. The security software itself can become a source of vulnerabilities hackers can attack, which has happened frequently in anti-virus and intrusion prevention systems.
  3. Security features are usually snake-oil, sounding great on paper, with with no details, and no independent evaluation, provided to the public.

It’s the last one that’s most important. HP markets features, but there’s no guarantee they work. In particular, similar features in other products have proven not to work in the past.

HP describes its three special features in a brief whitepaper [*]. They aren’t bad, but at the same time, they aren’t particularly good. Windows already offers all these features. Indeed, as far as I know, they are just using Windows as their firmware operating system, and are just slapping an “HP” marketing name onto existing Windows functionality.

HP Sure Start: This refers to the standard feature in almost all devices these days of having a secure boot process. Windows supports this in UEFI boot. Apple’s iPhones work this way, which is why the FBI needed Apple’s help to break into a captured terrorist’s phone. It’s a feature built into most IoT hardware, though most don’t enable it in software.

Whitelisting: Their description sounds like “signed firmware updates”, but if that was they case, they’d call it that. Traditionally, “whitelisting” referred to a different feature, containing a list of hashes for programs that can run on the device. Either way, it’s a pretty common functionality.

Run-time intrusion detection: They have numerous, conflicting descriptions on their website. It may mean scanning memory for signatures of known viruses. It may mean stack cookies. It may mean double-checking kernel modules. Windows does all these things, and it has a tiny benefit on stopping security threats.

As for traditional threats for attacks against printers, none of these really are important. What you need to secure a printer is the ability to disable services you aren’t using (close ports), enable passwords and other access control, and delete files of old print jobs so hackers can’t grab them from the printer. HP has features to address these security problems, but then, so do its competitors.

Lastly, printers should be behind firewalls, not only protected from the Internet, but also segmented from the corporate network, so that only those designed ports, or flows between the printer and print servers, are enabled.

Conclusion

The features HP describes are snake oil. If they worked well, they’d still only address a small part of the spectrum of attacks against printers. And, since there’s no technical details or independent evaluation of the features, they are almost certainly lies.

If HP really cared about security, they’d make their software more secure. They use fuzzing tools like AFL to secure it. They’d enable ASLR and stack cookies. They’d compile C code with run-time buffer overflow checks. Thety’d have a bug bounty program. It’s not something they can easily market, but at least it’d be real.

If you cared about printer security, then do the steps I outline above, especially firewalling printers from the traditional network. Seriously, putting $100 firewall between a VLAN for your printers and the rest of the network is cheap and easy way to do a vast amount of security. If you can’t secure printers this way, buying snake oil features like HP describes won’t help you.

Continue reading You don’t need printer security

Posted in SBN

You don’t need printer security

So there’s this tweet:

The guy at the HP printer security booth seriously told a customer that he needs print security “because stuxnet exploits the print spooler” pic.twitter.com/WRyfEGj9hR

— Jake Williams (@MalwareJake) February 15, 2017

What it’s probably refering to is this:

This is an obviously bad idea.

Well, not so “obvious”, so some people have ask me to clarify the situation. After all, without “security”, couldn’t a printer just be added to a botnet of IoT devices?

The answer is this:

Fixing insecurity is almost always better than adding a layer of security.

Adding security is notoriously problematic, for three reasons

  1. Hackers are active attackers. When presented with a barrier in front of an insecurity, they’ll often find ways around that barrier. It’s a common problem with “web application firewalls”, for example.
  2. The security software itself can become a source of vulnerabilities hackers can attack, which has happened frequently in anti-virus and intrusion prevention systems.
  3. Security features are usually snake-oil, sounding great on paper, with with no details, and no independent evaluation, provided to the public.

It’s the last one that’s most important. HP markets features, but there’s no guarantee they work. In particular, similar features in other products have proven not to work in the past.

HP describes its three special features in a brief whitepaper [*]. They aren’t bad, but at the same time, they aren’t particularly good. Windows already offers all these features. Indeed, as far as I know, they are just using Windows as their firmware operating system, and are just slapping an “HP” marketing name onto existing Windows functionality.

HP Sure Start: This refers to the standard feature in almost all devices these days of having a secure boot process. Windows supports this in UEFI boot. Apple’s iPhones work this way, which is why the FBI needed Apple’s help to break into a captured terrorist’s phone. It’s a feature built into most IoT hardware, though most don’t enable it in software.

Whitelisting: Their description sounds like “signed firmware updates”, but if that was they case, they’d call it that. Traditionally, “whitelisting” referred to a different feature, containing a list of hashes for programs that can run on the device. Either way, it’s a pretty common functionality.

Run-time intrusion detection: They have numerous, conflicting descriptions on their website. It may mean scanning memory for signatures of known viruses. It may mean stack cookies. It may mean double-checking kernel modules. Windows does all these things, and it has a tiny benefit on stopping security threats.

As for traditional threats for attacks against printers, none of these really are important. What you need to secure a printer is the ability to disable services you aren’t using (close ports), enable passwords and other access control, and delete files of old print jobs so hackers can’t grab them from the printer. HP has features to address these security problems, but then, so do its competitors.

Lastly, printers should be behind firewalls, not only protected from the Internet, but also segmented from the corporate network, so that only those designed ports, or flows between the printer and print servers, are enabled.

Conclusion

The features HP describes are snake oil. If they worked well, they’d still only address a small part of the spectrum of attacks against printers. And, since there’s no technical details or independent evaluation of the features, they are almost certainly lies.

If HP really cared about security, they’d make their software more secure. They use fuzzing tools like AFL to secure it. They’d enable ASLR and stack cookies. They’d compile C code with run-time buffer overflow checks. Thety’d have a bug bounty program. It’s not something they can easily market, but at least it’d be real.

If you cared about printer security, then do the steps I outline above, especially firewalling printers from the traditional network. Seriously, putting $100 firewall between a VLAN for your printers and the rest of the network is cheap and easy way to do a vast amount of security. If you can’t secure printers this way, buying snake oil features like HP describes won’t help you.

Continue reading You don’t need printer security

Posted in Uncategorized

Uber was right to disable surge pricing at JFK

Yesterday, the NYC taxi union had a one-hour strike protesting Trump’s “Muslim Ban”, refusing to pick up passengers at the JFK airport. Uber responded by disabling surge pricing at the airport. This has widely been interpreted as a bad thing, so the hashtag “#DeleteUber” has been trending, encouraging people to delete their Uber accounts/app.
These people are wrong, obviously so.

Surge Pricing

Uber’s “Surge Pricing” isn’t price gouging, as many assume. Instead, the additional money goes directly to the drivers, to encourage them come to the area surging and pick up riders. Uber isn’t a taxi company. It can’t direct drivers to go anywhere. All it can do is provide incentives. “Surge Pricing” for customers means “Surge Income” for the drivers, giving them an incentive. Drivers have a map showing which areas of the city are surging, so they can drive there.

Another way of thinking about it is “Demand Pricing”. It’s simply the economic Law of Supply and Demand. If demand increases, then prices increase, and then supply increases chasing the higher profits. It’s why famously you can’t get a taxi cab on New Years Eve, but you can get an Uber driver. Taxi drivers can’t charge more when demand is surging, so there’s no more taxis available on that date than on any other. But Uber drivers can/do charge more, so there’s more Uber drivers.

Supply and Demand is every much a law as Gravity. If the supply of taxi drivers is less than the demand, then not everyone is going to get a ride. That’s basic math. If there’s only 20 drivers right now, and 100 people wanting a ride, then 80 riders are going to be disappointed. The only solution is more drivers. Paying drivers more money gets more drivers. The part time drivers, the drivers planning on partying instead of working, will decide to work New Years chasing the surge wages.

Uber’s announcement

Uber made the following announcement:

Surge pricing has been turned off at #JFK Airport. This may result in longer wait times. Please be patient.

— Uber NYC (@Uber_NYC) January 29, 2017

Without turning off Surge Pricing, Uber’s computers would notice the spike in demand, as would-be taxi customers switch to Uber. The computers would then institute surge pricing around JFK automatically. This would notify the drivers in the area, who would then flock to JFK, chasing the higher income. This would be bad for the strike.

By turning off surge pricing, there would be no increase in supply. It would mean the only drivers going to JFK are those dropping off passengers. It would mean that Uber wouldn’t be servicing any more riders than on a normal day, making no difference to the taxi strike, one way or the other.

Why wouldn’t Uber stop pickups at JFK altogether, joining the strike? Because it’d be a tough decision for them. They have a different relationship with their drivers. Both taxis and Uber are required to take passengers to the airport if asked, but taxis are much better at weaseling out of it [*]. That means screwing drivers, forcing them to go way out to JFK with no return fare. In contrast, taxis were warned enough ahead of time to avoid the trip.

The timing

The above section assumes a carefully considered Uber policy. In reality, they didn’t have the time.
The taxi union didn’t announce their decision until 5pm, with the strike set for only one hour, between 6pm and 7pm.
BREAKING: NYTWA drivers call for one hour work stoppage @ JFK airport today 6 PM to 7 PM to protest #muslimban! #nobannowall

— NY Taxi Workers (@NYTWA) January 28, 2017

Uber’s announcement was at 7:30pm, half hour after the strike was over. They may not have been aware of the strike until after it started, when somebody noticed an enormous surge starting at 6pm. I can imagine them running around in a panic at 6:05pm, trying to figure out how to respond.

Disabling surge pricing is probable their default action. They’ve been down this route before. Every time there is a terrorist attack or natural disaster, and computers turn on Surge Pricing, somebody has to rush to go turn it off again, offer customer rebates, and so on for PR purposes.

Why doesn’t the press report this?

Everyone knows Surge Pricing is evil. After all, that’s what you always read it in the press. But that’s because the press knows as little about basic economics as their readers.

A good example is this CNN story on the incident [*].

CNN describes this as “effectively lowering the cost of a ride“. They ignore the reality, that this was “effectively lowering the supply of rides“. Reading this, readers will naturally assume there’s an unlimited supply ready to service the lower priced rides. What CNN fails to tell readers is that there is no increase in supply, that there can’t be more rides than normal. They ignore the bit in the tweet that warns against longer wait times due to lack of supply.

Conclusion

The timing alone makes the #DeleteUber claims nonsense, as the strike was already over for 36 minutes when Uber tweeted. But in any case, Uber’s decision not to do surge pricing did not “entice” customers with lower prices — they would still have long waits (as the tweet says), causing a strong dis-enticement. No rational person could interpret this as Uber trying to profit from this event.

On the other hand, before this event, Uber announced it’s opposition to Trump’s action, and promised to help any of it’s drivers adversely affected.


Update: The #deleteUber people are switching to Lyft, which continued to pick up passengers during the strike. Lyft is a company funded by Trump adviser Peter Thiel.

Continue reading Uber was right to disable surge pricing at JFK

Posted in Uncategorized

Uber was right to disable surge pricing at JFK

Yesterday, the NYC taxi union had a one-hour strike protesting Trump’s “Muslim Ban”, refusing to pick up passengers at the JFK airport. Uber responded by disabling surge pricing at the airport. This has widely been interpreted as a bad thing, so the hashtag “#DeleteUber” has been trending, encouraging people to delete their Uber accounts/app.
These people are wrong, obviously so.

Surge Pricing

Uber’s “Surge Pricing” isn’t price gouging, as many assume. Instead, the additional money goes directly to the drivers, to encourage them come to the area surging and pick up riders. Uber isn’t a taxi company. It can’t direct drivers to go anywhere. All it can do is provide incentives. “Surge Pricing” for customers means “Surge Income” for the drivers, giving them an incentive. Drivers have a map showing which areas of the city are surging, so they can drive there.

Another way of thinking about it is “Demand Pricing”. It’s simply the economic Law of Supply and Demand. If demand increases, then prices increase, and then supply increases chasing the higher profits. It’s why famously you can’t get a taxi cab on New Years Eve, but you can get an Uber driver. Taxi drivers can’t charge more when demand is surging, so there’s no more taxis available on that date than on any other. But Uber drivers can/do charge more, so there’s more Uber drivers.

Supply and Demand is every much a law as Gravity. If the supply of taxi drivers is less than the demand, then not everyone is going to get a ride. That’s basic math. If there’s only 20 drivers right now, and 100 people wanting a ride, then 80 riders are going to be disappointed. The only solution is more drivers. Paying drivers more money gets more drivers. The part time drivers, the drivers planning on partying instead of working, will decide to work New Years chasing the surge wages.

Uber’s announcement

Uber made the following announcement:

Surge pricing has been turned off at #JFK Airport. This may result in longer wait times. Please be patient.

— Uber NYC (@Uber_NYC) January 29, 2017

Without turning off Surge Pricing, Uber’s computers would notice the spike in demand, as would-be taxi customers switch to Uber. The computers would then institute surge pricing around JFK automatically. This would notify the drivers in the area, who would then flock to JFK, chasing the higher income. This would be bad for the strike.

By turning off surge pricing, there would be no increase in supply. It would mean the only drivers going to JFK are those dropping off passengers. It would mean that Uber wouldn’t be servicing any more riders than on a normal day, making no difference to the taxi strike, one way or the other.

Why wouldn’t Uber stop pickups at JFK altogether, joining the strike? Because it’d be a tough decision for them. They have a different relationship with their drivers. Both taxis and Uber are required to take passengers to the airport if asked, but taxis are much better at weaseling out of it [*]. That means screwing drivers, forcing them to go way out to JFK with no return fare. In contrast, taxis were warned enough ahead of time to avoid the trip.

The timing

The above section assumes a carefully considered Uber policy. In reality, they didn’t have the time.
The taxi union didn’t announce their decision until 5pm, with the strike set for only one hour, between 6pm and 7pm.
BREAKING: NYTWA drivers call for one hour work stoppage @ JFK airport today 6 PM to 7 PM to protest #muslimban! #nobannowall

— NY Taxi Workers (@NYTWA) January 28, 2017

Uber’s announcement was at 7:30pm, half hour after the strike was over. They may not have been aware of the strike until after it started, when somebody noticed an enormous surge starting at 6pm. I can imagine them running around in a panic at 6:05pm, trying to figure out how to respond.

Disabling surge pricing is probable their default action. They’ve been down this route before. Every time there is a terrorist attack or natural disaster, and computers turn on Surge Pricing, somebody has to rush to go turn it off again, offer customer rebates, and so on for PR purposes.

Why doesn’t the press report this?

Everyone knows Surge Pricing is evil. After all, that’s what you always read it in the press. But that’s because the press knows as little about basic economics as their readers.

A good example is this CNN story on the incident [*].

CNN describes this as “effectively lowering the cost of a ride“. They ignore the reality, that this was “effectively lowering the supply of rides“. Reading this, readers will naturally assume there’s an unlimited supply ready to service the lower priced rides. What CNN fails to tell readers is that there is no increase in supply, that there can’t be more rides than normal. They ignore the bit in the tweet that warns against longer wait times due to lack of supply.

Conclusion

The timing alone makes the #DeleteUber claims nonsense, as the strike was already over for 36 minutes when Uber tweeted. But in any case, Uber’s decision not to do surge pricing did not “entice” customers with lower prices — they would still have long waits (as the tweet says), causing a strong dis-enticement. No rational person could interpret this as Uber trying to profit from this event.

On the other hand, before this event, Uber announced it’s opposition to Trump’s action, and promised to help any of it’s drivers adversely affected.

Continue reading Uber was right to disable surge pricing at JFK

Posted in SBN

Uber was right to disable surge pricing at JFK

Yesterday, the NYC taxi union had a one-hour strike protesting Trump’s “Muslim Ban”, refusing to pick up passengers at the JFK airport. Uber responded by disabling surge pricing at the airport. This has widely been interpreted as a bad thing, so the hashtag “#DeleteUber” has been trending, encouraging people to delete their Uber accounts/app.
These people are wrong, obviously so.

Surge Pricing

Uber’s “Surge Pricing” isn’t price gouging, as many assume. Instead, the additional money goes directly to the drivers, to encourage them come to the area surging and pick up riders. Uber isn’t a taxi company. It can’t direct drivers to go anywhere. All it can do is provide incentives. “Surge Pricing” for customers means “Surge Income” for the drivers, giving them an incentive. Drivers have a map showing which areas of the city are surging, so they can drive there.

Another way of thinking about it is “Demand Pricing”. It’s simply the economic Law of Supply and Demand. If demand increases, then prices increase, and then supply increases chasing the higher profits. It’s why famously you can’t get a taxi cab on New Years Eve, but you can get an Uber driver. Taxi drivers can’t charge more when demand is surging, so there’s no more taxis available on that date than on any other. But Uber drivers can/do charge more, so there’s more Uber drivers.

Supply and Demand is every much a law as Gravity. If the supply of taxi drivers is less than the demand, then not everyone is going to get a ride. That’s basic math. If there’s only 20 drivers right now, and 100 people wanting a ride, then 80 riders are going to be disappointed. The only solution is more drivers. Paying drivers more money gets more drivers. The part time drivers, the drivers planning on partying instead of working, will decide to work New Years chasing the surge wages.

Uber’s announcement

Uber made the following announcement:

Surge pricing has been turned off at #JFK Airport. This may result in longer wait times. Please be patient.

— Uber NYC (@Uber_NYC) January 29, 2017

Without turning off Surge Pricing, Uber’s computers would notice the spike in demand, as would-be taxi customers switch to Uber. The computers would then institute surge pricing around JFK automatically. This would notify the drivers in the area, who would then flock to JFK, chasing the higher income. This would be bad for the strike.

By turning off surge pricing, there would be no increase in supply. It would mean the only drivers going to JFK are those dropping off passengers. It would mean that Uber wouldn’t be servicing any more riders than on a normal day, making no difference to the taxi strike, one way or the other.

Why wouldn’t Uber stop pickups at JFK altogether, joining the strike? Because it’d be a tough decision for them. They have a different relationship with their drivers. Both taxis and Uber are required to take passengers to the airport if asked, but taxis are much better at weaseling out of it [*]. That means screwing drivers, forcing them to go way out to JFK with no return fare. In contrast, taxis were warned enough ahead of time to avoid the trip.

The timing

The above section assumes a carefully considered Uber policy. In reality, they didn’t have the time.
The taxi union didn’t announce their decision until 5pm, with the strike set for only one hour, between 6pm and 7pm.
BREAKING: NYTWA drivers call for one hour work stoppage @ JFK airport today 6 PM to 7 PM to protest #muslimban! #nobannowall

— NY Taxi Workers (@NYTWA) January 28, 2017

Uber’s announcement was at 7:30pm, half hour after the strike was over. They may not have been aware of the strike until after it started, when somebody noticed an enormous surge starting at 6pm. I can imagine them running around in a panic at 6:05pm, trying to figure out how to respond.

Disabling surge pricing is probable their default action. They’ve been down this route before. Every time there is a terrorist attack or natural disaster, and computers turn on Surge Pricing, somebody has to rush to go turn it off again, offer customer rebates, and so on for PR purposes.

Why doesn’t the press report this?

Everyone knows Surge Pricing is evil. After all, that’s what you always read it in the press. But that’s because the press knows as little about basic economics as their readers.

A good example is this CNN story on the incident [*].

CNN describes this as “effectively lowering the cost of a ride“. They ignore the reality, that this was “effectively lowering the supply of rides“. Reading this, readers will naturally assume there’s an unlimited supply ready to service the lower priced rides. What CNN fails to tell readers is that there is no increase in supply, that there can’t be more rides than normal. They ignore the bit in the tweet that warns against longer wait times due to lack of supply.

Conclusion

The timing alone makes the #DeleteUber claims nonsense, as the strike was already over for 36 minutes when Uber tweeted. But in any case, Uber’s decision not to do surge pricing did not “entice” customers with lower prices — they would still have long waits (as the tweet says), causing a strong dis-enticement. No rational person could interpret this as Uber trying to profit from this event.

On the other hand, before this event, Uber announced it’s opposition to Trump’s action, and promised to help any of it’s drivers adversely affected.

Continue reading Uber was right to disable surge pricing at JFK

Posted in SBN

Is ‘aqenbpuu’ a bad password?

Press secretary Sean Spicer has twice tweeted a random string, leading people to suspect he’s accidentally tweeted his Twitter password. One of these was ‘aqenbpuu’, which some have described as a “shitty password“. Is is actually bad?

No. It’s adequate. Not the best, perhaps, but not “shitty”.

It depends upon your threat model. The common threats are password reuse and phishing, where the strength doesn’t matter. When the strength does matter is when Twitter gets hacked and the password hashes stolen.

Twitter uses the bcrypt password hashing technique, which is designed to be slow. A typical desktop with a GPU can only crack bcrypt passwords at a rate of around 321 hashes-per-second. Doing the math (26 to the power of 8, divided by 321, divided by one day) it will take 20 years for this desktop to crack the password.

That’s not a good password. A botnet with thousands of desktops, or a somebody willing to invest thousands of dollars on a supercomputer or cluster like Amazon’s, can crack that password in a few days.

But, it’s not a bad password, either. A hack of a Twitter account like this would be a minor event. It’s not worth somebody spending that much resources hacking. Security is a tradeoff — you protect a ton of gold with Ft. Knox like protections, but you wouldn’t invest the same amount protecting a ton of wood. The same is true with passwords — as long as you don’t reuse your passwords, or fall victim to phishing, eight lower case characters is adequate.

This is especially true if using two-factor authentication, in which case, such a password is more than adequate.

I point this out because the Trump administration is bad, and Sean Spicer is a liar. Our criticism needs to be limited to things we can support, such as the DC metro ridership numbers (which Spicer has still not corrected). Every time we weakly criticize the administration on things we cannot support, like “shitty passwords”, we lessen our credibility. We look more like people who will hate the administration no matter what they do, rather than people who are standing up for principles like “honesty”.


The numbers above aren’t approximations. I actually generated a bcrypt hash and attempted to crack it in order to benchmark how long this would take. I’ll describe the process here.

First of all, I installed the “PHP command-line”. While older versions of PHP used MD5 for hashing, the newer versions use Bcrypt.

# apt-get install php5-cli

I then created a PHP program that will hash the password:

I actually use it three ways. The first way is to hash a small password “ax”, one short enough that the password cracker will actually succeed in hashing. The second is to hash the password with PHP defaults, which is what I assume Twitter is using. The third is to increase the difficulty level, in case Twitter has increased the default difficulty level at all in order to protect weak passwords.

I then ran the PHP script, producing these hashes:
$ php spicer.php
$2y$10$1BfTonhKWDN23cGWKpX3YuBSj5Us3eeLzeUsfylemU0PK4JFr4moa
$2y$10$DKe2N/shCIU.jSfSr5iWi.jH0AxduXdlMjWDRvNxIgDU3Cyjizgzu
$2y$15$HKcSh42d8amewd2QLvRWn.wttbz/B8Sm656Xh6ZWQ4a0u6LZaxyH6

I ran the first one through the password cracking known as “Hashcat”. Within seconds, I get the correct password “ax”. Thus, I know Hashcat is correctly cracking the password. I actually had a little doubt, because the documentation doesn’t make it clear that the Bcrypt algorithm the program supports is the same as the one produced by PHP5.

I run the second one, and get the following speed statistics:

As you can seem, I’m brute-forcing an eight character password that’s all lower case (-a 3 ?l?l?l?l?l?l?l?l). Checking the speed as it runs, it seems pretty consistently slightly above 300 hashes/second. It’s not perfect — it keeps warning that it’s slow. This is because the GPU acceleration works best if trying many password hashes at a time.

I tried the same sort of setup using John-the-Ripper in incremental mode. Whereas Hashcat uses the GPU, John uses the CPU. I have a 6-core Broadwell CPU, so I ran John-the-Ripper with 12 threads.

Curiously, it’s slightly faster, at 347 hashes-per-second on the CPU rather than 321 on the GPU.

Using the stronger work factor (the third hash I produced above), I get about 10 hashes/second on John, and 10 on Hashcat as well. It takes over a second to even generate the hash, meaning it’s probably too aggressive for a web server like Twitter to have to do that much work every time somebody logs in, so I suspect they aren’t that aggressive.

Would a massive IoT botnet help? Well, I tried out John on the Raspbery PI 3. With the same settings cracking the password (at default difficulty), I got the following:

In other words, the RPi is 35 times slower than my desktop computer at this task.

The RPi v3 has four cores and about twice the clock speed of IoT devices. So the typical IoT device would be 250 times slower than a desktop computer. This gives a good approximation of the difference in power.


So there’s this comment:

@ErrataRob you could have used node, though 😉

— Fedor Indutny (@indutny) January 27, 2017

Yes, you can. So I did, described below.

Okay, so first you need to use the “Node Package Manager” to install bcrypt. The name isn’t “bcrypt”, which refers to a module that I can’t get installed on any platform. Instead, you want “bcrypt-nodejs”.

# npm install bcrypt-nodejs
bcrypt-nodejs@0.0.3 node_modules\bcrypt-nodejs

On all my platforms (Windows, Ubuntu, Raspbian) this is already installed. So now you just create a script spicer.js:

var bcrypt = require(“bcrypt-nodejs”);
console.log(bcrypt.hashSync(“aqenbpuu”);

This produces the following hash, which has the same work factor as the one generated by the PHP script above:

$2a$10$Ulbm//hEqMoco8FLRI6k8uVIrGqipeNbyU53xF2aYx3LuQ.xUEmz6

Hashcat and John then are the same speed cracking this one as the other one. The first characters $2a$ define the hash type (bcrypt). Apparently, there’s a slightly difference between that and $2y$, but that doesn’t change the analysis.


The first comment below questions the speed I get, because running Hashcat in benchmark mode, it gets much higher numbers for bcrypt.

This is actually normal, due to different iteration counts.

A bcrypt hash includes an iteration count (or more precisely, the logarithm of an iteration count). It repeats the hash that number of times. That’s what the $10$ means in the hash:

$2y$10$………

The Hashcat benchmark uses the number 5 (actually, 2^5, or 32 times) as it’s count. But the default iteration count produced by PHP and NodeJS is 10 (2^10, or 1024 times). Thus, you’d expect these hashes to run at a speed 32 times slower.

And indeed, that’s what I get. Running the benchmark on my machine, I get the following output:

Hashtype: bcrypt, Blowfish(OpenBSD)
Speed.Dev.#1…..:    10052 H/s (82.28ms)

Doing the math, dividing 1052 hashes/sec by 321 hashes/sec, I get 31.3. This is close enough to 32, the expected answer, giving the variabilities of thermal throttling, background activity on the machine, and so on.

Googling, this appears to be a common complaint. It’s be nice if it said something like ‘bcrypt[speed=5]’  or something to make this clear.


Spicer tweeted another password, “n9y25ah7”. Instead of all lower-case, this is lower-case plus digits, or 36 to the power of 8 combinations, so it’s about 13 times harder (36/26)^8, which is roughly in the same range.


BTW, there are two notes I want to make.

The first is that a good practical exercise first tries to falsify the theory. In this case, I deliberately tested whether Hashcat and John were actually cracking the right password. They were. They both successfully cracked the two character password “ax”. I also tested GPU vs. CPU. Everyone knows that GPUs are faster for password cracking, but also everyone knows that Bcrypt is designed to be hard to run on GPUs.

The second note is that everything here is already discussed in my study guide on command-lines [*]. I mention that you can run PHP on the command-line, and that you can use Hashcat and John to crack passwords. My guide isn’t complete enough to be an explanation for everything, but it’s a good discussion of where you need to end up.

The third note is that I’m not a master of any of these tools. I know enough about these tools to Google the answers, not to pull them off the top of my head. Mastery is impossible, don’t even try it. For example, bcrypt is one of many hashing algorithms, and has all by itself a lot of complexity, such as the difference between $2a$ and $2y$, or the the logarithmic iteration count. I ignored the issue of salting bcrypt altogether. So what I’m saying is that the level of proficiency you want is to be able to google the steps in solving a problem like this, not actually knowing all this off the top of your head.

Continue reading Is ‘aqenbpuu’ a bad password?

Posted in Uncategorized