# Query to Determine if any lolbin files are installed outside the normal OS and Program Files dir's

```
#####aid_begin
#description: file query - file query to determine if any lolbin files are installed outside the normal %systemdrive%\windows, %systemdrive%\program files*, directories
#id: aid2201232312
#processtype: query
#category: filesandfolders
#sourcelink: <na>
#tacticidlist: <na>
#techniqueidlist: <na>
#compatibleos: |-
#  windows 7
#  windows 8.*
#  windows 10
#  windows 11
#  windows server 2008 r2
#  windows server 2012
#  windows server 2012 r2
#  windows server 2016
#  windows server 2019
#compatibleengine: |-
#  powershell 2
#  powershell 3
#  powershell 4
#  powershell 5.*
#  powershell 7.*
#bgcommandlist: |-
#  invoke-loadallprofilehives
#  get-bgloadedreghives
#  get-bgmruactivityview
#  invoke-bgunloadallprofilehives
#notes: |-
#  file query to determine if any lolbin files are installed outside the normal %systemdrive%\windows, %systemdrive%\program files*, directories
#####aid_end
commands:
- |-
  $LolBins = @()
  $LolBins += 'ATBroker\.exe$'
  $LolBins += 'bash\.exe$'
  $LolBins += 'bitsadmin\.exe$'
  $LolBins += 'certutil\.exe$'
  $LolBins += 'cmdkey\.exe$'
  $LolBins += 'cmstp\.exe$'
  $LolBins += 'control\.exe$'
  $LolBins += 'csc\.exe$'
  $LolBins += 'cscript\.exe$'
  $LolBins += 'Dfsvc\.exe$'
  $LolBins += 'diskshadow\.exe$'
  $LolBins += 'dnscmd\.exe$'
  $LolBins += 'esentutl\.exe$'
  $LolBins += 'expand\.exe$'
  $LolBins += 'explorer\.exe$'
  $LolBins += 'Extexport\.exe$'
  $LolBins += 'extrac32\.exe$'
  $LolBins += 'findstr\.exe$'
  $LolBins += 'forfiles\.exe$'
  $LolBins += 'Gpscript\.exe$'
  $LolBins += 'HH\.exe$'
  $LolBins += 'ie4uinit\.exe$'
  $LolBins += 'ieexec\.exe$'
  $LolBins += 'InfDefaultInstall\.exe$'
  $LolBins += 'InstallUtil\.exe$'
  $LolBins += 'makecab\.exe$'
  $LolBins += 'MavInject\.exe$'
  $LolBins += 'msbuild\.exe$'
  $LolBins += 'Msconfig\.exe$'
  $LolBins += 'msdt\.exe$'
  $LolBins += 'mshta\.exe$'
  $LolBins += 'msiexec\.exe$'
  $LolBins += 'netsh\.exe$'
  $LolBins += 'nltest\.exe$'
  $LolBins += 'odbcconf\.exe$'
  $LolBins += 'OpenWith\.exe$'
  $LolBins += 'pcalua\.exe$' 
  $LolBins += 'Pcwrun\.exe$'
  $LolBins += 'Presentationhost\.exe$'
  $LolBins += 'print\.exe$'
  $LolBins += 'psr\.exe$'
  $LolBins += 'reg\.exe$'
  $LolBins += 'regasm\.exe$'
  $LolBins += 'regedit\.exe$'
  $LolBins += 'Register-cimprovider\.exe$'
  $LolBins += 'regsvcs\.exe$'
  $LolBins += 'regsvr32\.exe$'
  $LolBins += 'replace\.exe$'
  $LolBins += 'Robocopy\.exe$'
  $LolBins += 'rpcping\.exe$'
  $LolBins += 'rundll32\.exe$'
  $LolBins += 'Runonce\.exe$'
  $LolBins += 'runscripthelper\.exe$'
  $LolBins += 'sc\.exe$'
  $LolBins += 'Scriptrunner\.exe$'
  $LolBins += 'SyncAppvPublishingServer\.exe$'
  $LolBins += 'Wab\.exe$'
  $LolBins += 'wmic\.exe$'
  $LolBins += 'wscript\.exe$'
  $LolBins += 'xwizard\.exe$' 

  Get-BGChildItemList -SearchPath $('^(?!{0}\\Windows|{0}\\Program Files).*$' -f $Env:SystemDrive) -Pattern $($LolBins -join '|') -Recurse
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manuals.blusapphire.io/blugenie/artifacts/tactical-artifacts-by-category/file-and-folder-query/query-to-determine-if-any-lolbin-files-are-installed-outside-the-normal-os-and-program-files-dirs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
