MCPcopy Create free account
hub / github.com/secdev/scapy / tree

Method tree

scapy/modules/ldaphero.py:489–513  ·  view source on GitHub ↗

Tree command.

(self, *args)

Source from the content-addressed store, hash-verified

487 self.bound = True
488
489 def tree(self, *args):
490 """
491 Tree command.
492 """
493 if not self.connected:
494 return
495
496 # Get namingContexts from rootDSE
497 try:
498 results = self.client.search(attributes=["namingContexts"])
499 except LDAP_Exception as ex:
500 self.tprint(
501 ex.diagnosticMessage or "Error: %s" % ex.resultCode,
502 tags=["error"],
503 )
504 return
505
506 attrs = results.get("", None) # root
507 if attrs is None:
508 return
509
510 if "namingContexts" in attrs:
511 self.tk_tree.delete(*self.tk_tree.get_children())
512 for root in attrs["namingContexts"]:
513 self.tk_tree.insert("", "end", root, text=root)
514
515 def _showsearchresult(self, baseObject, results):
516 """

Callers

nothing calls this directly

Calls 4

tprintMethod · 0.95
searchMethod · 0.45
getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected