Don’t be fooled by the apparently ridiculous name of this command.
If you are in a shared environment, have administrative privileges, and need to know user(s) credentials, running the whoami command can be a good thing. Many operating systems accept this command.
For instance, on many Windows systems, the command can be run from Command Prompt (CMD) by typing (better, with administrative privileges)
whoami
True that you could try with
rundll32.exe keymgr.dll,KRShowKeyMgr
but whoami gets more interesting. Try
whoami /all
As with any tool, the command can be used, in combination with other tools, for good, bad, and ugly things. Try
whoami /?
That’s right. There are no such thing as ridiculous commands.
References
Techopedia
ScienceDirect