{"id":5702,"date":"2018-12-19T00:44:18","date_gmt":"2018-12-19T00:44:18","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=5702"},"modified":"2018-12-19T00:44:20","modified_gmt":"2018-12-19T00:44:20","slug":"using-virtual-machine-tools-for-guest-os-fingerprinting","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2018\/12\/19\/using-virtual-machine-tools-for-guest-os-fingerprinting\/","title":{"rendered":"Using Virtual Machine tools for Guest OS fingerprinting"},"content":{"rendered":"\n<p>A popular way of binding samples to a specific machine is by taking a hardware fingerprint of the system, and sending it to the server. The server then encrypts the payload using a key that is derived from the system fingerprint and sends it back. The payload will only run on a system for which the payload loader can extract the same fingerprint as used to encrypt the payload.<\/p>\n\n\n\n<p>It turns out you can bind the sample not only to the hardware fingerprint, but also to the custom, guest-only properties assigned to the guest operating snapshots (okay, in some way it is still a hardware fingerprint).<\/p>\n\n\n\n<p>For VMWare, you can use a tool rpctool.exe \/ vmware-rpctool.exe \/ vmware-guestd to  either set or retrieve the value of guest OS properties e.g.:<\/p>\n\n\n\n<ul><li>rpctool &#8220;info-set guestinfo.foo 1234&#8221;<\/li><li>rpctool &#8220;info-get guestinfo.foo&#8221;<\/li><\/ul>\n\n\n\n<p>Malware could either use the tool, or talk to the RPC interface directly. <\/p>\n\n\n\n<p>There are various possibilities. If the VM is a part of the farm, malware authors could enumerate existing guest OS properties in a same way they list well-known sandbox hostnames. Based on the analysis of incoming information (e.g. stats) determine then if the VM is deemed &#8216;infectable&#8217;. They could also set their own guest properties and only continue deployments of future updates to malware if the property still exists and contains expected value.<\/p>\n\n\n\n<p>So, it could be yet another potential anti-sandbox trick\/evasion.<\/p>\n\n\n\n<p>There are more Guest OS tools.<\/p>\n\n\n\n<p>Detecting VM is a popular way to evade sandboxes. With a growing number of environments that rely on VMs the way the detection is done may soon change &#8211;  perhaps it will have to be a little bit more refined than before? I.e. it is OK if it is a VM, just exclude some of them?<br><\/p>\n\n\n\n<p>For example, using a tool VMwareToolboxCmd.exe, one can retrieve the time of the host machine:<\/p>\n\n\n\n<ul><li>VMwareToolboxCmd.exe stat hosttime<\/li><\/ul>\n\n\n\n<p>If the host and guest times are not synchronized, what could be the reason?<\/p>\n\n\n\n<p>An alternative method can check if the time synchronization is enabled at all:<\/p>\n\n\n\n<ul><li>VMwareToolboxCmd.exe timesync status<\/li><\/ul>\n\n\n\n<p>Yet another way to detect possible customized properties of the guest OS is by looking at its scripts e.g.:<\/p>\n\n\n\n<ul><li>VMwareToolboxCmd.exe script power default<\/li><\/ul>\n\n\n\n<p>The &#8216;power&#8217; refers to an event that makes the script run, and can be replaced with other event names e.g. &#8216;resume&#8217;, &#8216;suspend&#8217;, &#8216;shutdown&#8217;, each associated with a respective script. I have described using these as a possible <a href=\"https:\/\/www.hexacorn.com\/blog\/2017\/01\/14\/beyond-good-ol-run-key-part-53\/\">persistence trick<\/a> long time ago. <\/p>\n\n\n\n<p>Turns out that using the VMwareToolboxCmd.exe tool one could modify the paths of the default scripts (i.e. it is a new persistence trick). Their content, if changed, could also be an additional fingerprint signature.<\/p>\n\n\n\n<p>And one more command to cover: testing the availability of new version of VMWare tools. The version of VMTools, as well as the fact it is not being updated can help to enrich profile of a guest OS:<\/p>\n\n\n\n<ul><li>VMwareToolboxCmd.exe upgrade status<\/li><\/ul>\n\n\n\n<p>There is probably more possibilities out there&#8230;<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A popular way of binding samples to a specific machine is by taking a hardware fingerprint of the system, and sending it to the server. The server then encrypts the payload using a key that is derived from the system &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2018\/12\/19\/using-virtual-machine-tools-for-guest-os-fingerprinting\/\">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":[43,41],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5702"}],"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=5702"}],"version-history":[{"count":4,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5702\/revisions"}],"predecessor-version":[{"id":5706,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5702\/revisions\/5706"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=5702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=5702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=5702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}