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

lists at dawes.za.net lists at dawes.za.net
Mon Jan 16 15:08:25 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
  ^^^^
   Here is your problem. the -jar flag overrides your classpath that you
specify on the command line, and uses the classpath specified in the
manifest in the webscarab.jar file.

invoke it like:

java -cp all;the;jars org.owasp.webscarab.ui.swing.Main

>
> (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;
             ^^^^^^^^
             Case is important.

>
> 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.

See above.
>
> 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.
>

Regards,

Rogan





More information about the Owasp-webscarab mailing list