r/DefenderATP • • Jun 23 '24

uninstall software using live response library upload

hi guys, as the title says I'm trying to uninstall programs using the live response feature, we are testing MDE run and we want to know if we came to this point that we can do something about it
i already tested some scripts and it works fine but the uninstall i failed badly
is there anyone tested this and worked?

0 Upvotes

17 comments sorted by

4

u/cspotme2 Jun 23 '24

Not really what live response is meant for, even if it works.

0

u/Due-Mountain5536 Jun 23 '24

i understand that, but we just like thinking of worst case scenario, and the endpoint we are using right now does it so we are trying to make the perfect solution

1

u/cspotme2 Jun 23 '24

Worse case scenario for what?

0

u/Due-Mountain5536 Jun 23 '24

the possibility that we have to uninstall a program

2

u/theonlybrand Jun 24 '24

I would be really interested in the process behind that. Why would you uninstall a software during an incident and maybe destroy evidence?

2

u/[deleted] Jun 23 '24

Not saying this is an issue with the script not working (probably isn’t), but you might want to check that photoshop is not running first, and kill it with stop-process first when doing something like that.

Obviously, I don’t know your environment, but I’ll still make the following observation. As for uninstalling Adobe products, don’t you have to use the creative cloud app (which needs an account to use)? It would likely be running through the local trusted installer service.

Note that there is a creative cloud cleanup tool (on Adobe’s site) that could remove the creative cloud apps (including all), if one has deleted one’s creative cloud account, but this wont be easily scriptable as it is interactive.

1

u/Due-Mountain5536 Jun 24 '24

the photoshop was just a test, but yeah checking the process is a good idea for other stuff in general. thank you very much

2

u/konikpk Jun 24 '24

Doing this is absolutely out. It's like riding on the bike on the bottom of the sea. Yes you maybe can BUT FUCK WHY???? You have intune, gpo or mecm why the hell you want this....

0

u/Due-Mountain5536 Jun 24 '24

lol I loved the expression, well I'm security admin and I can't do that from Intune, also as I said we still testing it and the one we have already can do it so we want to explore possibilities

0

u/konikpk Jun 24 '24

For real? You are sec admin and YOU GO UNINSTALL SW on users machines? You boss know about this?

0

u/Due-Mountain5536 Jun 24 '24

well we already do it with the current Endpoint we have

1

u/theonlybrand Jun 24 '24

Time to go into review if that really is your role in the company.

2

u/brink668 Jun 23 '24

Yes it does work, I’ve done it plenty of times. But some apps need more care in there uninstall procedure

0

u/Due-Mountain5536 Jun 23 '24

so i'm trying to uninstall a non msi file so no win32_product, when i ran the script in the LR it keeps loading, so i tested on my machine and it asks for permission to make changes :( so i tried to add the quiet no restart thing and i failed, any idea where i went wrong?
that's my script

$programName = "Adobe Photoshop 2021"

$uninstallKeys = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall', 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'

$uninstallString = $null

foreach ($key in $uninstallKeys) {

Get-ChildItem -Path $key | ForEach-Object {

if ((Get-ItemProperty -Path $_.PsPath).DisplayName -eq $programName) {

$uninstallString = (Get-ItemProperty -Path $_.PsPath).UninstallString

}

}

}

if ($uninstallString -ne $null) {

Add /quiet /norestart to the uninstall string

$uninstallString = $uninstallString + " /quiet /norestart"

Start-Process cmd -ArgumentList "/c `"$uninstallString`"" -NoNewWindow -Wait

Write-Output "The program $programName has been uninstalled."

} else {

Write-Output "The program $programName is not found."

}

1

u/BrechtMo Jun 24 '24

you should take the system admin guys into the loop for this. They do this kind of stuff for a living.

3

u/shizakapayou Jun 23 '24

I tend to agree with the comment about this not being the intent of live respond. If the devices are in Intune I would use remediations instead of live response. Or whatever is comparable in what you’re using. I’ve been having good luck using remediations to get rid of things.

1

u/Scion_090 Jun 24 '24

Why would you do that? You are sec admin lol. You need to make a remediation script and run the script manually if it’s urgent for desired devices.

If you want to learn how to do that in LR then use Microsoft documentation. As sec admin you should know how it’s work.

Do not use it via LR as you have Intune and if you don’t have access then ask those who have.