コード例 #1
0
ファイル: RequestEditView.java プロジェクト: GHubgenius/Vega
  public void sendRequest() {
    if (requestBuilderPartCurr != null) {
      try {
        requestBuilderPartCurr.processContents();
      } catch (Exception e) {
        displayExceptionError(e);
        return;
      }
    }

    HttpUriRequest uriRequest;
    try {
      uriRequest = requestBuilder.buildRequest();
    } catch (Exception e) {
      displayExceptionError(e);
      return;
    }

    BasicHttpContext ctx = new BasicHttpContext();
    IHttpResponse response;
    try {
      response = requestEngine.sendRequest(uriRequest, ctx);
      responseViewer.displayHttpResponse(response.getRawResponse());
    } catch (Exception e) {
      displayExceptionError(e);
      return;
    }
    if (contentAnalyzer != null) {
      contentAnalyzer.processResponse(response);
    }

    if (requestBuilderPartCurr != null) {
      requestBuilderPartCurr.refresh();
    }
  }
コード例 #2
0
ファイル: DirParentCheck.java プロジェクト: troiska/Vega
  @Override
  public void runModule(
      HttpUriRequest request, IHttpResponse response, IInjectionModuleContext ctx) {
    final IPathState ps = ctx.getPathState();

    if (response.isFetchFail()) {
      ctx.error(request, response, "Fetch failed during parent directory check");
    } else if (ps.matchesPathFingerprint(response.getPageFingerprint())) {
      ctx.debug("Problem with parent directory behavior");
      ctx.getPathState().setBadParentDirectory();
    }

    ipsCheck.initialize(ctx.getPathState());
  }
コード例 #3
0
ファイル: FileProcessor.java プロジェクト: troiska/Vega
  @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);
    }

    ps.unlockChildren();
    if (ps.isParametric()) {
      parametricChecks.initialize(ps);
    } else {
      injectionChecks.initialize(ps);
    }
  }