-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added RCE (Remote Code Execution) challenge with vulnerable Java dese…
…rialization, updated fonts, increased version to 1.1.0
- Loading branch information
Showing
40 changed files
with
856 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ plugins { | |
} | ||
|
||
group 'com.warxim' | ||
version '1.0' | ||
version '1.1' | ||
|
||
repositories { | ||
mavenCentral() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
...va/com/warxim/vucsa/client/challenge/rcedeserialization/RceDeserializationController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Vulnerable Client-Server Application (VuCSA) | ||
* | ||
* Copyright (C) 2023 Michal Válka | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under the terms of the | ||
* GNU General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this program. If | ||
* not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
package com.warxim.vucsa.client.challenge.rcedeserialization; | ||
|
||
import com.warxim.vucsa.client.Bundle; | ||
import com.warxim.vucsa.client.challenge.ChallengeController; | ||
import com.warxim.vucsa.common.ChallengeConstant; | ||
import com.warxim.vucsa.common.message.rcedeserialization.MessageContent; | ||
import com.warxim.vucsa.common.message.rcedeserialization.TextMessage; | ||
import javafx.application.Platform; | ||
import javafx.event.ActionEvent; | ||
import javafx.fxml.FXML; | ||
import javafx.fxml.Initializable; | ||
import javafx.scene.control.TextArea; | ||
|
||
import java.net.URL; | ||
import java.util.ResourceBundle; | ||
|
||
/** | ||
* RCE Deserialization controller handles RCE Deserialization challenge, which acts as echo server using object serialization. | ||
*/ | ||
public class RceDeserializationController extends ChallengeController implements Initializable { | ||
private final RceDeserializationHandler handler = new RceDeserializationHandler(this); | ||
|
||
@FXML | ||
private TextArea dataInput; | ||
@FXML | ||
private TextArea dataOutput; | ||
|
||
@Override | ||
public void initialize(URL location, ResourceBundle resources) { | ||
initHandler(); | ||
} | ||
|
||
/** | ||
* Sets data to the output component | ||
* @param data Output to be set | ||
*/ | ||
public void setOutput(String data) { | ||
Platform.runLater(() -> dataOutput.setText(data)); | ||
} | ||
|
||
/** | ||
* Sends items to the server. | ||
*/ | ||
@FXML | ||
private void onSendClick(ActionEvent event) { | ||
var data = dataInput.getText(); | ||
var messageContent = new MessageContent(data); | ||
|
||
var message = TextMessage.builder() | ||
.target(ChallengeConstant.RCE_DESERIALIZATION_TARGET) | ||
.content(messageContent) | ||
.build(); | ||
sendMessage(message); | ||
} | ||
|
||
/** | ||
* Initializes RCE deserialization message handler. | ||
*/ | ||
private void initHandler() { | ||
Bundle.getInstance().getClientManager().registerHandler(ChallengeConstant.RCE_DESERIALIZATION_TARGET, handler); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
.../java/com/warxim/vucsa/client/challenge/rcedeserialization/RceDeserializationHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Vulnerable Client-Server Application (VuCSA) | ||
* | ||
* Copyright (C) 2023 Michal Válka | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under the terms of the | ||
* GNU General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this program. If | ||
* not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
package com.warxim.vucsa.client.challenge.rcedeserialization; | ||
|
||
import com.warxim.vucsa.common.connection.Connection; | ||
import com.warxim.vucsa.common.message.Message; | ||
import com.warxim.vucsa.common.message.MessageHandler; | ||
import com.warxim.vucsa.common.message.rcedeserialization.TextMessage; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
/** | ||
* Handler for handling messages for RCE Deserialization challenge. | ||
*/ | ||
@RequiredArgsConstructor | ||
public class RceDeserializationHandler implements MessageHandler { | ||
private final RceDeserializationController controller; | ||
|
||
@Override | ||
public boolean supports(Message message) { | ||
return message instanceof TextMessage; | ||
} | ||
|
||
@Override | ||
public boolean handleMessage(Connection connection, Message message) { | ||
controller.setOutput(((TextMessage) message).getContent().getText()); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
vucsa-client/src/main/resources/fxml/challenge/rcedeserialization/RceDeserializationTab.fxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.control.Button?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.TextArea?> | ||
<?import javafx.scene.layout.AnchorPane?> | ||
<?import javafx.scene.layout.VBox?> | ||
|
||
<AnchorPane prefHeight="468.0" prefWidth="725.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1"> | ||
<children> | ||
<Label layoutX="14.0" layoutY="14.0" styleClass="h1" text="Remote Code Execution - Deserialization" AnchorPane.leftAnchor="10.0" AnchorPane.topAnchor="10.0" /> | ||
<Label layoutX="14.0" layoutY="14.0" text="Try to exploit this vulnerable Java deserialization!" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="35.0" /> | ||
<VBox layoutX="-1.0" layoutY="257.0" prefHeight="200.0" prefWidth="267.0" spacing="10.0" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="65.0"> | ||
<children> | ||
<Label styleClass="input-label" text="Input:" /> | ||
<TextArea fx:id="dataInput" prefHeight="198.0" prefWidth="564.0" VBox.vgrow="ALWAYS" /> | ||
<Label styleClass="input-label" text="Output:" /> | ||
<TextArea fx:id="dataOutput" prefHeight="198.0" prefWidth="564.0" VBox.vgrow="ALWAYS" /> | ||
</children> | ||
</VBox> | ||
<Button alignment="CENTER" contentDisplay="CENTER" layoutX="635.0" layoutY="23.0" mnemonicParsing="false" onAction="#onSendClick" prefHeight="25.0" prefWidth="80.0" text="Send" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="59.0" /> | ||
</children> | ||
</AnchorPane> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.