Plan du site  
pixel
pixel

Articles - Étudiants SUPINFO

The art of hiding sensitive files or folders

Par Erwan LOCART Publié le 30/06/2017 à 13:29:38 Noter cet article:
(0 votes)
Avis favorable du comité de lecture

1. Introduction

Here I will teach you, in a first step to hide zipped files / folders in an image in order to retrieve these later.

In a second step, I will teach you how to conceal a folder or a file so that it will not be visible.

2. Hiding a zip file in an image

a. The theory

To make this possible (only on Windows), your system will concatenate the zip archive containing files and the target image.

So neither of the 2 files (the archive and the image), will be modified.

So no difference will be visible on the image display, but if we are interested about the size of the image, we can quickly notice a difference more or less depending on the size of the zip archive to concatenate to the image.

Indeed, the final size of the image with the concealed files, will be the sum of the size of the image and the size of the archive.

Be careful not to overload the image with a several hundred billion of terra octet archive ;)

b. With a command prompt

To make it, it is really simple:

1. Open your command prompt: press Windows + R then "cmd", and finally enter.

2. Go to your folder where your two files (the zip archive and the image) are stored thanks to the cd command :

 cd C:\FILES_PATH 

3. Enter the following command in adapting your files names:

 copy /b IMAGE.jpg + ARCHIVE.rar FINAL_FILE.jpg 

You have now your image with your zip archive concealed in it.

Now you want to know how to recover your files ?

To do this, just rename your file, replacing your file extension by ".zip".

Or run this command :

 ren FINAL_FILE.jpg FINAL_FILE.zip 

c. With a batch program

In order to follow the rest of this article, please consult this link to know the batch basics.

https://www.supinfo.com/articles/single/2805-angage-batch

This piece of code, will open Windows Explorer to choose a file, then will display in the console the link of the selected file:

<# : hide.bat

@echo off
setlocal

for /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') do (
    set file=%%~I
)
echo File : %file%
pause

: end Batch portion / begin PowerShell hybrid chimera #>

Add-Type -AssemblyName System.Windows.Forms
$f = new-object Windows.Forms.OpenFileDialog
$f.InitialDirectory = pwd
$f.Filter = "All Files (*.*)|*.*"
$f.ShowHelp = $true
$f.Multiselect = $true
[void]$f.ShowDialog()
if ($f.Multiselect) { $f.FileNames } else { $f.FileName }

So with this code, we will be able to retrieve the two files names to be concatenated.

Like this :

<# : hide.bat 
 
@echo off 
title %date% %time% 
setlocal 
echo Select the zip file to hide. 
 
for /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') do ( 
    set file1=%%~I 
) 
echo. 
echo Select the image. 
for /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') do ( 
    set file2=%%~I 
) 
echo. 
set /p name=Name of the final file ?  
copy /b %file2% + %file1% %name%.png 
echo. 
echo. 
pause 
 
: end Batch portion / begin PowerShell hybrid chimera #> 
 
Add-Type -AssemblyName System.Windows.Forms 
$f = new-object Windows.Forms.OpenFileDialog 
$f.InitialDirectory = pwd 
$f.Filter = "All Files (*.*)|*.*" 
$f.ShowHelp = $true 
$f.Multiselect = $true 
[void]$f.ShowDialog() 
if ($f.Multiselect) { $f.FileNames } else { $f.FileName } 

After learning the concealment method, let us now see how to extract it:

<# : hide.bat

@echo off 
title %date% %time% 
setlocal 
 
echo Select the image to extract. 
for /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') do ( 
    set file1=%%~I 
) 
copy %file1% %file1%.zip 
echo. 
pause 

: end Batch portion / begin PowerShell hybrid chimera #>

Add-Type -AssemblyName System.Windows.Forms
$f = new-object Windows.Forms.OpenFileDialog
$f.InitialDirectory = pwd
$f.Filter = "All Files (*.*)|*.*"
$f.ShowHelp = $true
$f.Multiselect = $true
[void]$f.ShowDialog()
if ($f.Multiselect) { $f.FileNames } else { $f.FileName }

Now let's add a menu to this program using "goto" and "label" by adding the possibility to conceal and extract files:

<# : hide.bat
                                                                                                                                                                                    
@echo off 
title %date% %time% 
setlocal 
:menu 
cls 
echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
echo ³  1. Hide a file           ³ 
echo ³  2. Extract a file        ³ 
echo ³  3. Exit                  ³ 
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 
set /p num="" 
echo. 
                                                                                                                                                                                     
