🐈‍⬛🐈⬛ 🐈⬛ UnderTheWire Century

https://underthewire.tech/century

Century 0-1

century

Century 1-2

Challenge ask us to find build verison of PowerShell instance.

According to this microsoft module, we can list the detail of our PS using $PSVersionTable command.

10.0.14393.4583

Century 2-3

Invoke-WebRequest has the same function as wget command according to https://linuxhint.com/run-wget-powershell/.

invoke-webrequest443

Century 3-4

We can use (Get-ChildItem | Measure-Object).Count to get the total number of files in a directory.

  • Get-ChildItem = Equivalent to dir , get the items and child items in a folder or registry key.

  • Measure-Object = measure the property of the command. There are various measurement parameters are available. For example, Average, Count, sum, maximum, minimum.

  • .Count = to specify output for count only.

123

Century 4-5

CD to the directory either by pressing tab or specify directory name using '\file'.

5548

Century 5-6

According to PS module, we can use Get-ADDomain -Current LoggedOnUser to get the domain information for the domain of the currently logged on user.

underthewire3347

Century 6-7

Use option -Directory to only get folders. (Get-ChildItem -Directory | Measure-Object).Count

197

Century 7-8

Use gci with -Recurse to repeat the command in all subfolder in the directory and specify the file name with -Filter.

7points

Century 8-9

We can use Get-Unique which is the equivalent of uniq to get the non repeated words in the file. Then we use Measure-Object to count the unique entries.

696

Century 9-10

We use GetContent with -Delimiter " " to split the words into an array and find the 161st word by using Select -Index 160.( Array starts from 0).

pierid

Century 10-11

According to the answer from StackOverFlow, we can use Get-WmiObject cmdlet to get more details and information of a windows 32 service. Then we can use findstr wuauserv(windows update service) which is the equivalent of grep to get the details of windows update service.

windowsupdates110

Century 11-12

We can use gci -recurse -hidden 2>$null to find any hidden file in a directory.

  • hidden = find file with only hidden property.

  • 2>$null = discard error.

secret_sauce

Century 12-13

We use Get-ADDomainController to get Active Directory domain controllers name.

After finding the domain controller name, we can use Get-ADComputer -Identity "UTW" -Properties * | Select Name, Description to get the description of our AD name.

  • Get-ADComputer = get active directory computer details.

  • -Identity "UTW" = specify our AD name.

  • -Properties * = list all possible properties.

  • Select Name, Description = filter out the only parameter we want.

i_authenticate_things

Century 13-14

Use getcontent with Measure-Object -Word to only get words amount.

755

Century 14-15

Use getcontent with -Delimiter to split words into array. Then use findstr ^polo (^to specify whole word only) to grep polo. Lastly use count to count the number of polo words in the file.

153

Last updated