Examples of HistoryReference


Examples of org.parosproxy.paros.model.HistoryReference

  }

  private void buildHistory(HistoryList historyList, List<Integer> dbList) {

    HistoryReference historyRef = null;
    synchronized (historyList) {
      historyList.clear();

      for (int i = 0; i < dbList.size(); i++) {
        //TODO Casting (Integer) is not necessary
        int historyId = ((Integer) dbList.get(i)).intValue();

        try {
          historyRef = new HistoryReference(historyId);
          historyList.addElement(historyRef);
        } catch (Exception e) {
          e.printStackTrace();
        };
      }
View Full Code Here

Examples of org.parosproxy.paros.model.HistoryReference

    }

  }
 
  private void buildHistory(HistoryList historyList, List<Integer> dbList, HistoryFilter historyFilter) {
      HistoryReference historyRef = null;
      synchronized (historyList) {
          historyList.clear();
         
          for (int i=0; i<dbList.size(); i++) {
              int historyId = (dbList.get(i)).intValue();

              try {
                    historyRef = new HistoryReference(historyId);
                    if (historyFilter.matches(historyRef)) {
                      historyList.addElement(historyRef);
                    }
              } catch (Exception e) {
                e.printStackTrace();
View Full Code Here

Examples of org.parosproxy.paros.model.HistoryReference

  public Alert(RecordAlert recordAlert) {
      this(recordAlert.getPluginId(), recordAlert.getRisk(), recordAlert.getReliability(), recordAlert.getAlert());
      // ZAP: Set the alertId
      this.alertId = recordAlert.getAlertId();
        try {
          historyRef = new HistoryReference(recordAlert.getHistoryId());
            setDetail(recordAlert.getDescription(), recordAlert.getUri(),
                recordAlert.getParam(), recordAlert.getOtherInfo(),
                recordAlert.getSolution(), recordAlert.getReference(),
                historyRef.getHttpMessage());
            // ZAP: Set up the Alert History Id
View Full Code Here

Examples of org.parosproxy.paros.model.HistoryReference

                if (treeSite != null) {
                SiteNode node = (SiteNode) treeSite.getLastSelectedPathComponent();

                  ManualRequestEditorDialog dialog = extension.getResendDialog();
                  HistoryReference ref = node.getHistoryReference();
                  HttpMessage msg = null;
                  try {
                        msg = ref.getHttpMessage().cloneRequest();
                        dialog.setMessage(msg);
                        dialog.setVisible(true);
                    } catch (HttpMalformedHeaderException e1) {
                        e1.printStackTrace();
                    } catch (SQLException e1) {
View Full Code Here

Examples of org.parosproxy.paros.model.HistoryReference

      public void actionPerformed(java.awt.event.ActionEvent e) {

        ManualRequestEditorDialog dialog = extension.getResendDialog();

        JList listLog = extension.getLogPanel().getListLog();
        HistoryReference ref = (HistoryReference) listLog.getSelectedValue();
        HttpMessage msg = null;
        try {
          msg = ref.getHttpMessage().cloneRequest();
          dialog.setMessage(msg);
          dialog.setVisible(true);
        } catch (HttpMalformedHeaderException e1) {
          e1.printStackTrace();
        } catch (SQLException e1) {
View Full Code Here

Examples of org.parosproxy.paros.model.HistoryReference

        node.getHistoryReference().delete();
      }

      // delete past reference in node
      while (node.getPastHistoryReference().size() > 0) {
        HistoryReference ref = (HistoryReference) node
            .getPastHistoryReference().get(0);
        ext.getHistoryList().removeElement(ref);
        ref.delete();
        node.getPastHistoryReference().remove(0);
      }

      map.removeNodeFromParent(node);
    }
View Full Code Here

Examples of org.parosproxy.paros.model.HistoryReference

          .getExtensionLoader().getExtension("ExtensionHistory");
      ext.getHistoryList().removeElement(node.getHistoryReference());

      // delete past reference in node
      while (node.getPastHistoryReference().size() > 0) {
        HistoryReference ref = (HistoryReference) node
            .getPastHistoryReference().get(0);
        ext.getHistoryList().removeElement(ref);
        node.getPastHistoryReference().remove(0);
      }
View Full Code Here

Examples of org.parosproxy.paros.model.HistoryReference

    return false;

  }

  private void addHistory(HttpMessage msg, int type) {
    HistoryReference historyRef = null;
    try {
      historyRef = new HistoryReference(model.getSession(), type, msg);
    } catch (Exception e) {
      // ZAP: Log exceptions
          log.warn(e.getMessage(), e);
      return;
    }

    if (type != HistoryReference.TYPE_MANUAL && type != HistoryReference.TYPE_HIDDEN) {
      return;
    }

    // add history to list (log panel). Must use event queue because this
    // proxylistener may not be run from event queue.
    // TODO: AXEL... This code is really dirty... please cleanup
    synchronized (historyList) {
      if (type == HistoryReference.TYPE_MANUAL) {
       
        if (pattern == null && historyFilter == null) {
                    addHistoryInEventQueue(historyRef);
                } else if (historyFilter != null) {
                  if (historyFilter.matches(historyRef)) {
                        addHistoryInEventQueue(historyRef);
                  }
                } else {
                    StringBuffer sb = new StringBuffer();
                    sb.append(msg.getRequestHeader().toString());
                    sb.append(msg.getRequestBody().toString());
                    if (!msg.getResponseHeader().isEmpty()) {
                        sb.append(msg.getResponseHeader().toString());
                        sb.append(msg.getResponseBody().toString());
                       
                    }
                    if (pattern.matcher(sb.toString()).find()) {
                        addHistoryInEventQueue(historyRef);
                    }
                }
       
        //TODO: Old Andiparos Code
        /*
        String uri = msg.getRequestHeader().getURI().toString();
        if (uriFilterPattern != null && pattern != null) {
          if (uriFilterPattern.matcher(uri).find() && ifHeaderPatternMatches(msg, historyRef)) {
            addHistoryInEventQueue(historyRef);
          }
        } else if (uriFilterPattern != null) {
          if (uriFilterPattern.matcher(uri).find()) {
            addHistoryInEventQueue(historyRef);
          }
        } else if (pattern != null) {
          if (ifHeaderPatternMatches(msg, historyRef)) {
            addHistoryInEventQueue(historyRef);
          }
        } else {
          addHistoryInEventQueue(historyRef);
        }*/
       
      }
    }

    // add history to site panel. Must use event queue because this
    // proxylistener may not be run from event queue.
    final HistoryReference ref = historyRef;
    final HttpMessage finalMsg = msg;
    if (EventQueue.isDispatchThread()) {
      model.getSession().getSiteTree().addPath(ref, msg);
      if (isFirstAccess) {
        isFirstAccess = false;
View Full Code Here

Examples of org.parosproxy.paros.model.HistoryReference

  }

  private void writeAlertToDB(Alert alert) throws HttpMalformedHeaderException, SQLException {

    TableAlert tableAlert = getModel().getDb().getTableAlert();
    HistoryReference ref = new HistoryReference(getModel().getSession(), HistoryReference.TYPE_SCANNER, alert.getMessage());
   
    // ZAP: cope with recordScan being null
        int scanId = 0;
        if (recordScan != null) {
          scanId = recordScan.getScanId();
        }
       
    RecordAlert recordAlert = tableAlert.write(scanId, alert.getPluginId(),
        alert.getAlert(), alert.getRisk(), alert.getReliability(),
        alert.getDescription(), alert.getUri(), alert.getParam(),
        alert.getOtherInfo(), alert.getSolution(),
        alert.getReference(), ref.getHistoryId(),
        alert.getSourceHistoryId());

    alert.setAlertId(recordAlert.getAlertId());

  }
View Full Code Here

Examples of org.parosproxy.paros.model.HistoryReference

    super();
  }

  QueueItem(Session session, int historyType, HttpMessage msg)
      throws HttpMalformedHeaderException, SQLException {
    ref = new HistoryReference(session, historyType, msg);
  }
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.