Package org.parosproxy.paros.network

Examples of org.parosproxy.paros.network.HttpMessage


      extension.setStartNode(node);
        if (node.isRoot()) {
            getTxtDisplay().setText("All sites will be crawled");
        } else {
            try {
                HttpMessage msg = node.getHistoryReference().getHttpMessage();
                if (msg != null) {
                    String tmp = msg.getRequestHeader().getURI().toString();
                    getTxtDisplay().setText(tmp);
                }
            } catch (Exception e1) {
              // ZAP: Log the exception
              logger.error(e1.getMessage(), e1);
View Full Code Here


  }

  public void scan() {

    HttpMessage msg = getBaseMsg();
    boolean result = false;

    if (!msg.getRequestHeader().getSecure()) {
      // no need to if non-secure page;
      return;
    } else if (msg.getRequestHeader().isImage()) {
      // does not bother if image is cached
      return;
    } else if (msg.getResponseBody().length() == 0) {
      return;
    }

    if (!matchHeaderPattern(msg, HttpHeader.CACHE_CONTROL, patternNoCache)
        && !matchHeaderPattern(msg, HttpHeader.PRAGMA, patternNoCache)
View Full Code Here

  }

  public void scan() {

    HttpMessage msg = getBaseMsg();
    String txtBody = msg.getResponseBody().toString();
    String txtFound = null;
    Matcher matcher = patternPrivateIP.matcher(txtBody);
    while (matcher.find()) {
      txtFound = matcher.group();
      if (txtFound != null) {
View Full Code Here

   *            true = replace the suffix for checking. false = append the
   *            suffix.
   */
  private void testSuffix(String suffix, boolean replaceSuffix)
      throws IOException {
    HttpMessage msg = getNewMsg();
    URI uri = msg.getRequestHeader().getURI();
    String path = uri.getPath();

    if (path == null || path.equals("")) {
      return;
    }

    if (replaceSuffix) {
      int pos = path.lastIndexOf(".");
      if (pos > -1) {
        path = path.substring(0, pos);
      }
    }

    path = path + suffix;

    uri.setPath(path);
    msg.getRequestHeader().setURI(uri);

    sendAndReceive(msg);

    if (!isFileExist(msg)) {
      return;
View Full Code Here

    return list.size();
  }

  public synchronized HttpMessage get(int i) {

    HttpMessage msg = null;
    try {
      msg = (HttpMessage) list.get(i);
    } catch (Exception e) {
    }
    ;
View Full Code Here

    if (resultNode == null) {
      return null;
    }

    HttpMessage nodeMsg = null;
    try {
      nodeMsg = resultNode.getHistoryReference().getHttpMessage();
    } catch (Exception e) {
      // ZAP: Added error
            log.error(e.getMessage(), e);
View Full Code Here

   *
   * @param ref
   */
  public synchronized void addPath(HistoryReference ref) {

    HttpMessage msg = null;
    try {
      msg = ref.getHttpMessage();
    } catch (Exception e) {
      // ZAP: Added error
            log.error(e.getMessage(), e);
View Full Code Here

      sb.append(path[i].toString());
      if (i < path.length - 1) {
        sb.append('/');
      }
    }
    HttpMessage newMsg = base.cloneRequest();

    URI uri = new URI(sb.toString(), true);
    newMsg.getRequestHeader().setURI(uri);
    newMsg.getRequestHeader().setMethod(HttpRequestHeader.GET);
    newMsg.getRequestBody().setBody("");
    newMsg.getRequestHeader().setContentLength(0);

    HistoryReference historyRef = new HistoryReference(model.getSession(),
        HistoryReference.TYPE_TEMPORARY, newMsg);

    return historyRef;
View Full Code Here

  public String getFileName() {
    return fileName;
  }

  private void saveSiteTree(SiteNode node) {
    HttpMessage msg = null;

    if (!node.isRoot()) {
      if (node.getHistoryReference().getHistoryType() < 0) {
        saveNodeMsg(msg);
      }
View Full Code Here

    }
  }

  public void onHttpRequestSend(HttpMessage msg) {

    HttpMessage existingMsg = model.getSession().getSiteTree().pollPath(msg);

    // check if a msg of the same type exist
    if (existingMsg != null && !existingMsg.getResponseHeader().isEmpty()) {
      if (HttpStatusCode.isSuccess(existingMsg.getResponseHeader().getStatusCode())) {
        // exist, no modification necessary
        return;
      }
    }
View Full Code Here

TOP

Related Classes of org.parosproxy.paros.network.HttpMessage

Copyright © 2018 www.massapicom. 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.