{"id":8856,"date":"2023-11-11T23:28:40","date_gmt":"2023-11-11T23:28:40","guid":{"rendered":"https:\/\/www.hexacorn.com\/blog\/?p=8856"},"modified":"2023-11-11T23:34:54","modified_gmt":"2023-11-11T23:34:54","slug":"who-am-i-asking-for-my-file-friend-whoami-exe","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2023\/11\/11\/who-am-i-asking-for-my-file-friend-whoami-exe\/","title":{"rendered":"Who am I? Asking for my file friend: whoami.exe&#8230;"},"content":{"rendered":"\n<p>There is a lot talk about whoami.exe recently, so here&#8217;s one more post about it&#8230;<\/p>\n\n\n\n<p>When we talk about whoami.exe we often think of it in &#8216;atomic&#8217; terms. You run it, and you get the results. But by doing so we assume a lot i.e. we kinda indirectly know that we are talking about the executable located in this place:<\/p>\n\n\n\n<ul>\n<li>c:\\windows\\system32\\whoami.exe<\/li>\n<\/ul>\n\n\n\n<p>Of course, some of us know that there is also a 32-bit version on the 64-bit OS:<\/p>\n\n\n\n<ul>\n<li>c:\\windows\\SysWOW64\\whoami.exe<\/li>\n<\/ul>\n\n\n\n<p>and then a bunch of copies in WinSxS directory (file names are versioned):<\/p>\n\n\n\n<ul>\n<li>c:\\Windows\\WinSxS\\amd64_microsoft-windows-whoami_31bf3856ad364e35_10.0.19041.1_none_846d8bda2133af3c\\whoami.exe<\/li>\n\n\n\n<li>c:\\Windows\\WinSxS\\wow64_microsoft-windows-whoami_31bf3856ad364e35_10.0.19041.1_none_8ec2362c55947137\\whoami.exe<\/li>\n\n\n\n<li>c:\\Windows\\WinSxS\\amd64_microsoft-windows-whoami_31bf3856ad364e35_10.0.22621.1_none_30124a0a75945900\\whoami.exe<\/li>\n\n\n\n<li>c:\\Windows\\WinSxS\\wow64_microsoft-windows-whoami_31bf3856ad364e35_10.0.22621.1_none_3a66f45ca9f51afb\\whoami.exe<\/li>\n<\/ul>\n\n\n\n<p>And of course, we can reveal the hard links for each of these tools using fsutil:<\/p>\n\n\n\n<ul>\n<li>fsutil.exe hardlink list c:\\windows\\System32\\whoami.exe<\/li>\n\n\n\n<li>fsutil.exe hardlink list c:\\windows\\SysWOW64\\whoami.exe<\/li>\n<\/ul>\n\n\n\n<p>Plus, on Windows Arm, we have:<\/p>\n\n\n\n<ul>\n<li>c:\\Windows\\SysArm32\\whoami.exe<\/li>\n<\/ul>\n\n\n\n<p>and respective WinSxS directory (file names are versioned):<\/p>\n\n\n\n<ul>\n<li>c:\\Windows\\WinSxS\\arm64.arm_microsoft-windows-whoami_31bf3856ad364e35_10.0.22598.1_none_d3774312fcf7fb69\\whoami.exe<\/li>\n\n\n\n<li>c:\\Windows\\WinSxS\\arm64.x86_microsoft-windows-whoami_31bf3856ad364e35_10.0.22598.1_none_d37c245afcf28323\\whoami.exe<\/li>\n\n\n\n<li>c:\\Windows\\WinSxS\\arm64_microsoft-windows-whoami_31bf3856ad364e35_10.0.22598.1_none_2de72d3c78a075fb\\whoami.exe<\/li>\n<\/ul>\n\n\n\n<p>But there is more&#8230;<\/p>\n\n\n\n<p>If you ever installed cygwin, you probably know of:<\/p>\n\n\n\n<ul>\n<li>c:\\Cygwin\\bin\\whoami.exe<\/li>\n\n\n\n<li>c:\\Cygwin64\\bin\\whoami.exe<\/li>\n<\/ul>\n\n\n\n<p>There is also GIT for Windows that installs a lot of windows-friendly Unix tools including, yes, you guessed right, whoami.exe:<\/p>\n\n\n\n<ul>\n<li>c:\\Program Files\\Git\\usr\\bin\\whoami.exe<\/li>\n<\/ul>\n\n\n\n<p>At this stage, you probably are aware that Program Files is a nightmare as it occurs in many <a href=\"https:\/\/www.hexacorn.com\/blog\/2023\/05\/04\/threat-hunting-architecture-issues\/\">architecture-specific forms<\/a>, and many <a href=\"https:\/\/www.hexacorn.com\/blog\/2023\/03\/10\/threat-hunting-localization-issues\/\">localized versions<\/a>.<\/p>\n\n\n\n<p>You must be thinking now &#8211; this thing is multiplying quickly and spreading faster than covid!<\/p>\n\n\n\n<p>But this is not THE END. There really is more.<\/p>\n\n\n\n<p>A Pro version of software called System Scheduler installs the following whoami.exe file:<\/p>\n\n\n\n<ul>\n<li>c:\\Program Files (x86)\\SystemScheduler\\WhoAmI.exe<\/li>\n<\/ul>\n\n\n\n<p>It is probably the first ever whoami.exe I have ever seen that shows the user info on GUI &#8211; as a message box \ud83d\ude42<\/p>\n\n\n\n<p>Then comes another contender, a tool called MacroCommanderPro:<\/p>\n\n\n\n<ul>\n<li>c:\\Program Files (x86)\\MacroCommander\\Bin\\WhoAmI.exe<\/li>\n<\/ul>\n\n\n\n<p>Yes, it is also GUI-based whoami \ud83d\ude42<\/p>\n\n\n\n<p>And this is just a tip of an iceberg&#8230;<\/p>\n\n\n\n<p>The reason I write about all this is because some people like to say &#8216;the moment someone runs whoami.exe on one of your systems, this is an indication of early stages of compromise!&#8217;. Their confidence is built on ignorance. And yes, they may be right&#8230; yeah&#8230;but they are often very wrong&#8230; <\/p>\n\n\n\n<p>Telemetry we deal with today is rich and useful, but threat hunting &#8211; as a discipline &#8211; is still in its early, naive stages. It&#8217;s healthy to assume that for every rule written, for every assumption, there is an exception that can be found and not only that &#8212; you will very often find it by combing telemetry generated by non-malicious sources&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is a lot talk about whoami.exe recently, so here&#8217;s one more post about it&#8230; When we talk about whoami.exe we often think of it in &#8216;atomic&#8217; terms. You run it, and you get the results. But by doing so &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2023\/11\/11\/who-am-i-asking-for-my-file-friend-whoami-exe\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[8,79],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/8856"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=8856"}],"version-history":[{"count":2,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/8856\/revisions"}],"predecessor-version":[{"id":8858,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/8856\/revisions\/8858"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=8856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=8856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=8856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}