INNER CODE UNIT · Python
total_users_percentage
idnahacks/GoodHound · goodhound/ghresults.py:100
total_users_percentage = round(((totaluniqueuserswithpath/totalenablednonadminusers)*100),1)
grandtotals = [{"Total Non-Admins with a Path":totaluniqueuserswithpath, "Percentage of Total Enabled Non-Admins":total_users_percentage, "Total Paths":totalpaths, "% of Paths Seen Before":seen_before/totalpaths*100, "New Paths":new_path}]
grandtotalsdf = pd.DataFrame(grandtotals)
weakest_linkdf = pd.DataFrame(weakest_links, columns=["Weakest Link", "Number of Paths it appears in", "% of Total Paths", "Bloodhound Query"])
busiestpathsdf = pd.DataFrame(top_results, columns=["Starting Node", "Number of Enabled Non-Admins with Path", "Percent of Total Enabled Non-Admins with Path", "Number of Hops", "Exploit Cost", "Risk Score", "Path", "Bloodhound Query", "UID"])
busiestpathsdf = busiestpathsdf.drop(columns=["UID"])
return grandtotalsdf, weakest_linkdf, busiestpathsdf
def output(args, grandtotalsdf, weakest_linkdf, busiestpathsdf, scandatenice, starttime):
finish = datetime.now()
totalruntime = round((finish - starttime).total_seconds() / 60)
logging.info("Total runtime: {} minutes.".format(totalruntime))
pd.set_option('display.max_colwidth', None)
if args.output_format == "stdout":
print("\n\nGRAND TOTALS")
print("============")
print(grandtotalsdf.to_string(index=False))
print("\nBUSIEST PATHS")