There is a uptick in brute force attacks as related to web applications. The Web Hacking Incident Database keeps track of many attacks, and compiles the results; they show that insufficient anti-automation (which includes DoS attacks, but I won’t be covering that today) are the number one cause of web site incidents.
Using brute force methods are an old standby, and many of the attack proxies offer fantastic brute force abilities. But I always find myself wanting more control, the ability to tweak things, and more intelligent functionality. Unfortunately most of these apps are pretty rigid in the actions they can perform–if the developer didn’t think of what you want to do you are out of luck. In these cases it isn’t so uncommon to find myself writing code in PERL, shell, PHP, Javascript, and whatever else I find I need to pull off a specific test case.
Some web apps are really complex, or occasionally someone even develops an application with good session management designed to resist attack. I recently came across an application that did just this. The login page invalidated the user’s session, and deleted the cookies each time the page was loaded (assuming a login failure.) In addition to this, it had CSRF protections in place, so the form had nonce values, which were tied to the session (no reuse.) If the session and nonce weren’t validated the application threw a security warning and didn’t process the attempted login. Performing a successful brute force attack against this setup poses a few challenges. And neither ZAP nor Burpsuite were meeting my needs (still love em though.)
This is where Selenium comes in very useful. Selenium is a test framework, mostly used by developers and QA test folks. It has very good potential for pen-testing too. It is designed so that you can create a customized brute force attack script in just minutes, that would have otherwise taken hours to accomplish. It runs it through a full featured web browser (usually FireFox, but has other hooks too) so that stuff like tracking application state, nonces, sessions, properly setting referrers and the myriad other crazy dependencies that can arise in a complex web application are handled seamlessly. Basically it allows you to automate a web browser.
I’ll give a quick demo on BackTrack Linux (Ubuntu based.) Here is the overview: Continue reading »
