/// <summary> /// A password based user vulnerability /// </summary> /// <param name="points"></param> /// <param name="vulntype">A password vulnerability. Other vulnerabilities will result in a disabled vulnerability object</param> /// <param name="username"></param> public UA_PasswordVuln(int points, AccountVulnType vulntype, string username) : base(points, vulntype, username) { if (!Enabled) { return; } switch (VulnType) { case AccountVulnType.PasswordForever: case AccountVulnType.DisableReversableEncryption: case AccountVulnType.PasswordChangeable: case AccountVulnType.PasswordExpires: case AccountVulnType.PasswordImmutable: RegressionEnabled = true; break; case AccountVulnType.ForceExpirePassword: RegressionEnabled = false; break; default: Enabled = false; //Invalid password vulntype break; } if (User == null) { Enabled = false; } OnCompleted += VulnCompleted; OnFailed += VulnFailed; }
/// <summary> /// A user account action vulnerability /// </summary> /// <param name="points">Points to award on completion</param> /// <param name="vulntype">The type of vulnerability. A non-actionable vulntype will result in an inactive vulnerability</param> /// <param name="username">The username (case sensitive) of the target user</param> /// <param name="groupname">The name of the group to evaluate</param> public UA_AccountAction(int points, AccountVulnType vulntype, string username, string groupname = null) : base(points, vulntype, username) { if (!Enabled) { return; } //Unlock todo switch (vulntype) { case AccountVulnType.Add: case AccountVulnType.Remove: RegressionEnabled = false; break; case AccountVulnType.Promote: case AccountVulnType.Demote: case AccountVulnType.Enable: case AccountVulnType.Disable: case AccountVulnType.Unlock: case AccountVulnType.AddGroup: case AccountVulnType.RemoveGroup: RegressionEnabled = true; break; default: Enabled = false; return; } if (User == null) { Enabled = false; } GroupName = groupname?.ToLower() ?? ""; OnCompleted += VulnComplete; OnFailed += VulnDestroyed; }
/// <summary> /// A user account vulnerability /// </summary> /// <param name="points">Amount of points to give when complete</param> /// <param name="VulnType">A type of user account vulnerability</param> /// <param name="username">A case sensitive username</param> public UserAccountVulnerability(int points, AccountVulnType VulnType, string username) : base(points) { this.VulnType = VulnType; this.UserName = username; ComputerEntry = new DirectoryEntry(ComputerPath); }