Each user logged onto the system holds an access token with security information for that logon session. The system creates an access token when the user logs on. Every process executed on behalf of the user has a copy of the access token. The token identifies the user, the user's groups, and the user's privileges. A token also contains a logon SID (Security Identifier) that identifies the current
systeminfosysteminfo|findstr/B/C:"OS Name"/C:"OS Version"#Get only that informationwmicqfegetCaption,Description,HotFixID,InstalledOn#Patcheswmicosgetosarchitecture||echo%PROCESSOR_ARCHITECTURE%#Get system architecture
PowerShell saves a history of specified commands in AppData which may lead to interesting data or information.
ConsoleHost_history#Find the PATH where is savedtype%userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txttypeC:\Users\swissky\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txttype $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txtcat (Get-PSReadlineOption).HistorySavePathcat (Get-PSReadlineOption).HistorySavePath |slspassw
Find groups and users
You should check if any of the groups where you belong have interesting permissions
Commands to do so
# CMDnetusers%username%#Menetusers#All local usersnetlocalgroup#GroupsnetlocalgroupAdministrators#Who is inside Administrators groupwhoami/all#Check the privileges# PSGet-WmiObject-ClassWin32_UserAccountGet-LocalUser|ftName,Enabled,LastLogonGet-ChildItemC:\Users-Force|select NameGet-LocalGroupMemberAdministrators|ftName,PrincipalSource
Privileged group?
📢 If you **belongs to some privileged group you may be able to escalate privileges**. Learn about privileged groups and how to abuse them to escalate privileges here: [Privileged Groups](https://www.notion.so/windows-hardening/active-directory-methodology/privileged-groups-and-token-privileges)
Backup Operators group?
Using BackupOperatorToDA, we can exploit the group remotely.
Unquoted service path
If the path to an executable is not inside quotes, Windows will try to execute every ending before a space. For example, for the path C:\Program Files\Some Folder\Service.exe Windows will try to execute:
Got access to at least one domain account? Then you can use BloodHound to list possible PE paths.
BloodHound.py
It is recommended to use BloodHound.py first before running a script or executable (SharpHound) on the system. https://github.com/fox-it/BloodHound.py. We can use this script remotely.
From the programfiles on the target, can be detriment that FireFox is installed. It is possible that the user nikk37 has a firefox profile with a db key. With this key we can decrypt any saved credentials. The path for the profile is default in “%userprofile%\AppData\Roaming\Mozilla\Firefox\Profiles\” for Windows.