{"id":150,"date":"2018-01-29T00:04:59","date_gmt":"2018-01-29T00:04:59","guid":{"rendered":"http:\/\/malwrforensics.com\/en\/?p=150"},"modified":"2018-01-29T00:28:59","modified_gmt":"2018-01-29T00:28:59","slug":"python-script-to-check-for-banned-api-in-source-files","status":"publish","type":"post","link":"https:\/\/malwrforensics.com\/en\/2018\/01\/29\/python-script-to-check-for-banned-api-in-source-files\/","title":{"rendered":"Python script to check for banned windows APIs in source files"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/asaygo\/malwrforensics\/blob\/master\/scripts\/banned_api_search.py\">Here<\/a> is a python script to check if any <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ff818516(v=vs.85).aspx\">banned windows APIs<\/a> are present in C source\/header files. It&#8217;s useful to find where vulnerable code might be present.<\/p>\n<p>The script gets as an argument a folder name and then recursively checks files with .c, .cpp and .h file extensions to see if they use any of the banned APIs.<\/p>\n<p>The output has the following format:<\/p>\n<pre>source_file:(L&lt;line_number&gt;): &lt;line_text&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is a python script to check if any banned windows APIs are present in C source\/header files. It&#8217;s useful to find where vulnerable code might be present. The script gets as an argument a folder name and then recursively checks files with .c, .cpp and .h file extensions to see if they use any [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[41,35,6,42,4],"class_list":["post-150","post","type-post","status-publish","format-standard","hentry","category-security","tag-banned-api","tag-python","tag-tool","tag-vulnerability","tag-windows"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[]}},"featured_image_urls_v2":{"full":"","thumbnail":"","medium":"","medium_large":"","large":"","1536x1536":"","2048x2048":""},"post_excerpt_stackable_v2":"<p>Here is a python script to check if any banned windows APIs are present in C source\/header files. It&#8217;s useful to find where vulnerable code might be present. The script gets as an argument a folder name and then recursively checks files with .c, .cpp and .h file extensions to see if they use any of the banned APIs. The output has the following format: source_file:(L&lt;line_number&gt;): &lt;line_text&gt;<\/p>\n","category_list_v2":"<a href=\"https:\/\/malwrforensics.com\/en\/category\/security\/\" rel=\"category tag\">Security<\/a>","author_info_v2":{"name":"malwrforensics","url":"https:\/\/malwrforensics.com\/en\/author\/u_malwrforensics\/"},"comments_num_v2":"0 comments","_links":{"self":[{"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/posts\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":3,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":153,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/posts\/150\/revisions\/153"}],"wp:attachment":[{"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/malwrforensics.com\/en\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}