Posted on 1 Comment

How to hide an exe file in a Jpeg

I have been searching for a way to send an executable file to someone and make him to execute it. Sending the exe directly is not feasible. So let’s see how to hide an exe file in a jpeg and test its feasibility. First of all, create a new directory namedtestand download some images and name them similarly. I downloaded images of a popular Tollywood actress. The plan is to lure the victim into falling in the trap. I did this on a Windows 7 machine.

Expeg1

Go to Folder Options”, go to View tab”,deselect ‘ Hide extensions for known file types‘ and select option Show hidden files, folders and drives. This will allow us to see the extensions of the files we are working with.

Expeg2

Open Notepad, type the following text and save it with the extension .bat”. What the following code does is it creates a new user named “hacker” with password “abc123″ in the Windows machine this code gets executed.

Expeg3

Download BAT to EXE converter and convert the batch file we just created to an exe.

Expeg4
Expeg5

Rename the file “samy.exe” to “samy_3.jpg”. Windows will prompt a warning. Ignore it.

Expeg6

Right click on the file “samy_3.jpg”, drag it a little and leave. Select ‘Create Shortcuts here’. We are creating a shortcut for the file samy_3.jpg.

Expeg7

Rename the shortcut to “samy_0.jpg”.Whatever the name you give make sure that the shortcut is clicked first and not the exe file.

Expeg8

Right click on “samy_0.jpg” and select Properties. In the “Start in” column delete the entire text. In the “Target:” column type “C:Windowssystem32cmd.exec samy_3.jpg.” This will run the file samy_3.jpg when clicked on the samy_0.jpg.

Expeg9

Click on “Change Icon” tab. Replace the text inside with “%SystemRoot%system32SHELL32.dll”and click on “OK”.

Expeg10

Compress all files into zip archive with the name “samy unseen.zip”. Remember that name should be attractive enough to lure the victim into clicking the images.

how to hide an exe file in a jpeg

OK, package is ready. Now the bigger challenge is to send the package to the victim’s computer. I tried to mail the package to the victim but it didn’t work out.

Expeg12

So I suggest you to find your own way of sending it to the victim. To test if the package will work on the victim’s system or not openCMD” and type the command “net user” before executing the image. It will show us all the users on the system.

Expeg13

Then click on the image samy_0.jpg. Open “CMD” and type the “net user” command again.

Expeg14

A new user named hacker has been created. So the trick worked.

Follow Us

1 thought on “How to hide an exe file in a Jpeg

  1. Unfortunately, yes it needs administrator privileges.

Comments are closed.