{"id":411,"date":"2016-09-06T14:22:47","date_gmt":"2016-09-06T08:52:47","guid":{"rendered":"http:\/\/www.cyberaka.com\/?p=411"},"modified":"2016-09-06T14:23:23","modified_gmt":"2016-09-06T08:53:23","slug":"embedding-images-directly-into-html","status":"publish","type":"post","link":"https:\/\/www.cyberaka.com\/?p=411","title":{"rendered":"Embedding images directly into HTML"},"content":{"rendered":"<p>I needed to email an HTML report and I was not happy with the fact that we have to create zip file containing the HTML, Images etc. I knew it was possible to embed base64 data directly into HTML I started looking for some PoC. My search took me to an <a href=\"https:\/\/www.base64encode.org\/\">online base64 encoder and decoder<\/a>. This gave me the idea to convert the external image files into base64 string and embed it directly into HTML. On some search I landed up <a href=\"https:\/\/commons.apache.org\/proper\/commons-codec\/\">Apache Commons Codec Library<\/a> which contains a <a href=\"https:\/\/commons.apache.org\/proper\/commons-codec\/apidocs\/org\/apache\/commons\/codec\/binary\/Base64.html\">Base64 class<\/a> which can be used to covert an input stream into a base64 string. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I needed to email an HTML report and I was not happy with the fact that we have to create zip file containing the HTML, Images etc. I knew it was possible to embed base64 data directly into HTML I started looking for some PoC. My search took me to an online base64 encoder and [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-411","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=411"}],"version-history":[{"count":4,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/411\/revisions"}],"predecessor-version":[{"id":523,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/411\/revisions\/523"}],"wp:attachment":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}