Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusted script to work better with Tamper Protection #109

Closed
wants to merge 2 commits into from

Conversation

Alan-Huntress
Copy link
Contributor

  • Remove/delete services when using uninstall flag
  • Additional logging to note which user context the script is running under. For troubleshooting TP issues.
  • Warn if TP could interfere, i.e. if TP is detected (checks the service status instead of the context)
  • Script checks for assets in \Program Files\ instead of checking for services since some uninstall methods leave the services in place. This check is needed to prevent RMM's from hammering the Huntress portal with repeated installs.
  • Fixed orphan checker, should no longer go down that execution path unless an orphaned agent is actually detected.

-Remove services when using uninstall flag
-Additional logging to note which user context the script is running under. For troubleshooting TP issues.
-warn if TP could interfere, i.e. if TP is detected (checks the service status instead of the context)
-script checks for assets in \Program Files\ instead of services since some uninstall methods leave the services in place.
-fixed orphan checker
Powershell/InstallHuntress.powershellv2.ps1 Fixed Show fixed Hide fixed
Powershell/InstallHuntress.powershellv2.ps1 Fixed Show fixed Hide fixed
Powershell/InstallHuntress.powershellv2.ps1 Fixed Show fixed Hide fixed
Powershell/InstallHuntress.powershellv2.ps1 Fixed Show fixed Hide fixed
LogMessage "Script cursory check, is Huntress installed already: $($isHuntressInstalled)"
if ($isHuntressInstalled){
LogMessage "Agent version $(getAgentVersion) found"
$checkTP = (Get-Service "HuntressAgent").ServiceHandle
if ( $checkTP -eq $NULL) {

Check notice

Code scanning / Psscriptanalyzer (reported by Codacy)

$null should be on the left side of equality comparisons. Note

$null should be on the left side of equality comparisons.
Avoids issues with legacy machines, locked down environments, and machines with WMI repository issues.
@Alan-Huntress Alan-Huntress deleted the Alan-Huntress-patch-14 branch December 26, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant