Risk
7/31/2012
11:15 AM
Connect Directly
RSS
E-Mail
50%
50%

HTML Access Control Busted By Security Researchers

Open source HTExploit tool can bypass a standard directory protection technique used to secure many types of Web pages, security experts demonstrated at Black Hat.

Two researchers presenting at last week's Black Hat conference in Las Vegas demonstrated a new technique they've discovered for bypassing .htaccess files. Also known as hypertext access files, they're primarily used for setting directory-level access controls for websites, and are common across multiple types of Web server software--including the open source Apache HTTP Server, which is the most commonly used Web server software in the world.

The two presenters--security researcher Maximiliano Soler, who works for Standard Bank in Argentina, and penetration tester Matias Katz, who founded Mkit Argentina--also released a tool under open source license, written in Python, that they developed to exploit the vulnerability. According to the presenters, the tool, named HTExploit, lets users list the contents of a directory protected this way, bypassing the authentication process.

They emphasized that their tool was designed to be used from within protected directories--run by people who already have access to a Web server--rather than via a publicly accessible site. But the vulnerability they uncovered could be used by outsiders to gain access, via the Internet, to parts of websites that are ostensibly protected by an .htaccess file.

[ Black Hat presenters warn of a possible attack on network-connected hardware. Read more at Mass Router Infection Possible: Black Hat. ]

Why bother attacking .htaccess files? The answer is simple: any directory that someone takes the time to protect is more likely to contain sensitive or secret information. "Today [it] is common to find lazy administrators and/or developers using directories located on the same Web server to save backups files, configurations, their own jobs, outdated versions, or new developments to be implemented in the future," the researchers wrote in a related white paper.

The good news is that with some small HTML and PHP tweaks to fix the exploitable configuration errors, thus restricting the types of access requests that can be made, vulnerable .htaccess pages can be made immune to the exploit outlined by Soler and Katz.

The bad news is that the problem they've uncovered may be quite widespread, and it could be used to compromise not just any directory that contains a misconfigured .htaccess file, but potentially any PHP file on the same site.

"What Katz and Soler described in their session is not some rare 'corner case' hack that could only possibly occur in a lab with billions of automated attempts; this is easily testable in the real world, and the tools to exploit it are freely available," said ESET security researcher Cameron Camp in a blog post.

The vulnerability stems from the fact that Apache "hands off PHP-based requests within .htaccess to PHP itself, which has been working fine on millions and millions of websites for years," said Camp. But if the .htaccess file gets fed some type of nonstandard input--in effect, injected--then "PHP automatically--unless otherwise instructed--treats it as a GET request, and allows the utility to start saving the PHP files on a webserver to your local filesystem," he said.

From there, however, the process continues, and begins combing accessed PHP files for any links they contain to other files on the same Web server, then downloading those to the local file system. In short order, an attacker--or penetration tester--could quickly grab copies of many, if not all, PHP files on a Web server. Such files could contain sensitive information, such as "references to login credentials for databases, passwords, personally identifiable information, and a host of other goodies that [could] be sold on the black market or used to enable further exploits," said Camp.

"Now might be a good time to check your website configuration to make sure you're protected, before the bad guys go scouring around trying to use this type of exploit," said Camp. "If you're not the person in charge of your website, you might want to point out this problem to the person who is. They may thank you, a lot."

Your networks may be under attack as you read this, but unless your security personnel are analyzing logs and leveraging common tools that are well known to your network operations teams, you may not find out until it is too late. In our What's Going On?: Monitor Networks To Thwart Intrusions report, we explain how your security and network teams can cooperate and use common tools to detect threats before your databases are compromised. (Free registration required.)

Comment  | 
Print  | 
More Insights
Register for Dark Reading Newsletters
White Papers
Cartoon
Current Issue
Dark Reading, September 16, 2014
Malicious software is morphing to be more targeted, stealthy, and destructive. Are you prepared to stop it?
Flash Poll
Video
Slideshows
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2014-0993
Published: 2014-09-15
Buffer overflow in the Vcl.Graphics.TPicture.Bitmap implementation in the Visual Component Library (VCL) in Embarcadero Delphi XE6 20.0.15596.9843 and C++ Builder XE6 20.0.15596.9843 allows remote attackers to execute arbitrary code via a crafted BMP file.

CVE-2014-2375
Published: 2014-09-15
Ecava IntegraXor SCADA Server Stable 4.1.4360 and earlier and Beta 4.1.4392 and earlier allows remote attackers to read or write to arbitrary files, and obtain sensitive information or cause a denial of service (disk consumption), via the CSV export feature.

CVE-2014-2376
Published: 2014-09-15
SQL injection vulnerability in Ecava IntegraXor SCADA Server Stable 4.1.4360 and earlier and Beta 4.1.4392 and earlier allows remote attackers to execute arbitrary SQL commands via unspecified vectors.

CVE-2014-2377
Published: 2014-09-15
Ecava IntegraXor SCADA Server Stable 4.1.4360 and earlier and Beta 4.1.4392 and earlier allows remote attackers to discover full pathnames via an application tag.

CVE-2014-3077
Published: 2014-09-15
IBM SONAS and System Storage Storwize V7000 Unified (aka V7000U) 1.3.x and 1.4.x before 1.4.3.4 store the chkauth password in the audit log, which allows local users to obtain sensitive information by reading this log file.

Best of the Web
Dark Reading Radio
Archived Dark Reading Radio
CISO Insider: An Interview with James Christiansen, Vice President, Information Risk Management, Office of the CISO, Accuvant