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

Prep for Tamper Protection #110

Merged
merged 3 commits into from
Jan 9, 2025
Merged

Prep for Tamper Protection #110

merged 3 commits into from
Jan 9, 2025

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.
  • Switched to using SC.exe instead of WMI calls for removing service(s), more reliable with a wider variety of machines

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.
Powershell/InstallHuntress.powershellv2.ps1 Outdated Show resolved Hide resolved
Powershell/InstallHuntress.powershellv2.ps1 Outdated Show resolved Hide resolved
Powershell/InstallHuntress.powershellv2.ps1 Fixed Show resolved Hide resolved
Powershell/InstallHuntress.powershellv2.ps1 Outdated Show resolved Hide resolved
@rob-no
Copy link
Contributor

rob-no commented Jan 7, 2025

For security reasons, it's recommended to use the full path for C:\Windows\System32\sc.exe to avoid Path hijacks. Better to just use the full paths to be safe.

Remove/delete services when using uninstall flag (now including Huntmon)
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.
Switched to using SC.exe instead of WMI calls for removing service(s), more reliable with a wider variety of machines. Using full path to avoid path hijacks.
Removed unnecessary variable execution wrap
Switch $NULL comparators to prevent null check panic
Updated year
@Alan-Huntress Alan-Huntress merged commit f8b7073 into main Jan 9, 2025
4 checks passed
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.

3 participants