🐈⬛ 🐈⬛ UnderTheWire Century
https://underthewire.tech/century
Last updated
https://underthewire.tech/century
Last updated
century
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
Invoke-WebRequest
has the same function as wget command according to https://linuxhint.com/run-wget-powershell/.
invoke-webrequest443
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
CD to the directory either by pressing tab or specify directory name using '\file'.
5548
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
Use option -Directory to only get folders. (Get-ChildItem -Directory | Measure-Object).Count
197
Use gci with -Recurse to repeat the command in all subfolder in the directory and specify the file name with -Filter.
7points
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
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
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
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
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
Use getcontent with Measure-Object -Word to only get words amount.
755
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