Guest User

JNDI tree functions - Vulnerable tree node @params

a guest
May 17th, 2014
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. @Abdelmoughite Eljoaydi
  3.  
  4. Vulnerable tree node @params (unsanitized) :
  5.  
  6. TreeNode() :
  7. ------------
  8. * The definition of a tree node. Used as a class object
  9. * @param nodeName : The name of the node
  10. * @param nodeUrl  : The target url when the node is clicked (Optional)
  11. * @param altText      : Text which will be shown as a popup when the mouse hovers on the folder
  12.  
  13. function TreeNode(nodeId, parent, nodeName, nodeUrl, iconSrcOpen, iconSrcClosed, popupId, altText, isOpen, hasChildren)
  14. {
  15. this.nodeId       = nodeId;
  16. this.parent       = parent;
  17. this.nodeName     = nodeName;         /** unsanitized User-Controlled data.
  18. this.nodeUrl      = nodeUrl;          /**
  19. this.nId = escapeQuotes(nodeId);     // escape the quotes out of the nodeId string.
  20. this.children     = new Array();
  21. this.hasChildren  = hasChildren;
  22. }
  23.  
  24. CreateTree(startNode) :
  25. ------------------------
  26. /**
  27. * Create the tree
  28. *
  29. * @param startNode   : The node which represents the start point of the tree. If not specified
  30. *                      The tree will start with the first node in the list.
  31. * addNode(parentNode, recursedNodes): function to add a new node in the tree.
  32. *
  33. */
  34.  
  35. function createTree(startNode)
  36. {
  37.  
  38.    preloadIcons();
  39.  
  40.    var node = null;
  41.    var sId = null;
  42.  
  43.    if (startNode != null)
  44.    {
  45.        node = startNode
  46.    } else {
  47.        // get the first node
  48.        if(nodes.length > 0)
  49.           node = nodes[0];
  50.    }
  51.  
  52.    if(node == null)
  53.       return; // nothing can be displayed in the tree.
  54.    
  55.    // if setLocal=true (Note : setLocal it's a variable which decides if the tree is going to expand locally or, if it needs to ask the  //server to get the data), load all the openNodes from cookie.
  56.    if (!isLocal)
  57.       retrieveOpenNodesFromCookie();
  58.    else
  59.       retrieveOpenNodesFromServer();
  60.  
  61.    highlightNode = false;
  62.    if(highlightedNodes != null && highlightedNodes[node.nodeId] != null)
  63.    {
  64.       highlightNode = true;
  65.    }
  66. /**
  67. *main @param node   : The TreeNode object to be written.
  68. *Write a unique node out using document.write. This method is called in case of using treenodes other than a Tree (ie in a list).
  69. **/
  70.    writeNode(node, node.iconSrcOpen, highlightNode, null, node.nodeName);
  71.    document.write('<br />');
  72.  
  73.   var recursedNodes = new Array();
  74.   addNode(node, recursedNodes);
  75.  
  76.   setTimeout(scrollToElement, 300);
  77. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×