Skip to content

Commit

Permalink
Added connected feature allowing user to display all domains reachabl…
Browse files Browse the repository at this point in the history
…e from source
  • Loading branch information
sixdub committed Oct 26, 2014
1 parent 1673cba commit 6690723
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions trust_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,24 @@ def do_all_paths(self,args):
else:
print "[-] Node %s or %s does not exist :(" % (node1, node2)

#Show all domains that can be reached from a source domain
def do_connected(self, args):
"Show all nodes able to be reached from a source node"
if args:
node = args.upper()
if G.has_node(node):
conn_count = 0
print "[*] Domains reachable from \"%s\""%(node)
for dest in G.nodes():
if nx.has_path(G, node, dest):
print dest
conn_count+=1
print "[*] %d domains reachable from source"%conn_count
else:
print "[-] Error: No node in the graph"
else:
print "[-] Error: Args Needed"

#Print all neighbors of a certain node
def do_neighbors(self,args):
"Show all the neighbors for a certain node"
Expand Down

0 comments on commit 6690723

Please sign in to comment.