Jul 102008
 


OWASP WebScarab is a framework for analysing HTTP and HTTPS applications. Written in Java, WebScarab has several modes of operation, implemented by a number of plugins. In its most common usage, WebScarab operates as an intercepting proxy, allowing the operator to review and modify requests created by the browser before they are sent to the server, and to review and modify responses returned from the server before they are received by the browser. WebScarab is able to intercept both HTTP and HTTPS communication. The operator can also review the conversations (requests and responses) that have passed through WebScarab.

Ideal use for an Administrator, Security Auditor or even a developer, WebScarab gives more insight into the traffic that leaves your browser. All you need to do is to run WebScarab and modify the proxy settings in your browser to “localhost” as proxy server and port “8008”.

In Firefox, Click Edit – Preferences – Advanced – Network Settings and enter the “localhost” and port “8008” as proxy server and port. This gets the browser to pass everything onto the WebScarab application which does the analysis.

Let’s install and run WebScarab as follows:

Note: I’ve done this install and test on openSUSE 11.0 but should just work fine on earlier versions of openSUSE 10.x and SUSE Linux

Install Java Runtime

Being written in Java, you need a minimum of Java runtime installed to run the WebScarab application on your SUSE Linux or openSUSE linux. I’ve done the test here in openSUSE 11.0

opensuse11:~ # yast2 –install java

Download the JAR file from Sourceforge for WebScarab

The latest version can be downloaded here

opensuse11:~ # wget http://switch.dl.sourceforge.net/sourceforge/owasp/webscarab-selfcontained-20070504-1631.jar

opensuse11:~ # java -jar ./webscarab-selfcontained-20070504-1631.jar

This opens the Java based GUI. Now, open the browser and browse pages and view the backend transactions on WebScarab window. Also, you can view the coversation on HTTP or HTTPS in detail.

Some of the features include

Fragments – extracts Scripts and HTML comments from HTML pages as they are seen via the proxy, or other plugins

Proxy – observes traffic between the browser and the web server. The WebScarab proxy is able to observe both HTTP and encrypted HTTPS traffic, by negotiating an SSL connection between WebScarab and the browser instead of simply connecting the browser to the server and allowing an encrypted stream to pass through it. Various proxy plugins have also been developed to allow the operator to control the requests and responses that pass through the proxy.

Manual intercept – allows the user to modify HTTP and HTTPS requests and responses on the fly, before they reach the server or browser.

Beanshell – allows for the execution of arbitrarily complex operations on requests and responses. Anything that can be expressed in Java can be executed.

Reveal hidden fields – sometimes it is easier to modify a hidden field in the page itself, rather than intercepting the request after it has been sent. This plugin simply changes all hidden fields found in HTML pages to text fields, making them visible, and editable.

Bandwidth simulator – allows the user to emulate a slower network, in order to observe how their website would perform when accessed over, say, a modem.

Spider – identifies new URLs on the target site, and fetches them on command.

Manual request – Allows editing and replay of previous requests, or creation of entirely new requests.

SessionID analysis – collects and analyses a number of cookies (and eventually URL-based parameters too) to visually determine the degree of randomness and unpredictability.

Scripted – operators can use BeanShell to write a script to create requests and fetch them from the server. The script can then perform some analysis on the responses, with all the power of the WebScarab Request and Response object model to simplify things.

Parameter fuzzer – performs automated substitution of parameter values that are likely to expose incomplete parameter validation, leading to vulnerabilities like Cross Site Scripting (XSS) and SQL Injection.

Search – allows the user to craft arbitrary BeanShell expressions to identify conversations that should be shown in the list.

Compare – calculates the edit distance between the response bodies of the conversations observed, and a selected baseline conversation. The edit distance is “the number of edits required to transform one document into another”. For performance reasons, edits are calculated using word tokens, rather than byte by byte.

SOAP – There is a plugin that parses WSDL, and presents the various functions and the required parameters, allowing them to be edited before being sent to the server.

Extensions – automates checks for files that were mistakenly left in web server’s root directory (e.g. .bak, ~, etc). Checks are performed for both, files and directories (e.g. /app/login.jsp will be checked for /app/login.jsp.bak, /app/login.jsp~, /app.zip, /app.tar.gz, etc). Extensions for files and directories can be edited by user.

XSS/CRLF – passive analysis plugin that searches for user-controlled data in HTTP response headers and body to identify potential CRLF injection (HTTP response splitting) and reflected cross-site scripting (XSS) vulnerabilities.