Package org.zaproxy.zap.extension.spider

Examples of org.zaproxy.zap.extension.spider.ExtensionSpider


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


        }
    }

    private void spider(SiteNode startNode) throws InterruptedException, MalformedURLException {
        logger.info("About to grab spider.");
        ExtensionSpider extSpider = (ExtensionSpider) Control.getSingleton().getExtensionLoader().getExtension(ExtensionSpider.NAME);
        logger.info("Starting spider.");

        if (extSpider == null) {
            logger.error("No spider");
            extension.notifyProgress(Progress.FAILED);
            return;
        } else if (startNode == null) {
            logger.error("start node was null");
            extension.notifyProgress(Progress.FAILED);
            return;
        } else {
            logger.info("Starting spider.");
            extension.notifyProgress(Progress.SPIDER);
            startNode.setAllowsChildren(true);
            for (String node : nodes) {
                logger.info("About to call accessNode.");
                SiteNode childNode = accessNode(new URL(url + node));
                logger.info("got out of accessNode.");
                if (childNode != null) {
                    logger.info("Child node != null, child node is " + childNode);
                    //childNode.setParent(startNode);
                    //startNode.add(childNode);
                } else {
                    logger.info("child node was null.");
                }
                //extSpider.startScanNode(childNode);
            }
            logger.info("about to start the extension. node = " + startNode);
            logger.info("child count = " + startNode.getChildCount());
            extSpider.startScanNode(startNode);
            logger.info("Started the extension.");
        }

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

TOP

Related Classes of org.zaproxy.zap.extension.spider.ExtensionSpider

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.