Skip to content

Commit

Permalink
fix: rating now take into account the oldest krbtgt password change
Browse files Browse the repository at this point in the history
  • Loading branch information
snowpeacock committed Nov 10, 2023
1 parent cd6fcd4 commit 070c58b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions ad_miner/sources/modules/main_page.py
Expand Up @@ -198,9 +198,7 @@ def create_dico_data(
computers.computers_non_dc_unconstrained_delegations
) if computers.computers_non_dc_unconstrained_delegations else 0,
"users_constrained_delegations": len(computers.users_constrained_delegations) if computers.users_constrained_delegations else 0,
"krb_last_change": max(
[dict["pass_last_change"] for dict in users.users_krb_pwd_last_set]
) if users.users_krb_pwd_last_set else 0,
"krb_last_change": max([dict["pass_last_change"] for dict in users.users_krb_pwd_last_set], default=0),
"users_admin_of_computers": len(users.users_admin_computer_count) if users.users_admin_computer_count else 0,
"server_users_could_be_admin": users.servers_with_most_paths if users.servers_with_most_paths else 0,
"dom_admin_on_non_dc": len(users.users_domain_admin_on_nondc) if users.users_domain_admin_on_nondc else 0,
Expand Down
2 changes: 1 addition & 1 deletion ad_miner/sources/modules/rating.py
Expand Up @@ -23,7 +23,7 @@ def rating(users, domains, computers, objects, arguments):
)
d[
time_since(
users.users_krb_pwd_last_set[0]["pass_last_change"],
max([dict["pass_last_change"] for dict in users.users_krb_pwd_last_set], default=None),
age=1 * 365,
criticity=2,
)
Expand Down

0 comments on commit 070c58b

Please sign in to comment.