Hide files in a file or software


In this guide, you will learn how to hide files/viruses/scripts in a different file, so they will act as a trojan horse to your code.


Hide a file

you will do this on a Windows machine,

Open a CMD,

Let’s create a directory:

  1. C:\md Test Folder

  2. C:\>cd Test Folder

  3. C:\Test Folder> notepad <FileName.txt>:<SecondFileName.txt>

  4. C:\Test Folder> notepad file1.txt:hideingfromyou.txt

cmd - hide files

a pop up message asking if you want to create a file “file1.txt:hideingfromyou.txt“ will appear, click "Yes":

notepad - hide file

Write something in the file you just created.

for example: “file with hidden words”

Save it and exit.

Notepad-hide Files text

Now on the Commend prompt type “dir” and you will see the file.

although you wrote in it, you can see that the file size is 0 bytes

cmd - dir 0 bites

Now,

Let’s open the file with Notepad.exe again and type something else in it.

First you will notice it’s empty.

Second, type something in it, for example: “this you will see” .

Save and close the file.

Type “dir” in the CMD and you will see the file size has grown:

file size - hidden file

go to the file directory and open the file. you will see the text you wrote, in our example: “this you will see

the text you wrote the first time (in our example “file with hidden words”) will not appear.

notepad- hide files see text

If you want to see the hidden text, you need to type:

C:\Test Folder>dir \r

You will see the altered file with data strings:

You can do the same with a code/ software

1. For example you will copy the “write.exe” from Windows directory and copy to our test folder.

2. You will now create another text file with some words in it, save and exit (I named it "file2").


3. Type “dir” to see that both files are in there, File2.txt and Write.exe

4. You will now inject “Write.exe" as our evil program. type:

C:\Test Folder>type write.exe > file2.txt:write2.exe

This commend will insert “write.exe” into "file2.txt" and that will change the "write2.exe" alternate data string to "file2.txt":

You can see that the files are the same size.

5. Let’s delete the “write.exe” so You will only have the files.

del write.exe

6. Try to run the “file2.txt” and you will see that you can’t.

To run it you will need to create a symbolic link to the program that can open the file

7. Type in the CMD:

C:\Test Folder>mklink <NameOfApp.exe> <path to our hidden program>

C:\Test Folder>mklink evil.exe C:Test Folder\file2.txt:write2.exe

CMD evil file-hide file

Now if you type “dir”, you will see your new file “evil.exe”.

if you type “evil”, the “write.exe” will open.

If you want to take it one step further, you can hide the “evil” file, and when you type "evil" it will open the “write.exe” although it’s not showing.

To hide the file;

right click it >> properties >> General tab >> check the hidden box and click OK

That is it! the file is hidden.

All the guides, tips, and tricks on this web site are for education purpose only, the website owner is not accountable for any use of this information