{"id":7014,"date":"2020-03-14T01:21:22","date_gmt":"2020-03-14T01:21:22","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=7014"},"modified":"2020-03-14T01:21:24","modified_gmt":"2020-03-14T01:21:24","slug":"stackoverflown-in-practice","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2020\/03\/14\/stackoverflown-in-practice\/","title":{"rendered":"StackOverflown in practice&#8230;"},"content":{"rendered":"\n<p>We are so used to all the jokes about programmers re-using online code and copypasting stuff from StackOverflow all the time that we sometimes forget about a sad reality &#8211; lots of public code is being copied blindly, and &#8216;if it works&#8217;, it more than often makes it to a production level&#8230; yes&#8230; including code that is incorporated into release build and signed binaries.<\/p>\n\n\n\n<p>This brings a lot of interesting side-effects:<\/p>\n\n\n\n<ul><li>signed binaries are often blindly trusted, so vulnerable code that makes it into a signed binary is a big bonus for researchers\/attackers (follow <a href=\"https:\/\/twitter.com\/hFireF0X\">hFireFOX<\/a> and his kernel driver copypasta discoveries)<\/li><li>a code that uses a hardcoded set of crypto primitives will be vulnerable to the fact these primitives are out there and in public &#8211;> attackers can decrypt secrets faster<\/li><li>since the programmers who copypaste the code don&#8217;t know any better it often takes a lot of efforts for them (or their successors) to fix these issues<\/li><li>&#8230;<\/li><\/ul>\n\n\n\n<p>The main topic of this post is the item #2 on the above list: <\/p>\n\n\n\n<p>&#8211; crypto primitives re-use.<\/p>\n\n\n\n<p>After poking around <em>en masse<\/em> in a large number of &#8216;good; samples I discovered that many of these samples re-use the AES crypto routines that rely on the following two primitives:<\/p>\n\n\n\n<ul><li>IV: &#8220;OFRna73m*aze01xY&#8221;<\/li><li>Salt: &#8220;Kosher&#8221;<\/li><\/ul>\n\n\n\n<p>This is not a coincidence &#8211; you can find code instances that refer to this combo <a href=\"https:\/\/www.google.com\/search?q=%22OFRna73m*aze01xY%22+%22kosher%22\">here<\/a>. Programmers don&#8217;t know what to change in this code and they just embed it as it is. Bad and pretty big mistake. <\/p>\n\n\n\n<p>There are many more examples like this and I may list them some time in the future.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are so used to all the jokes about programmers re-using online code and copypasting stuff from StackOverflow all the time that we sometimes forget about a sad reality &#8211; lots of public code is being copied blindly, and &#8216;if &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2020\/03\/14\/stackoverflown-in-practice\/\">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":[60],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/7014"}],"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=7014"}],"version-history":[{"count":2,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/7014\/revisions"}],"predecessor-version":[{"id":7016,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/7014\/revisions\/7016"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=7014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=7014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=7014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}