Powershell Commands

Cyberkur Syiem 20 Reputation points
2023-05-29T06:14:26.6766667+00:00

Q. This host seems to have several PowerShell modules loaded, and this user's flag is hidden in one of them.

I am trying to access this Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules. to extract a content there, because it seems that there is a user's flag in one of the file (PowerShell modules loaded). When i tried Get-Content -Path C:\Windows\system32\WindowsPowerShell\v1.0\Modules. it says permission denied. I'm not able to switch to the Administrator mode also, since it is a practice scenario. so is there anyway to extract the flag or content from this Directory?

Microsoft 365 and Office SharePoint Server For business
Windows for business Windows Server User experience PowerShell
Windows for business Windows Server User experience Other
{count} votes

1 answer

Sort by: Most helpful
  1. MotoX80 36,291 Reputation points
    2023-05-29T11:46:50.33+00:00

    Get-Content reads the content of files, like a text file. You are trying to read a directory. That won't work. You need to use this command to list the file names.

    Get-ChildItem C:\Windows\system32\WindowsPowerShell\v1.0\Modules -recurse
    

    and this user's flag is hidden in one of them.

    What does that mean? Are you looking for a file with a certain name? Or are you looking for some specific text string in a file?

    That folder is only for installed Powershell modules. There should be no user specific data in that folder structure.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.