Examples of IPathState


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

      ctx.pivotChecks(ps.createRequest(), ps.getResponse());
      return;
    }

    if(!ps.getParentState().matchesPathFingerprint(ps.getPathFingerprint())) {
      IPathState parent404 = ps.get404Parent();
      if(parent404 == null || !parent404.has404FingerprintMatching(ps.getPathFingerprint())) {
        ctx.pivotChecks(ps.createRequest(), ps.getResponse());
      }
    }
  }
View Full Code Here

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

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

      ctx.error(request, response, "during initial resource fetch");
      return;
    }
    ps.getPath().setVisited(true);
    final IPageFingerprint fp = response.getPageFingerprint();
    final IPathState par = ps.get404Parent();
    final int rcode = response.getResponseCode();
    if((par == null && rcode == 404) || (ps.hasParent404Fingerprint(fp))) {
      ps.setPageMissing();
      ps.unlockChildren();
      ctx.debug("Starting parametric checks on unknown path because page is missing.");
      parametricChecks.initialize(ps);
      return;
    }

    if(par != null && !response.getBodyAsString().isEmpty() && rcode == 200 && fp.isSame(par.getUnknownFingerprint())) {
      ctx.debug("Unknown path fetch matches parent unknown fp, processing as a file.");
      ps.getPath().setPathType(PathType.PATH_FILE);
      fetchFileProcessor.processResponse(null, request, response, ctx);
      return;
    }

    if(par != null && rcode >= 300 && rcode < 400 && fp.isSame(par.getUnknownFingerprint()) && fp.isSame(par.getPathFingerprint())) {
      ctx.debug("Unknown path fetch matches both parent probes, processing as file.");
      ps.getPath().setPathType(PathType.PATH_FILE);
      fetchFileProcessor.processResponse(null, request, response, ctx);
      return;
    }
View Full Code Here

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

    }
    callFetchHandler(ctx, ps);
  }

  private boolean isProbe404(IPathState ps, IHttpResponse response) {
    final IPathState p404 = ps.get404Parent();
    final int rcode = response.getResponseCode();
    final IPageFingerprint rfp = response.getPageFingerprint();
    if(p404 != null)
      return p404.has404FingerprintMatching(rfp);
    else
      return rcode == 404;
  }
View Full Code Here

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

  @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)
View Full Code Here

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

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

  }

  @Override
  public void runModule(HttpUriRequest request, IHttpResponse response,
      IInjectionModuleContext ctx) {
    final IPathState ps = ctx.getPathState();
    if(response.isFetchFail()) {
      ctx.error(request, response, "during PUT checks");
    } else {
      final int rc = response.getResponseCode();
      final IPageFingerprint fp = response.getPageFingerprint();
     
      if(rc >= 200 && rc < 300 && !ps.matchesPathFingerprint(fp) && !ps.has404FingerprintMatching(fp)) {
        final String resource = request.getURI().toString();
        final String key = "vinfo-http-put:" + resource;
        ctx.publishAlert("vinfo-http-put", key, "HTTP PUT succeeded", request, response, "resource", resource);
      }
    }
View Full Code Here

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

    return requestEngine.createGetRequest(host, requestLine);
  }

  @Override
  public void runModule(HttpUriRequest request, IHttpResponse response, IInjectionModuleContext ctx) {
    final IPathState ps = ctx.getPathState();
    if(ctx.hasModuleFailed())
      return;

    if(ctx.getCurrentIndex() == 1 && response.isFetchFail()) {
      ctx.error(request, response, "Fetch failed during IPS tests");
      ctx.setModuleFailed();
      injection.initialize(ps);
    }
    ctx.addRequestResponse(request, response);
    ctx.incrementResponseCount();
    if(!ctx.allResponsesReceived())
      return;

    IPathState p404 = ps.get404Parent();
    if(p404 == null || !p404.isIPSDetected()) {
      if(ctx.getSavedResponse(0).getResponseStatus() != IHttpResponse.ResponseStatus.RESPONSE_OK) {
        ctx.debug("Possible IPS filter detected");
        ctx.getPathState().setIPSDetected();

      } else if(!ctx.isFingerprintMatch(0, 1)) {
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.