Century
Last updated
Last updated
UnderTheWire is a website that hosts PowerShell based CTFs or as they call it “wargames”.
Century is the first wargame and relies on users ability to use PowerShell operators and and navigate through the environment.
The goal of this level is to log into the game. Do the following in order to achieve this goal.
1. Obtain the initial credentials via the #StartHere channel on our Slack (link). Once you are in the channel, scroll to the top to see the credentials.
2. After obtaining the credentials, connect to the server via SSH. You will need an SSH client such as Putty. The host that you will be connecting to is century.underthewire.tech, on port 22.
3. When prompted, use the credentials for the applicable game found in the #StartHere Slack channel.
4. You have successfully connected to the game server when your path changes to “PS C:\Users\Century1\desktop>”.
We can achieve this using ssh connection as follows:
The password for level 1 is: century1
The password for Century2 is the build version of the instance of PowerShell installed on this system.
We can obtain the build version using $psVersionTable:
[$psVersionTable is an automatic variable (whose type is System. Collections.) that reveals some information about the PowerShell that runs the current session.]
The password for level 2 is 10.0.14393.5127
The password for Century3 is the name of the built-in cmdlet that performs the wget like function within PowerShell PLUS the name of the file on the desktop.
We could conduct a simple google search for the answer. But since the goal is to use the PowerShell we could use the Get-Alias cmdlet:
[The Get-Alias cmdlet gets the aliases in the current session. This includes built-in aliases, aliases that you have set or imported, and aliases that you have added to your PowerShell profile. By default, Get-Alias takes an alias and returns the command name.]
2. We can use the Get-ChildItem cmdlet to get the name of the file:
[The Get-ChildItem cmdlet gets the items in one or more specified locations. If the item is a container, it gets the items inside the container, known as child items. You can use the Recurse parameter to get items in all child containers and use the Depth parameter to limit the number of levels to recurse.]
The password for level 3 is Invoke-WebRequest443
The password for Century4 is the number of files on the desktop.
We can obtain the number of files by piping the Measure-Object cmlet with the Get-ChildItem cmdlet:
[The Measure-Object cmdlet performs calculations on the property values of objects. You can use Measure-Object to count objects or count objects with a specified Property. You can also use Measure-Object to calculate the Minimum, Maximum, Sum, Standard Deviation and Average of numeric values.]
The password for level 4 is 123
The password for Century5 is the name of the file within a directory on the desktop that has spaces in its name.
We can filter the Get-ChildItem cmdlet to get only the directories with spaces in their name as follows:
We can move into the directory and again use Get-ChildItem:
The password for level 5 is 495125
The password for Century6 is the short name of the domain in which this system resides in PLUS the name of the file on the desktop.
We can get the required domain name using Get-WmiObject cmdlet:
[The Get-WmiObject cmdlet gets instances of WMI classes or information about the available WMI classes. To specify a remote computer, use the ComputerName parameter. If the List parameter is specified, the cmdlet gets information about the WMI classes that are available in a specified namespace.]
For the filename we will use the Get-ChildItem cmdlet:
The password for level 6 is underthewire3347
The password for Century7 is the number of folders on the desktop.
We can add the -Directory filter to the Get-ChildItem in order to get only directories as the result.
Then we can pipe the result with the Measure-Object cmdlet.
We then wrap the entire result with the Count operator
The password for level 7 is 197
The password for Century8 is in a readme file somewhere within the contacts, desktop, documents, downloads, favorites, music, or videos folder in the user’s profile.
We can search recursively for the file and set a filter to get any file which has readme in its starting part.
The password for level 8 is 7points
The password for Century9 is the number of unique entries within the file on the desktop.
We can use the Get-Content cmdlet to display the file content and the pipe it in the following manner to get desired result:
[The Get-Content cmdlet gets the content of the item at the location specified by the path, such as the text in a file or the content of a function. For files, the content is read one line at a time and returns a collection of objects, each of which represents a line of content.]
The password for level 9 is 696
The password for Century10 is the 161st word within the file on the desktop.
We can use the Get-Content cmdlet to get the result:
The password for level 10 is pierid
The password for Century11 is the 10th and 8th word of the Windows Update service description combined PLUS the name of the file on the desktop.
We can pipe the Get-WmiObject and Select-Object as follows:
[The Select-Object cmdlet selects specified properties of an object or set of objects. It can also select unique objects, a specified number of objects, or objects in a specified position in an array. To select objects from a collection, use the First, Last, Unique, Skip, and Index parameters.]
The password for level 11 is windowsupdates110
The password for Century12 is the name of the hidden file within the contacts, desktop, documents, downloads, favorites, music, or videos folder in the user’s profile.
The password for level 12 is secret_sauce
The password for Century13 is the description of the computer designated as a Domain Controller within this domain PLUS the name of the file on the desktop.
[The Get-ADComputer cmdlet gets a computer or performs a search to retrieve multiple computers.]
The password for level 13 is i_authenticate_things
The password for Century14 is the number of words within the file on the desktop.
The password for level 14 is 755
The password for Century15 is the number of times the word “polo” appears within the file on the desktop.
We can obtain the required string using the Select-String cmdlet and then we can pipe it with Measure-Object
The password for level 15 is 10