Owasp Webscarab: Uncovering The Hidden Treasures
Owasp Webscarab: Uncovering The Hidden Treasures
Overview
WebScarab aims to facilitate the review of web applications Functional operations Security Operations It was written by a techie for personal use
Lack of examples
Objectives
Show participants how some of the less obvious features work Using the spider Request Transforms Using the Fuzzer
Comparing Responses
Searching WebScarab history
Objectives
Show participants how some of the less obvious features work Exploring the Beanshell Writing Proxy Intercept scripts Writing Script Manager Scripts
WebScarab Spider
Request Transforms
From a regex
Searching in TextAreas
Press Ctrl-F in the TextArea to show the Search Bar
Searching in TextAreas
Search string is actually a regex. WebScarab highlights any groups specified
Comparing responses
Comparing responses
You can also view the changes in a single window, rather than side by side Pressing Ctrl-L in the compare window. This is a toggle key.
Searching history
Searching history
Search expression is a BeanShell snippet BeanShell is just interpreted Java, with some leniencies Two predefined variables, request and response If the expression returns true, the conversation is shown
HttpUrl getURL()
void setURL(HttpUrl url)
String getStatus()
void getStatus(String status)
String getMessage()
void setMessage(String message) String getStatusLine()
Message API
String[] getHeaderNames() String getHeader(String name)
byte[] getContent()
void setContent(byte[] content)
Proxy->BeanShell
Other simple examples: request.deleteHeader("HeaderName"); response = fetchResponse(request); request.deleteHeader("HeaderName"); response = fetchResponse(request); response.addheader("X-MyMarker", "I deleted HeaderName"); request.setHeader(Cookie, JSESSIONID=somevalue);
Script Manager
An alternative way of executing scripts Script structure is somewhat different See the explanation for details E.g. Intercept Request Called when a new request has been submitted by the browser use connection.getRequest() and connection.setRequest(request) to perform changes request = connection.getRequest(); request.setHeader(Cookie, JSESSIONID=somevalue); connection.setRequest(request);
Script Manager
Big difference is that you can load multiple scripts per hook Can be enabled and disabled independently
BeanShell persistence
It is possible to persist values across script invocations import org.owasp.webscarab.model.*; Request r = connection.getRequest(); Integer i = bsf.lookupBean("count"); if (i == null) i = new Integer(0); if (i.intValue() %2 == 0) { // do something } i = new Integer(i.intValue()++); bsf.registerBean("count", i); connection.setRequest(r);
Scripted plugin
Intended to replace cat request | nc target 80 | grep . . . Allows for multi-threaded execution of requests (4 threads hardcoded) Object-oriented processing of results
getConversationCount() getConversationAt(int) getRequest(int) getRequest(ConversationID) getResponse(int) getResponse(ConversationID) getConversationProperty(int, String) getConversationProperty(ConversationID, String) getChildCount(String) // == an URL getChildAt(String, int) // == an URL getUrlProperty(String, String) fetchResponse(Request)
addConversation(Response)
Scripted plugin
Complex example