Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't know if such a question is allowed on this site, sorry if it's not

For educational purposes I am asked to write a small virus running on Linux, which should just be able to inject itself into other binaries (but not anything else). I thought of injecting its code with a technique described here: and this one (playing with the ELF format) but I couldn't find the assembly source. Do you have any links showing how to do such things? Thanks!

share|improve this question

Here's sample code for run-time process injection on linux. This is how meterpreter does it.LibHiJack

share|improve this answer

You can probably write one using Alexander Bartolich's ELF Virus Writing How-To

A fellow by the name of Silvio Cesare had a Unix Virus mailing list in the mid-90s. Search for his name and "unix virus" and you'll find goodies like this.

You could also benefit from Tom Duff's Viral Attacks on Unix System Security . He gives an example sh-script virus, but I think you could transliterate that code to C and have a working virus.

share|improve this answer

In addition to @BruceEdiger's excellent answer, you might enjoy the following paper: Hunting for metamorphic.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.