Archetype
Task 1
Which TCP port is hosting a database server?
Found via a regular portscan:
$ nmap -sV <ip> Task 2
What is the name of the non-Administrative share available over SMB?
Found via enumerating using null credentials/guest user:
$ smbclient --no-pass -L //<ip>Task 3
What is the password identified in the file on the SMB share?
First, we connect to the share, then list files and fetch the file found on the share, which contain the password:
$ smbclient --no-pass //<ip>/<share>
Try "help" to get a list of possible commands.
smb: \> dir
. D 0 Mon Jan 20 13:20:57 2020
.. D 0 Mon Jan 20 13:20:57 2020
prod.dtsConfig AR 609 Mon Jan 20 13:23:02 2020
5056511 blocks of size 4096. 2572728 blocks available
smb: \> get prod.dtsConfig
getting file \prod.dtsConfig of size 609 as prod.dtsConfig (2.9 KiloBytes/sec) (average 2.9 KiloBytes/sec)
smb: \> exitTask 4
What script from Impacket collection can be used in order to establish an authenticated connection to a Microsoft SQL Server?
This is mssqlclient.py , which we can use to connect to the initially found SQL service:
Task 5
What extended stored procedure of Microsoft SQL Server can be used in order to spawn a Windows command shell?
This is xp_cmdshell, however, for it to be available, advanced options must be turned on first:
After which, we can execute commands:
And thereby obtain a shell. First, set up a listener:
Get your reverse shell, e.g., powershell base64 from https://revshells.com, and leverage xp_cmdshell:
Verify the connection on the listener:
Task 6
What script can be used in order to search possible paths to escalate privileges on Windows hosts?
This is winPEAS. First, I verified that I needed winPEASx64.exe by quickly running systeminfo , which yielded:
I then tried to get it straight off GitHub, however, that did not seem to work. So, I downloaded it locally, and hosted a webserver in the folder in which I had it located:
I could then fetch it from my machine to the users desktop and run it:
Task 7
What file contains the administrator's password?
The winPEAS output pointed to a PS history file that contained the administrator password.
Flags
User flag was found on the desktop of the service user, while the root flag was achieved using the password from the PS history file and then authenticate using impacket-psexec:
After which it could be found on the administrators desktop as well.
Last updated