This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
wynro's profile picture

Computercraft real virus

Started by wynro, 25 June 2012 - 10:53 AM
wynro #1
Posted 25 June 2012 - 12:53 PM
I was looking around and i see a lot of "viruses" that only rewrite the startup file or copy itself to the floppy, and I think: ¿It is possible create a real CC virus?
With real virus I mean a program that can spread itself over rednet API or HTML API, attach to files, execute the payload, etc.
The real question is: ¿I can run a program or execute commands over rednet without permission from the other computer?

Edit: Whoa!, thanks for the quick response :P/>/>
The first problem I see about a real large scale worm is that there aren't an unified rednet protocol (there aren't DNS or TCP/IP), instead of this there are tons of rednet systems (FTP servers, web servers, etc), so if you want to create a virus you need to create a lot of different viruses, one for every rednet system.
So It's "easy" create a trojan horse (the difficult think it's run the virus in the target), and also "easy " create a virus, but I think it's nearly impossible create a worm that copies itself without user's action.
Mtdj2 #2
Posted 25 June 2012 - 01:03 PM
It is possible, if the other computers are listening for file download, you will be able to send the file like constantly to anyone near you.
I dont think it is possible in http Api, since it uses websites and downloading from there…
Haven't made such a thing myself, just know a bit of lua.
Hope this helped.
kazagistar #3
Posted 25 June 2012 - 04:09 PM
You mean a worm?

Worms depend on (1) a somewhat homogenous install base from some software that (2) has open ports with some sort of code injection exploit. Since people tend to run different software, and most of it does not let you execute code remotely, you cannot have a particularly large scale worm, in general. Trojans are also less popular, since all the source code is visible, and most people running the code can, in theory, read it. That is why viruses are so popular: automatically booting disks is a large attack surface and anyone can be vulnerable.

That said, what can be far more effective is targeted hacks. If you figure out that someone is using an "automatic updater" or something similar for the network in their factory, for their chat program, for file server, or whatever, you can find an exploit in that and pwn that particular system.
TheOddByte #4
Posted 19 October 2012 - 07:08 PM
Is there any code that you can write so you can't shut off the computer?
I know there is

os.pullEvent = os.pullEventRaw
so you cant terminate the virus or program
But is there an actual code so you can't shut off or reboot the computer?
Because I know that is the easiest way to stop it.
stan2012 #5
Posted 19 October 2012 - 07:33 PM
to write a successful virus you would have to escape the lua emulator and execute some java code to copy your virus to other computers
or find some security exploits in lua to execute some code on a computer without a connection
Cloudy #6
Posted 19 October 2012 - 10:23 PM
Is there any code that you can write so you can't shut off the computer?
I know there is

os.pullEvent = os.pullEventRaw
so you cant terminate the virus or program
But is there an actual code so you can't shut off or reboot the computer?
Because I know that is the easiest way to stop it.

No. And don't bump four month old threads.
Kingdaro #7
Posted 20 October 2012 - 06:25 AM
I actually thought of a kind of actual virus that, when executed, would write massive amounts of text to files and would eventually fill the program host's computer space.

That is until I looked through the config files and found a size limit on computers and disks by default, so it would be a good idea to not remove that. :S