{"id":18593,"date":"2009-04-09T10:00:00","date_gmt":"2009-04-09T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2009\/04\/09\/being-able-to-call-a-function-without-using-getprocaddress-is-not-a-security-vulnerability\/"},"modified":"2009-04-09T10:00:00","modified_gmt":"2009-04-09T10:00:00","slug":"being-able-to-call-a-function-without-using-getprocaddress-is-not-a-security-vulnerability","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20090409-00\/?p=18593","title":{"rendered":"Being able to call a function without using GetProcAddress is not a security vulnerability"},"content":{"rendered":"<p>Another genre in the sporadic category of dubious security vulnerability is people who find an unusual way of accomplishing something perfectly normal but declare it a security vulnerability because they found an unusual way of doing it.<\/p>\n<blockquote class=\"q\"><p>  Security is important to all computers users, from families at home to employees of government agencies, and people who use Microsoft Windows are no exception. Trojans, backdoors, and spyware (collectively known as <i>malware<\/i>) have taken many forms, most recently those of so-called <i>rootkits<\/i>, which modify the operating system itself in order to prevent their detection. Firewalls are an important tool in the defense against malware. <\/p>\n<p> Through the following sequence of tricks, we can obtain the address of any function without using the <code>GetProcAddress<\/code> function. Once that address is obtained, the function can be called in the normal manner. First, obtain the module base address by calling the <code>LoadLibrary<\/code> function. The headers of the image are mapped into memory at the base address. From there, you can parse the headers of the module, look for the export directory, then manually parse the exported function name table until you find the function you want. In this way you can call functions like <code>RegSetValue<\/code> without detection. <\/p>\n<\/blockquote>\n<p> Well, sure, you can manually perform all the operations that the <code>GetProcAddress<\/code> would perform, but what&#8217;s the point? Once you call <code>RegSetValue<\/code> all the normal registry security checks take place. You haven&#8217;t bypassed anything. If you were so keen on calling functions surreptitiously, you could scan memory looking for the byte pattern that corresponds to the function you&#8217;re looking for, or heck, just cut out the middle man and just take the code from the DLL you are trying to gain secret access to and copy it into your program! <\/p>\n<p> In other words, you just <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2008\/05\/16\/8510192.aspx\"> found a complicated way of doing something perfectly mundane<\/a>. You can&#8217;t make up for the absence of any actual vulnerability by piling on style points and cranking up the degree of difficulty. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Another genre in the sporadic category of dubious security vulnerability is people who find an unusual way of accomplishing something perfectly normal but declare it a security vulnerability because they found an unusual way of doing it. Security is important to all computers users, from families at home to employees of government agencies, and people [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-18593","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>Another genre in the sporadic category of dubious security vulnerability is people who find an unusual way of accomplishing something perfectly normal but declare it a security vulnerability because they found an unusual way of doing it. Security is important to all computers users, from families at home to employees of government agencies, and people [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/18593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=18593"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/18593\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=18593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=18593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=18593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}