INNER CODE UNIT · Python

generateresults

idnahacks/GoodHound · goodhound/ghresults.py:10

def generateresults(groupswithpath, groupswithmembers, totalenablednonadminusers, userswithpath):
    """combine the output of the paths query and the groups query"""
    maxcost = paths.getmaxcost(groupswithpath)
    results = []
    for g in groupswithpath:
        startnode = g.get('startnode')
        hops = g.get('hops')
        cost = g.get('cost')
        fullpath = g.get('full_path')
        endnode = g.get('nodeLabels')[-1]
        #query = bh_query(startnode, hops, endnode)
        query = bh_query(g)
        uid = hashlib.md5(fullpath.encode()).hexdigest()
        if cost == None:
            # While debugging this should highlight edges without a score assigned. CHECK ON THIS LOGIC, I'M NOT SURE IT'S CORRECT.
            logging.info(f"Null edge cost found with {startnode} and {hops} hops.")
            cost = 0
        # find the index of the relative group in groupswithmembers and pull results

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…