{"id":314,"date":"2009-08-14T21:39:37","date_gmt":"2009-08-14T16:09:37","guid":{"rendered":"http:\/\/judepereira.com\/blog\/?p=314"},"modified":"2009-08-14T21:42:46","modified_gmt":"2009-08-14T16:12:46","slug":"howto-create-a-hidden-loopback-device-in-a-jpg-file","status":"publish","type":"post","link":"https:\/\/judepereira.com\/blog\/howto-create-a-hidden-loopback-device-in-a-jpg-file\/","title":{"rendered":"[HOWTO] Create a hidden loopback device in a .jpg file"},"content":{"rendered":"<p>Well, I&#8217;m sure that you are definitely curious about how do you do this. Let me tell you this, it&#8217;s really simple.<br \/>\n<strong>Pre-requisites:<\/strong><\/p>\n<ul>\n<li>Image File(any format will do or even any file will do)<\/li>\n<li>Linux(I&#8217;ve only tested it on this platform but I guess Mac would also do)<\/li>\n<\/ul>\n<p>\nLet&#8217;s get started, shall we?<br \/>\nFirst create a standard loopback device.<\/p>\n<pre>dd if=\/dev\/zero of=hiddenimage bs=1M count=10<\/pre>\n<p>Let&#8217;s see what does this do:<br \/>\nIt creates a file called &#8220;hiddenimage&#8221;, with it&#8217;s size as 10MB.<br \/>\nThen, create a filesystem on it.<\/p>\n<pre>mkfs.ext4 hiddenimage<br><br>\r\nmke2fs 1.41.8 (11-July-2009)\r\nhiddenimage is not a block special device.\r\nProceed anyway? (y,n) y\r\nFilesystem label=\r\nOS type: Linux\r\nBlock size=1024 (log=0)\r\nFragment size=1024 (log=0)\r\n2560 inodes, 10240 blocks\r\n512 blocks (5.00%) reserved for the super user\r\nFirst data block=1\r\nMaximum filesystem blocks=10485760\r\n2 block groups\r\n8192 blocks per group, 8192 fragments per group\r\n1280 inodes per group\r\nSuperblock backups stored on blocks: \r\n\t8193\r\n\r\nWriting inode tables: done                            \r\nCreating journal (1024 blocks): done\r\nWriting superblocks and filesystem accounting information: done\r\n\r\nThis filesystem will be automatically checked every 39 mounts or\r\n180 days, whichever comes first.  Use tune2fs -c or -i to override.<\/pre>\n<p><!--more--><br \/>\nFind out the size of your file by<\/p>\n<pre>du -b Wallpapers\/Stones.jpg<\/pre>\n<p>Then, cat this image into your image file(or whatever file).<\/p>\n<pre>cat hiddenimage >> Stones.jpg<\/pre>\n<p>Then mount it by:<\/p>\n<pre>sudo mount -o loop,offset=FILESIZE Stones.jpg -t ext4 \/media\/testfs\/<\/pre>\n<p>as in mycase it was: <\/p>\n<pre>sudo mount -o loop,offset=1294792 Stones.jpg -t ext4 \/media\/testfs\/<\/pre>\n<p>We have now steganographed our own little filesystem image into a file. Ofcourse, anyone would be suspicious, so do ing this with a movie file would be a bit more appropriate. Now you can read\/write to this image.<br \/>\nComment me if you have any problems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, I&#8217;m sure that you are definitely curious about how do you do this. Let me tell you this, it&#8217;s really simple. Pre-requisites: Image File(any format will do or even any file will do) Linux(I&#8217;ve only tested it on this platform but I guess Mac would also do) Let&#8217;s get started, shall we? First create [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[52,10],"tags":[73,75,74,53],"class_list":["post-314","post","type-post","status-publish","format-standard","hentry","category-code","category-linux","tag-hidden","tag-image","tag-loopback-file","tag-stego"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pqtyx-54","jetpack-related-posts":[{"id":893,"url":"https:\/\/judepereira.com\/blog\/coloured-varlogmessages-at-tty12\/","url_meta":{"origin":314,"position":0},"title":"Coloured \/var\/log\/messages at tty12","author":"Jude Pereira","date":"April 26, 2011","format":false,"excerpt":"Reading logs could never become any more easier, at just a keystroke, you have your logs displayed where you want, in some fancy colour. They look great too. TTY's can be accessed by pressing Alt + Ctrl + F[1 - 12] simultaneously. In the following, you'll get a decent, colourized\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":694,"url":"https:\/\/judepereira.com\/blog\/visual-basic-6-revisited-linux-wine\/","url_meta":{"origin":314,"position":1},"title":"visual basic 6 revisited &#8211; linux &#8211; wine","author":"Jude Pereira","date":"August 5, 2010","format":false,"excerpt":"Earlier this year, I had written an article on running Visual Basic 6 on linux under wine, this is an update for it, the prior one is deprecated Getting Visual Basic 6 to work on linux is pretty easy, not much trouble, all the basic things work, as of what\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":903,"url":"https:\/\/judepereira.com\/blog\/usrlocalbinwaitpid\/","url_meta":{"origin":314,"position":2},"title":"\/usr\/local\/bin\/waitpid","author":"Jude Pereira","date":"April 26, 2011","format":false,"excerpt":"A quick script to wait for a certain pid, then once that quits, execute a command. You may ask, why not just do command1 && command2 ? Well, if command1 exits with a non-zero exit status value, command2 will not get executed. Hence, I've brewed a quick script for this\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1830,"url":"https:\/\/judepereira.com\/blog\/ios-mac-ipsec\/","url_meta":{"origin":314,"position":3},"title":"How to tunnel all traffic from your iOS device to your own server via IPSec","author":"Jude Pereira","date":"May 11, 2018","format":false,"excerpt":"TL;DR: A DigitalOcean droplet, strongSwan, and a custom Configuration Profile for iOS routes all the traffic from my iPhone via my droplet. Why? Just because I can. Note: This setup does not require you to download Apple Configurator and switch your iPhone into Supervised mode (we will create a configuration\u2026","rel":"","context":"In &quot;gnu linux&quot;","block_context":{"text":"gnu linux","link":"https:\/\/judepereira.com\/blog\/category\/linux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1845,"url":"https:\/\/judepereira.com\/blog\/intellij-on-steroids-with-g1-gc\/","url_meta":{"origin":314,"position":4},"title":"IntelliJ on steroids with G1 GC","author":"Jude Pereira","date":"June 15, 2018","format":false,"excerpt":"Lately, I noticed that IntelliJ started to pause for quite some time during it's GC cycles, and that it was very frequent when I was editing three files (over 1.2k LOC each) split vertically. The current version of IntelliJ runs on a bundled version of Java 1.8, who's default garbage\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1685,"url":"https:\/\/judepereira.com\/blog\/compile-less-on-the-fly-for-your-exploded-war-in-intellij\/","url_meta":{"origin":314,"position":5},"title":"Compile LESS on the fly for your exploded WAR in IntelliJ","author":"Jude Pereira","date":"February 5, 2016","format":false,"excerpt":"At CleverTap, we've recently started using LESS for dynamic CSS. While it has it's upsides, the biggest downside\u00a0was that most of our developers couldn't use the hot deploy feature for their local deployments. After an hour or so, we came up with a neat solution. \u00a0 There are two parts\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"External Tool configuration for compiling LESS files before deployment","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=525%2C300 1.5x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/comments?post=314"}],"version-history":[{"count":15,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/314\/revisions"}],"predecessor-version":[{"id":328,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/314\/revisions\/328"}],"wp:attachment":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/media?parent=314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/categories?post=314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/tags?post=314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}