goto :menu%num% 
                                                                                                                                                                                     
:menu1 
cls 
echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
echo ³     Hide a file           ³ 
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 
echo. 
echo Select the zip file to hide. 
                                                                                                                                                                                     
for /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') do ( 
    set file1=%%~I 
)                                                                                                                                                                                     
cls 
echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
echo ³     Hide a file           ³ 
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 
echo. 
echo Select the image. 
for /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') do ( 
    set file2=%%~I 
)                                                                                                                                                                                     
cls 
echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
echo ³     Hide a file           ³ 
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 
echo. 
set /p name=Nom du fichier final ?  
copy /b %file2% + %file1% %name%.png 
echo. 
echo. 
pause 
goto menu 
:menu2 
cls 
echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
echo ³   Extract a file          ³ 
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 
echo. 
echo Select the image to extract. 
for /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') do ( 
    set file1=%%~I 
)                                                                                                                                                                                     
copy %file1% %file1%.zip 
echo. 
echo. 
pause 
goto menu 
:menu3 
                                                                                                                                                                                    
: end Batch portion / begin PowerShell hybrid chimera #>
                                                                                                                                                                                    
Add-Type -AssemblyName System.Windows.Forms
$f = new-object Windows.Forms.OpenFileDialog
$f.InitialDirectory = pwd
$f.Filter = "All Files (*.*)|*.*"
$f.ShowHelp = $true
$f.Multiselect = $true
[void]$f.ShowDialog()
if ($f.Multiselect) { $f.FileNames } else { $f.FileName }
                                                                                                                                                                                    

Here we are. With this small program, you can send hidden files to your friends without giving to anyone else the access in case of interception of this data.

You can also modify this program in order to manage the archives rar, 7z, ... to optimize the size of the archive to conceal your files easier.

3. Create a folder/file almost invisible

a. In theory

To hide a hidden folder, there are several methods :

- The easiest way is to change the properties of a folder or a file in order to make it invisible if the user has not checked the "show hidden files, folders, and drives" box :

- The second method is to take an invisible character like a space, then customize the icon of the element to make it transparent.

- Another method, quite inefficient compared to the others consist in hidding all icons from the desktop, which will let you fully enjoy your wallpaper.

b. The practice

In practice, the first method is very simple :

1. Create the folder or the file

2. Go to the properties of the item :

3. Check the box "Hidden"

4. Click "OK"

For the second method, this is more complex and will only work on the desktop. Follow these steps:

1. Create the folder or the file

2. Rename it with an invisible space (ATTENTION, a simple space will be refused by Windows). To do this, use the key combination ALT + 0160 which will generate a space that is accepted by Windows.

3. Press enter to confirm

4. Go to the folder properties.

5. Go to the "Customize" menu.

6. Click "Change Icon ..."

7. Select a transparent icon:

8. Press "Apply" then "OK"

Want to have several of these invisible folders? It is simple, just put two "invisible characters" (ALT + 0160) for the second, three for the third, and so on ...

For the last method, just right click on your desktop then go to the "display" menu and uncheck the box "show desktop items".

4. Conclusion

You now know how to hide files / folders so that an intruder in your system does not see them at first glance.

The benefits of these file hiding procedures can be simply the fact to not disclose files that another user of your machine might get, or to communicate files to a third party as long as that person knows how to recover those files.

The disadvantage of these procedures is that they are "low-level" and therefore that an experienced and accustomed user to these methods will bypass these "protections".

I would not be responsible for what you do with it or for any deterioration of material or corrupted file, cause this is just an informative article.

A propos de SUPINFO | Contacts & adresses | Enseigner à SUPINFO | Presse | Conditions d'utilisation & Copyright | Respect de la vie privée | Investir
Logo de la société Cisco, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société IBM, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Sun-Oracle, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Apple, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Sybase, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Novell, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Intel, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Accenture, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société SAP, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Prometric, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo de la société Toeic, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management Logo du IT Academy Program par Microsoft, partenaire pédagogique de SUPINFO, la Grande École de l'informatique, du numérique et du management

SUPINFO International University
Ecole d'Informatique - IT School
École Supérieure d'Informatique de Paris, leader en France
La Grande Ecole de l'informatique, du numérique et du management
Fondée en 1965, reconnue par l'État. Titre Bac+5 certifié au niveau I.
SUPINFO International University is globally operated by EDUCINVEST Belgium - Avenue Louise, 534 - 1050 Brussels