How to make a self running file?

917 views Asked by At

I have a activity in school about how a hacker might hack your pc without knowing, I was assigned to make a self running file, what I'm trying to do is, when a person for eg. Downloads a file, then without he opening it should already run without even the user opening it. Is this possible?

1

There are 1 answers

6
Or Y On BEST ANSWER

This is not possible, not really actually.

If you want a file to be executed without the user executing it first after download, you will have to do one of such things:

  1. Have an already running program on his machine that looks for your file and then executes it when he finds it in the downloads (MAGIC in the beginning of the file for example or hash validation).

  2. Take advantage of a poorly protected software that executes other files or codes (Or override a standard library) file and make it run your code instead. of course this is not as simple as it sounds and requires you to understand the software that you are attacking pretty good.

    Note: Most programs won't just execute some arbitrary code and probably wont just use execv for no reason or without making sure that everything is correct and protected, which makes that solution (Without finding a security breach in the software) pretty difficult.