{"id":782,"date":"2014-05-02T04:07:05","date_gmt":"2014-05-02T04:07:05","guid":{"rendered":"http:\/\/www.gironsec.com\/blog\/?p=782"},"modified":"2014-05-02T21:34:32","modified_gmt":"2014-05-02T21:34:32","slug":"updates-updates-updates","status":"publish","type":"post","link":"https:\/\/www.gironsec.com\/blog\/2014\/05\/updates-updates-updates\/","title":{"rendered":"Updates! Updates! Updates!"},"content":{"rendered":"<p>Howdy all!<\/p>\n<p>It&#8217;s been a dog&#8217;s age. I&#8217;ve been busy with work and personal things. I enjoyed a brief 3 month relationship only to return to a life of loneliness. For now anyways.<br \/>\nCactusCon went well. Had a nice turn out for my work shop. Hopefully the attendees learned something as I tried to make it as interactive as possible. <\/p>\n<p>Now for the good stuff:<\/p>\n<p>I&#8217;ve been browsing the source code for Zues. Since its source code publication, many copycats have spawned. The part I was interested in was its VM detection, specifically virtualbox (since that&#8217;s what I use).<br \/>\n<!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\">\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (<span style=\"color: #333333\">!<\/span>CheckReg(<span style=\"background-color: #fff0f0\">&quot;HARDWARE<\/span><span style=\"color: #666666; font-weight: bold; background-color: #fff0f0\">\\\\<\/span><span style=\"background-color: #fff0f0\">DESCRIPTION<\/span><span style=\"color: #666666; font-weight: bold; background-color: #fff0f0\">\\\\<\/span><span style=\"background-color: #fff0f0\">System&quot;<\/span>,<span style=\"background-color: #fff0f0\">&quot;SystemBiosVersion&quot;<\/span>, szBuf, BUF_SIZE)) <span style=\"color: #008800; font-weight: bold\">return<\/span> <span style=\"color: #007020\">true<\/span>;\r\n\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (STR<span style=\"color: #333333\">::<\/span>Pos(<span style=\"background-color: #fff0f0\">&quot;VBOX&quot;<\/span>, szBuf)) <span style=\"color: #008800; font-weight: bold\">return<\/span> <span style=\"color: #007020\">true<\/span>;\r\n<\/pre>\n<\/div>\n<p>Seems like it only checks the registry. Good to know , but I wish they went into more depth. Check out the fill file <a href=\"http:\/\/www.gironsec.com\/code\/VMDetect.cpp\">here<\/a> or the whole thing on<br \/>\n<a href=\"https:\/\/github.com\/hzeroo\/Carberp\/tree\/6d449afaa5fd0d0935255d2fac7c7f6689e8486b\/source%20-%20absource\/pro\/all%20source\/BlackJoeWhiteJoe\/Source\">github<\/a>.<\/p>\n<p>I recently discovered <a href=\"http:\/\/gironsec.com\/antidebug.pdf\">the holy grail<\/a> of anti-debugging techniques. 150 pages of awesome and I&#8217;m trying to go through it all. <\/p>\n<p>I&#8217;ve also figured out how to do the EBFE trick in my C programs:<br \/>\n<!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #557799\">#define jump2self __asm _emit 0xEB __asm _emit 0xFE<\/span>\r\n<\/pre>\n<\/div>\n<p>The &#8220;emit&#8221; pseudo-function lets you insert 1 byte at a time into programs. It&#8217;s a bit more graceful than just jumping to a random place in memory and crashing.<br \/>\nThis allows me to insert asm instructions which may or may not be recognized by the compiler, but are accepted by the CPU. <a href=\"http:\/\/asm.inightmare.org\/opcodelst\/index.php?op=ICEBP\">ICEBP<\/a> comes to mind (0xF1).<br \/>\n<!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #557799\">#define iceBP __asm _emit 0xF1<\/span>\r\n<\/pre>\n<\/div>\n<p>This of course works best with Pelles C compiler. It&#8217;s a bit different when using something like MingW with CodeBlocks as it has to conform to *nix standards. Since there is no &#8216;__emit&#8217; function \/ keyword on Linux, you have to do the following:<br \/>\n<!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\">    <span style=\"color: #008800; font-weight: bold\">asm<\/span> <span style=\"color: #0066BB; font-weight: bold\">__volatile__<\/span> (<span style=\"background-color: #fff0f0\">&quot;.byte 0xEB&quot;<\/span>);\r\n    <span style=\"color: #008800; font-weight: bold\">asm<\/span> <span style=\"color: #0066BB; font-weight: bold\">__volatile__<\/span> (<span style=\"background-color: #fff0f0\">&quot;.byte 0xFE&quot;<\/span>);\r\n<\/pre>\n<\/div>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\">    <span style=\"color: #008800; font-weight: bold\">asm<\/span> <span style=\"color: #0066BB; font-weight: bold\">__volatile__<\/span> (<span style=\"background-color: #fff0f0\">&quot;.byte 0xF1&quot;<\/span>);\r\n<\/pre>\n<\/div>\n<p>Aside from that, my work continues on my anti-virus program with strides being made in the driver. Expecting an alpha release just in time for blackhat \/ HOPE (which I am presenting at).<\/p>\n<p>I promise to have a more comprehensive blog post next time. Until next time, hack on!<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/05\/1219376966785.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/05\/1219376966785.jpg\" alt=\"1219376966785\" width=\"450\" height=\"450\" class=\"alignnone size-full wp-image-784\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/05\/1219376966785.jpg 450w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/05\/1219376966785-150x150.jpg 150w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/05\/1219376966785-300x300.jpg 300w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Howdy all! It&#8217;s been a dog&#8217;s age. I&#8217;ve been busy with work and personal things. I enjoyed a brief 3 month relationship only to return to a life of loneliness. For now anyways. CactusCon went well. Had a nice turn out for my work shop. Hopefully the attendees learned something as I tried to make [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,7],"tags":[82],"_links":{"self":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/782"}],"collection":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/comments?post=782"}],"version-history":[{"count":5,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/782\/revisions"}],"predecessor-version":[{"id":788,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/782\/revisions\/788"}],"wp:attachment":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/media?parent=782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/categories?post=782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/tags?post=782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}