Need a script/program to find hidden files in image files

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help

Need a script/program to find hidden files in image files

Postby BlackSnowflake on Sat Mar 23, 2013 4:36 pm

Not really a linux mint related question, but still.
I need help creating a script that searches all .png, .jpg, .jpeg and .gif files for files hidden in them (preferably all files that could be hidden in images, but only .rar and .zip is good too if the other option is impossible).
Then I want it to output all the files which have files hidden in them.
Anyone can make such a thing?

EDIT: If there is a program for this or something like this already exists then tell me, of course!
EDIT2: Found this (, how do I make this scan all subdirectories as well? Can I make this check for .zip/.rar files too (and how)?
EDIT3: A kind /g/entleman was able to provide me with this:

Code: Select all
# Find archives hidden in images.
# Published under the ISC license, (c) 2013 Anonymous-san.

d="`pwd`" # Default root.
out="out" # Output folder.

if test "$1" != ""; then d="$1"; fi

log=/tmp/upack-`date +%s`.log
if ! test -d "$out"; then mkdir "$out"; fi
for image in `find "$d" -iname '*.jp?g' -o -iname '*.png' -o -iname '*.gif'`; do
    7z x "$image" -o"$out" -y 2>&1 |
            sed -n '/Processing/ {
                        /Extracting/ {
                            s/Processing archive: //
                            s/\n\nExtracting  /: /
done | tee "$log"

EDIT4: Has nothing to do with anything but I tried renaming a .py file to a .7z and then doing "cat [filename].py > [image name].jpg". The result of this was that everything in the terminal became chinese.

But I THINK it only does the current directory (and no subdirectories) and that it only works with .7z files.
Got the idea from this thread on 4chan:
Level 1
Level 1
Posts: 8
Joined: Thu Feb 14, 2013 7:29 am

Linux Mint is funded by ads and donations.

Return to Other topics

Who is online

Users browsing this forum: No registered users and 7 guests