Examples of IInjectionModuleContext


Examples of com.subgraph.vega.api.scanner.IInjectionModuleContext

  private final ICrawlerResponseProcessor fetchDirProcessor = new DirectoryProcessor();

  @Override
  public void processResponse(IWebCrawler crawler, HttpUriRequest request,
      IHttpResponse response, Object argument) {
    final IInjectionModuleContext ctx = (IInjectionModuleContext) argument;
    final IPathState ps = ctx.getPathState();
    if(ctx.getCurrentIndex() == 0) {
      processInitialResponse(request, response, ctx, ps);
    } else {
      processProbeResponses(request, response, ctx, ps);
    }
  }
View Full Code Here

Examples of com.subgraph.vega.api.scanner.IInjectionModuleContext

    ctx.debug("Sending probes to resolve unknown path.");
    sendProbeRequests(ps);
  }

  private void sendProbeRequests(IPathState ps) {
    final IInjectionModuleContext ctx = ps.createModuleContext();
    ctx.submitAlteredRequest(this, "/", 1);
    ctx.submitAlteredRequest(this, "/abc123/", 2);
  }
View Full Code Here

Examples of com.subgraph.vega.api.scanner.IInjectionModuleContext

      fetchFileProcessor.processResponse(null, req, res, ctx);
  }
 
  @Override
  public void processException(HttpUriRequest request, Throwable ex, Object argument) {
    final IInjectionModuleContext ctx = (IInjectionModuleContext) argument;
    ctx.reportRequestException(request, ex);
  }
View Full Code Here

Examples of com.subgraph.vega.api.scanner.IInjectionModuleContext

  private final ParametricCheckHandler parametricChecks = new ParametricCheckHandler();
  private final CaseSensitivityCheck caseCheck = new CaseSensitivityCheck();
  @Override
  public void processResponse(IWebCrawler crawler, HttpUriRequest request,
      IHttpResponse response, Object argument) {
    final IInjectionModuleContext ctx = (IInjectionModuleContext) argument;
   
    final IPathState ps = ctx.getPathState();
    ps.setResponse(response);
    ps.getPath().setVisited(true);

    if(response.isFetchFail()) {
      ctx.error(request, response, "during initial file fetch");
      return;
    }
   
    final IPathState ps404Parent = ps.get404Parent();
    boolean is404Response = ((ps404Parent == null) && response.getResponseCode() == 404) ||
      ((ps404Parent != null) && ps404Parent.has404FingerprintMatching(response.getPageFingerprint()));
   
    if(is404Response) {
      ps.setPageMissing();
    } else {
      if(response.getResponseCode() > 400)
        ctx.debug("Page is not accessible.  http code ("+ response.getResponseCode() + ")");
       
      final IPathState pps = ps.getParentState();
      if(pps == null || pps.getResponse() == null || !ps.matchesPathFingerprint(pps.getPathFingerprint())) {
        ctx.responseChecks(request, response);
      }
      if(ps404Parent != null && !ps.isParametric())
        secondaryExtChecks.initialize(ps);
      if(ps.getPath().getPathType() == PathType.PATH_FILE)
        caseCheck.initialize(ps);
View Full Code Here

Examples of com.subgraph.vega.api.scanner.IInjectionModuleContext

      injectionChecks.initialize(ps);
    }
  }
  @Override
  public void processException(HttpUriRequest request, Throwable ex, Object argument) {
    final IInjectionModuleContext ctx = (IInjectionModuleContext) argument;
    ctx.reportRequestException(request, ex);
  }
View Full Code Here

Examples of com.subgraph.vega.api.scanner.IInjectionModuleContext

  }

  @Override
  public void processResponse(IWebCrawler crawler, HttpUriRequest request,
      IHttpResponse response, Object argument) {
    final IInjectionModuleContext ctx = (IInjectionModuleContext) argument;
    final IPathState ps = ctx.getPathState();
    ps.getPath().setVisited(true);

    ps.setResponse(response);

    if(ps.isRootPath())
      ctx.pivotChecks(request, response);

    dir404Tests.initialize(ps);

    if(ps.get404Parent() != null)
      secondaryExt.initialize(ps);
View Full Code Here

Examples of com.subgraph.vega.api.scanner.IInjectionModuleContext

      secondaryExt.initialize(ps);
  }

  @Override
  public void processException(HttpUriRequest request, Throwable ex, Object argument) {
    final IInjectionModuleContext ctx = (IInjectionModuleContext) argument;
    ctx.reportRequestException(request, ex);
  }
View Full Code Here

Examples of com.subgraph.vega.api.scanner.IInjectionModuleContext

  private final ICrawlerResponseProcessor ognlHandler = new OgnlHandler();
  private final InjectionChecks injectionChecks = new InjectionChecks();

  @Override
  public void initialize(IPathState ps) {
    final IInjectionModuleContext ctx = ps.createModuleContext();
    // XXX check URI filter and parameter filter
    if(!ps.isParametric() || false) {
      ctx.debug("not parametric??");
      ps.setDone();
      return;
    }

    final String param = generateBogusParameter();
    for(int i = 0; i < 5; i++) {
      ctx.submitAlteredRequest(this, param, i);
    }

  }
View Full Code Here

Examples of com.subgraph.vega.api.scanner.IInjectionModuleContext

      return;
    scheduleNext(ctx.getPathState());
  }

  private void scheduleNext(IPathState ps) {
    final IInjectionModuleContext ctx = ps.createModuleContext();
    final String pname = ps.getFuzzableParameter().getName();
    if(!ps.isBogusParameter() && !ps.getResponseVaries() && pname != null) {
      ctx.submitAlteredParameterNameRequest(ognlHandler, "[0]['"+pname+"']", 0);
      ctx.submitAlteredParameterNameRequest(ognlHandler, "[0]['vega']", 1);
    }
    injectionChecks.initialize(ps);

  }
View Full Code Here

Examples of com.subgraph.vega.api.scanner.IInjectionModuleContext

    this.injectionChecks = injectionChecks;
  }

  @Override
  public void initialize(IPathState ps) {
    final IInjectionModuleContext ctx = ps.createModuleContext();
    URI u = ps.getPath().getUri().resolve("PUT-putfile");
    HttpHost host = URIUtils.extractHost(u);
    RequestLine line = new BasicRequestLine(HttpPut.METHOD_NAME, u.getPath(), HttpVersion.HTTP_1_1);
    VegaHttpUriRequest r = new VegaHttpUriRequest(host, line);
    ctx.submitRequest(r, this);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.