Package org.parosproxy.paros.model

Examples of org.parosproxy.paros.model.SiteNode


                    showBrowser(ref);                                  
                       

                } else if (lastInvoker.getName().equals("treeSite")) {
                    JTree tree = (JTree) lastInvoker;
                    SiteNode node = (SiteNode) tree.getLastSelectedPathComponent();
                    ref = node.getHistoryReference();
                    showBrowser(ref);
                }
          }
        });
View Full Code Here


      menuItemSpider.setText("Spider...");
      menuItemSpider.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent e) {
            JTree siteTree = getView().getSiteTreePanel().getTreeSite();
                SiteNode node = (SiteNode) siteTree.getLastSelectedPathComponent();
                HttpMessage msg = null;
                if (node == null) {
                    getView().showWarningDialog("You need to visit the website via a browser first and select a URL/folder/node in the 'Sites' panel displayed.");
                    return;
                }
                  setStartNode(node);
                  if (node.isRoot()) {
                      showDialog("All sites will be crawled");
                  } else {
                        try {
                            msg = node.getHistoryReference().getHttpMessage();
                        } catch (Exception e1) {
                            return;
                        }
                        String tmp = msg.getRequestHeader().getURI().toString();
                        showDialog(tmp);
View Full Code Here

        this.addActionListener(new java.awt.event.ActionListener() {

          public void actionPerformed(java.awt.event.ActionEvent e) {   
            if (treeSite != null) {
                SiteNode node = (SiteNode) treeSite.getLastSelectedPathComponent();
                extension.setStartNode(node);
                  if (node.isRoot()) {
                      extension.showDialog("All sites will be crawled");
                  } else {
                      try {
                          HttpMessage msg = node.getHistoryReference().getHttpMessage();
                          if (msg != null) {
                              String tmp = msg.getRequestHeader().getURI().toString();
                              extension.showDialog(tmp);
                          }
                      } catch (Exception e1) {
View Full Code Here

  }
 
    public boolean isEnableForComponent(Component invoker) {
        treeSite = getTree(invoker);
        if (treeSite != null) {
        SiteNode node = (SiteNode) treeSite.getLastSelectedPathComponent();
        if (node != null) {
            this.setEnabled(true);
        } else {
            this.setEnabled(false);
        }
View Full Code Here

    return progressBar;
  }
 
  public void valueChanged(javax.swing.event.TreeSelectionEvent e) {
      JTree siteTree = extension.getView().getSiteTreePanel().getTreeSite();
      SiteNode node = (SiteNode) siteTree.getLastSelectedPathComponent();
      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);
                    //getTxtDisplay().setCaretPosition(0);
                   
View Full Code Here

            return;
        }
        extension.getHistoryList().removeElement(ref);
        ref.delete();

        SiteNode node = ref.getSiteNode();
        if (node == null) {
            return;
        }

        Session session = Model.getSingleton().getSession();
        SiteMap map = session.getSiteTree();

        if (node.getHistoryReference() == ref) {
            // same active Node
            PopupPurgeMenu.purge(map, node);
        } else {
            node.getPastHistoryReference().remove(ref);
        }       

    }
View Full Code Here

        if (ref == null) {
            return;
        }
        extension.getHistoryList().removeElement(ref);

        SiteNode node = ref.getSiteNode();
        if (node == null) {
            return;
        }

        Session session = Model.getSingleton().getSession();
        SiteMap map = session.getSiteTree();

        if (node.getHistoryReference() == ref) {
            // same active Node
            PopupDeleteMenu.delete(map, node);
        } else {
            node.getPastHistoryReference().remove(ref);
        }       

    }
View Full Code Here

      treeSite.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {

        public void valueChanged(javax.swing.event.TreeSelectionEvent e) {   

            HttpMessage msg = null;
            SiteNode node = (SiteNode) treeSite.getLastSelectedPathComponent();
            if (node == null)
                return;
            if (!node.isRoot()) {
                        try {
                            msg = node.getHistoryReference().getHttpMessage();
                        } catch (Exception e1) {
                            return;
                           
                        }
View Full Code Here

    selectButton.setIcon(new ImageIcon(View.class.getResource("/resource/icon/16/094.png"))); // Globe icon
    selectButton.addActionListener(new java.awt.event.ActionListener() {
      @Override
      public void actionPerformed(java.awt.event.ActionEvent e) {
        NodeSelectDialog nsd = new NodeSelectDialog(View.getSingleton().getMainFrame());
        SiteNode node = null;
        try {
          node = Model.getSingleton().getSession().getSiteTree().findNode(new URI(getUrlField().getText(), false));
        } catch (Exception e2) {
          // Ignore
        }
        node = nsd.showDialog(node);
        if (node != null && node.getHistoryReference() != null) {
          try {
            getUrlField().setText(node.getHistoryReference().getURI().toString());
          } catch (Exception e1) {
            // Ignore
          }
        }
      }
View Full Code Here

 
  @Override
  public void run() {
    stopAttack = false;
        try {
        SiteNode startNode = null;
        String urlString = url.toString();

        if (startNode == null) {
          startNode = this.accessNode(this.url);
      }
     
      if (startNode == null) {
        logger.debug("Failed to access URL " + urlString);
        extension.notifyProgress(Progress.failed);
        return;
      }
          if (stopAttack) {
        logger.debug("Attack stopped manually");
        extension.notifyProgress(Progress.stopped);
            return;
          }

      ExtensionSpider extSpider = (ExtensionSpider) Control.getSingleton().getExtensionLoader().getExtension(ExtensionSpider.NAME);
      if (extSpider == null) {
        logger.error("No spider");
        extension.notifyProgress(Progress.failed);
        return;
      } else {
        extension.notifyProgress(Progress.spider);
        extSpider.startScan(startNode);
      }
     
      // Give some time to the spider to finish to setup and start itself.
      sleep(1500);
     
      try {
         // Wait for the spider to complete
        while (extSpider.isScanning(startNode, true)) {
          sleep (500);
          if (this.stopAttack) {
            extSpider.stopScan(startNode);
            break;
          }
        }
      } catch (InterruptedException e) {
        // Ignore
      }
          if (stopAttack) {
        logger.debug("Attack stopped manually");
        extension.notifyProgress(Progress.stopped);
            return;
          }
         
          // Pause before the spider seems to help
          sleep(2000);

      if (stopAttack) {
        logger.debug("Attack stopped manually");
        extension.notifyProgress(Progress.stopped);
        return;
      }

      if (startNode.isLeaf() && !((SiteNode)startNode.getParent()).isRoot()
               && !((SiteNode)startNode.getParent().getParent()).isRoot()) {
            // Start node is a leaf and isnt root or a top level app (eg www.example.com/app1)
            // Go up a level
            startNode = (SiteNode)startNode.getParent();
          }
     
      ExtensionActiveScan extAscan = (ExtensionActiveScan) Control.getSingleton().getExtensionLoader().getExtension(ExtensionActiveScan.NAME);
      if (extAscan == null) {
        logger.error("No active scanner");
View Full Code Here

TOP

Related Classes of org.parosproxy.paros.model.SiteNode

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.