Perimeter
11/17/2009
03:10 PM
Robert Graham
Robert Graham
Commentary
50%
50%

How To Hack A Brazilian Power Company

The recent "60 Minutes" story claiming hackers had caused power outages in Brazil was (likely) bogus, but that doesn't mean hackers can't do this. The story got widespread coverage in the Brazilian press, which meant hackers there were suddenly interested in the subject. And just days later, chatter appeared on Brazilian hacker Websites expressing interest in ONS, the Website of Brazil's national power grid operator.

The recent "60 Minutes" story claiming hackers had caused power outages in Brazil was (likely) bogus, but that doesn't mean hackers can't do this. The story got widespread coverage in the Brazilian press, which meant hackers there were suddenly interested in the subject. And just days later, chatter appeared on Brazilian hacker Websites expressing interest in ONS, the Website of Brazil's national power grid operator.

A member of the Brazilian press called me and asked if I could confirm whether there was a danger. I confirmed it: The Website had obvious vulnerabilities that any teenager could hack.

The first was the "robots.txt" file. This is a file that tells search engines to ignore parts of a Website. It's the first thing hackers look at: If you don't want part of your Website appearing in search results, then it's likely sometime hackers would be interested in. This was the file at http://www.ons.org.br/robots.txt:

User-agent: *
Disallow: /agentes/agentes.aspx
Disallow: /download/agentes/

According to the underground chatter, the URL http://www.ons.org.br/agentes/agentes.aspx contains all sorts of internal applications that should not be publicly available. It also contains documents and manuals that would teach outsiders a lot about how ONS works.

Picking one of the applications at random, you can enter a username of "asdf'asdf" (with a quote character in the middle). The quote character is a test to see whether the application is vulnerable to SQL injection. The request will be rejected, but what's important is how it will be rejected.

Photobucket

After doing this, you would see the result below:

Photobucket

To a high degree of probability this indicates that the application is vulnerable to SQL injection. However, this is a variant known as "blind" injection: While you can send bad SQL queries to the Website, you cannot see their results. This means that while the Website is vulnerable, it's not something an average teenager would be able to exploit.

Elsewhere on the Website is a registration page. Filling it out and giving a company name of "asdf'asdf" produces the following error message:

Erro ao Cadastrar AgenteLine 1: Incorrect syntax near 'asdf'. Unclosed quotation mark before the character string ',0,')'.insert into cadastro_agente (nm_cod_pk, vc_nome, vc_sobrenome, vc_email, vc_endereco, vc_estado, vc_cidade, vc_ddd_telefone, vc_telefone, vc_sexo,nm_cod_funcao_fk, dt_nascimento, dt_cadastro,vc_info, vc_tratamento, vc_empresa, vc_cep,vc_site, vc_email_secundario, nm_cod_tipo_fk, dt_alteracao, nm_permission_mkt, vc_password, nm_numero, vc_complemento) values(13256, 'Winnie', 'Thepoo', 'teste@mailinator.com', '', 'AC', '', '', '', 'M', '4', '1980-1-1', getDate(), '1', 'Poobear', 'asdf'asdf', '-', '', '', '2', getDate(), 1, 'letmein', 0, '')

This again indicates SQL injection. However, in this case, the injection isn't blind: The error page repeats the underlying SQL query. This sort of injection would be much easier for hackers to exploit.

SQL injection is the most common vulnerability on Websites. Most security professionals add a quote ' mark to their Web input whenever they visit a new site, curious to see whether they will get an error message (like the one above). It's not 100 percent proof that the system is vulnerable, but in my experience doing pen testing, more than 95 percent of the time such a vulnerability will lead to a full compromise of the Website.

ONS was notified last week of this problem. They've confirmed that, indeed, its Website was hacked. It claims to have fixed the SQL injection problems and that there was no danger because there was no connection between its Website network and back-end control network. In my experience, that claim is likely wrong. Data has to be transferred somehow from the power transmission grid to the front-end network. Once a hacker breaks into the network, he can usually find that connection.

My point with this post is to give details, not to scare. Power grids are still more likely to have accidental failures than hacker attacks. If Al Qaeda or the Chinese wanted to create power outage, then they could do so more effectively with 10 well-placed bombs. Hacking is a threat, and it's one that most power companies do take seriously, but it's not something worth panicking about.

Robert Graham is CEO of Errata Security. Special to Dark Reading

Comment  | 
Print  | 
More Insights
Register for Dark Reading Newsletters
White Papers
Cartoon
Current Issue
Dark Reading December Tech Digest
Experts weigh in on the pros and cons of end-user security training.
Flash Poll
Title Partner’s Role in Perimeter Security
Title Partner’s Role in Perimeter Security
Considering how prevalent third-party attacks are, we need to ask hard questions about how partners and suppliers are safeguarding systems and data.
Video
Slideshows
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2014-4807
Published: 2014-11-22
Sterling Order Management in IBM Sterling Selling and Fulfillment Suite 9.3.0 before FP8 allows remote authenticated users to cause a denial of service (CPU consumption) via a '\0' character.

CVE-2014-6183
Published: 2014-11-22
IBM Security Network Protection 5.1 before 5.1.0.0 FP13, 5.1.1 before 5.1.1.0 FP8, 5.1.2 before 5.1.2.0 FP9, 5.1.2.1 before FP5, 5.2 before 5.2.0.0 FP5, and 5.3 before 5.3.0.0 FP1 on XGS devices allows remote authenticated users to execute arbitrary commands via unspecified vectors.

CVE-2014-8626
Published: 2014-11-22
Stack-based buffer overflow in the date_from_ISO8601 function in ext/xmlrpc/libxmlrpc/xmlrpc.c in PHP before 5.2.7 allows remote attackers to cause a denial of service (application crash) or possibly execute arbitrary code by including a timezone field in a date, leading to improper XML-RPC encoding...

CVE-2014-8710
Published: 2014-11-22
The decompress_sigcomp_message function in epan/sigcomp-udvm.c in the SigComp UDVM dissector in Wireshark 1.10.x before 1.10.11 allows remote attackers to cause a denial of service (buffer over-read and application crash) via a crafted packet.

CVE-2014-8711
Published: 2014-11-22
Multiple integer overflows in epan/dissectors/packet-amqp.c in the AMQP dissector in Wireshark 1.10.x before 1.10.11 and 1.12.x before 1.12.2 allow remote attackers to cause a denial of service (application crash) via a crafted amqp_0_10 PDU in a packet.

Best of the Web
Dark Reading Radio
Archived Dark Reading Radio
Now that the holiday season is about to begin both online and in stores, will this be yet another season of nonstop gifting to cybercriminals?