Re: Can I make a class file self destruct?



JuanValdex wrote:
I would like to be able to access a class file remotely, and send it a
command to self-destruct if it is unlicensed. (We have thieves
distributing our class files without license.)

This is a very dangerous thing to do, and you might piss of more paying customers than preventing theft.

Actually, if I would know your company's name, I would already now make a mental note to try to avoid products from your company in the future.

People have previously put such kinds of bombs in products to protect them. Typically, when they are found out their software gets branded as malware, and sales drops.

You might piss of paying customers so much that they might send their lawyers after you - particular if something goes wrong. I am not a lawyer, but you might want to have a chat with one and ask him if what you want to do isn't close to intentional computer sabotage.

You are somehow trying to take the law in your own hands. Maybe it would be better use the law to go after the thefts than trying to take the law in your own hands.

Can I put some code in the class file to do this?

You can put code in a class to erase a file (might require signing). The file to erase might e.g. be a class file or a jar. Assuming, of course, the class is indeed there as a file (probably in some cache).

But, and that is a BIG BUT:

- You have to manage to find the right file in the user's file system

- You better not accidentally identify a wrong file

- You manage to find all copies of the file (and then the user can still restore it from a backup)

- You have the necessary file access rights to delete the file.

- The OS has not locked the file and doesn't prevent erasure.

And still, your software would be a risk waiting to become reality.

<applet codebase="http://www.remotesite.com/"; code="myfile.class"...>
<param name="destroyClassFile" value="DoIt">

So you have an applet? Loading from your web site? If yes, why don't you put the IP addresses of the offenders in the ACL of your firewall and deny them access?

Or do they have local copies?

Any ideas? How can I send commands to the class file to permanently
change itself?

A class file is not a living entity. You either already have malicious code inside which listens for a command or nothing is possible.


/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
.



Relevant Pages

  • Re: ActiveX Dll in Csharp
    ... create a class file myCOMobj.cs ... public class myCOM: ImyCOMobj ... Compile the original .cs file to make a dll using this strong key. ... Use the command below achieve this. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Runtime Error in Eclipse
    ... I do get the error message that Eclipse gives me when I try to run ... There is no source file attached to this class file SystemTest.class" ... here is the error message when I try to run via the command ... >java SystemTest ...
    (comp.lang.java.programmer)
  • Re: package does not exist
    ... >I'm trying to compile a class file to correct an error someone else left ... but have knowledge of the exact command line syntax ... >of javac. ... including the package structure or a jar file. ...
    (comp.lang.java.help)
  • Re: package does not exist
    ... >>I'm trying to compile a class file to correct an error someone else ... but have knowledge of the exact command ... including the package structure or a jar file. ... The root of the package is in the classes folder, ...
    (comp.lang.java.help)