whoami
The whoami command shows information about the user, groups, and privileges for the account currently logged on to the local system. Windows commands reference
On Windows, Linux 22 Sigma rules name it File whoami.exe
Windows
The whoami command shows information about the user, groups, and privileges for the account currently logged on to the local system. When run without any parameters, whoami returns the current domain and user name.
whoami [/upn | /fqdn | /logonid]whoami {[/user] [/groups] [/claims] [/priv]} [/fo <format>] [/nh]whoami /all [/fo <format>] [/nh]
To display the domain and user name of the person who is currently logged on to this computer, type
whoamiIdentifyTrips 1 Sigma rule: lowLocal Accounts Discovery by Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community
To display all of the information in the current access token, type
whoami /allIdentify/allDisplays all information in the current access token, including the current user name, security identifiers (SID), privileges, and groups that the current user belongs to. Windows commands referenceTrips 2 Sigma rules: mediumEnumerate All Information With Whoami.EXE by Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems); lowLocal Accounts Discovery by Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community
/upnDisplays the user name in user principal name (UPN) format./fqdnDisplays the user name in fully qualified domain name (FQDN) format./logonidDisplays the logon ID of the current user./userDisplays the current domain and user name and the security identifier (SID)./groupsDisplays the user groups to which the current user belongs./claimsDisplays the claims for current user, such as claim name, flags, type and values./privDisplays the security privileges of the current user./fo <format>Specifies the output format. Valid values include:
- table - Displays output in a table. This is the default value.
- list - Displays output in a list.
- csv - Displays output in comma-separated value (CSV) format./allDisplays all information in the current access token, including the current user name, security identifiers (SID), privileges, and groups that the current user belongs to./nhSpecifies that the column header shouldn't be displayed in the output. This is valid only for table and CSV formats./?Displays help at the command prompt.Linux
Print the current user name.
whoami
Several platforms
This command is an alias of id --user --name.
Windows
Display details about the current user.
Display the username of the current user
whoamiIdentifyTrips 1 Sigma rule: lowLocal Accounts Discovery by Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community
Display the groups that the current user is a member of
whoami /groupsIdentify/groupsDisplays the user groups to which the current user belongs. Windows commands referenceTrips 2 Sigma rules: mediumGroup Membership Reconnaissance Via Whoami.EXE by Nasreddine Bencherchali (Nextron Systems); lowLocal Accounts Discovery by Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community
Display the privileges of the current user
whoami /privIdentify/privDisplays the security privileges of the current user. Windows commands referenceTrips 2 Sigma rules: highSecurity Privileges Enumeration Via Whoami.EXE by Florian Roth (Nextron Systems); lowLocal Accounts Discovery by Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community
Display the user principal name (UPN) of the current user
whoami /upnIdentify/upnDisplays the user name in user principal name (UPN) format. Windows commands referenceTrips 1 Sigma rule: lowLocal Accounts Discovery by Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community
Display the logon ID of the current user
whoami /logonidIdentify/logonidDisplays the logon ID of the current user. Windows commands referenceTrips 1 Sigma rule: lowLocal Accounts Discovery by Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community
Display all information for the current user
whoami /allIdentify/allDisplays all information in the current access token, including the current user name, security identifiers (SID), privileges, and groups that the current user belongs to. Windows commands referenceTrips 2 Sigma rules: mediumEnumerate All Information With Whoami.EXE by Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems); lowLocal Accounts Discovery by Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community