INNER CODE UNIT · Python

riskscore

idnahacks/GoodHound · goodhound/ghresults.py:33

        riskscore = round((((maxcost-cost)/maxcost)*percentage),1)
        result = [startnode, num_members, percentage, hops, cost, riskscore, fullpath, query, uid]
        results.append(result)
    for u in userswithpath:
        startnode = u.get('startnode')
        hops = u.get('hops')
        cost = u.get('cost')
        fullpath = u.get('full_path')
        endnode = u.get('nodeLabels')[-1]
        query = bh_query(u)
        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
        num_members = 1
        percentage=round(float((num_members/totalenablednonadminusers)*100), 1)
        riskscore = round((((maxcost-cost)/maxcost)*percentage),1)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…