[OWASP-WEBSCARAB] Trying to get proxy jar and script working...

David Stidolph dstidolph at gmail.com
Mon Jan 16 13:16:12 EST 2006


Ok, here is my code:

package com.ZipProxy;

import java.io.IOException;
import org.owasp.webscarab.model.Request;
import org.owasp.webscarab.model.Response;
import org.owasp.webscarab.httpclient.HTTPClient;

public class ZipProxyController {
    public Response fetchResponse(HTTPClient nextPlugin, Request request)
throws IOException {
        System.out.println("Inside ZipProxyController .fetchResponse");
        Response response = nextPlugin.fetchResponse(request);
        return response;
    }
}

This is in a java source file titled ZipProxyController.java placed in the
directory <webscarab>\ZipProxy\src\com\ZipProxy
I build this including the class library webscarab.jar in the classpath -
build seems fine.
I build a jar file with a manifest file and the output is ZipProxy.jar in
<webscarab>\ZipProxy
I launch webscarab.jar with:

java -cp webscarab.jar;lib\bsf-2.3.0.jar;lib\bsh-2.0b1.jar
;lib\chardet.jar;lib\concurrent.jar;lib\htmlparser.jar;lib\jcommon-0.8.7.jar
;lib\jfreechart-0.9.12.jar;lib\jhall-2.0_02.jar;lib\tagsoup-1.0rc2.jar;lib\wsdl4j.jar;ZipProxy\ZipProxy.jar
-jar webscarab.jar

(all on one line in the webscarab directory).

I put this script in the Proxy/Bean Shell editor and commited it:

/* Please read the JavaDoc and/or the source to understand what methods are
available */

import org.owasp.webscarab.model.Request;
import org.owasp.webscarab.model.Response;
import org.owasp.webscarab.httpclient.HTTPClient;
import java.io.IOException;

import com.zipproxy.ZipProxyController;

public Response fetchResponse(HTTPClient nextPlugin, Request request) throws
IOException {
   ZipProxyController controller = new ZipProxyController();
   return controller.fetchResponse(nextPlugin, request);
}

I get an error on the new line - it does not understand ZipProxyController.

Suggestions on what I'm doing wrong?  I'm including the built jar file in
the -cp in the invocation of webscarab.jar - I would think this would enable
it.

While I completely agree that having a script interface to access my object
would be the most flexible (no change to WebScarab), I am having trouble
accessing objects outside of what was compiled into WebScarab.

Thanks,

David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owasp.org/pipermail/owasp-webscarab/attachments/20060116/767ed818/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ZipProxy.jar
Type: application/java-archive
Size: 994 bytes
Desc: not available
Url : http://lists.owasp.org/pipermail/owasp-webscarab/attachments/20060116/767ed818/attachment.bin 


More information about the Owasp-webscarab mailing list