A Node.js Proof of Concept Virus

(If you are looking for the source code scroll all the way down for the link)

Image for post
Image for post

So, I have these random trains of thoughts sometimes. They go like this: I wonder about the universe, about evolution and life out there, wonder if someone else is looking back while I'm staring up into the night sky. Is there intelligent life out there? Is life merely an inevitable consequence of the laws of thermodynamics, serving the ever increasing entropy?
What about artificial evolution? Did no-one ever continue Thomas Ray’s mind-blowing work he started with Tierra. What’s the state of digital evolution and life in a computer? Is self-reproduction enough? Are computer viruses in this weird state of being not really alive but not really dead either as biological viruses are? Are people still writing those viruses anyways? I am learning so much about Node.js right now, but I never heard about a virus infecting Node.js apps.

… quick googling for Node.js virus ...

Nope. Nothing. Zero.
Just, .. why did no-one ever wrote a Node.js virus?
Um.. Maybe.. I should try to write a Node.js virus?

So. yeah, I wrote a (very basic) Node.js virus. Merely a small self-replicating piece of Javascript infecting Node.js applications.
But I was VERY excited. I was proud of myself.
I thought about naming it after the love of my life, my wife Athena.
But you should have seen the look on her face when I told her.
I don't know why I thought this was a good idea. It wasn’t.

So I named it .. nothing at all. It got no name! Oh my!
And this is why I wrote this blog post:

Submit your suggestions!
How shall I name it?

Do me a favor. Don’t do anything bad. Thanks.

PS: For details how the virus works, read the comments in the source, but here what the virus does on a high level:

  1. It scans directories for package.json files and analyzes them for ‘entry points’
  2. It then checks if those files can be infected (eg: no already infected files)
  3. It attempts to append itself to the file (and even chmods if necessary)

Node and Beyond

Stories on Node.js

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store