|
| Handler (Node _Main, DllHandler _dllhandler) |
|
async Task | CreateSubSock (byte[] data) |
| Asynchronously creates a sub socket based on the provided data.
|
|
async Task | Type0Receive () |
| Asynchronously receives data and performs different actions based on the received opcode.
|
|
async Task | Type1Receive (Node subServer) |
| Asynchronously receives heartbeat messages from the specified subServer and sends a heartbeat reply if the received message is valid.
|
|
async Task | Type2Receive (Node subServer) |
| Asynchronously receives data from the specified subServer node and processes it based on the received opcode.
|
|
async Task | DebugMenu (Node subServer, byte[] data) |
| Handles debug menu operations based on the provided opcode and data.
|
|
async Task | SendUpdateInfo (Node node) |
| Sends update information to the specified node asynchronously.
|
|
|
void | OnDisconnect (Node SubNode) |
| Event handler for the disconnect event of a node.
|
|
async Task | GetAndSendInfo (Node Type0) |
| Asynchronously gets hardware information and sends it to the specified node.
|
|
async Task | setSetId (Node subServer, byte[] data) |
| Sets the ID of the subServer using the provided data.
|
|
◆ Handler()
xeno_rat_client.Handler.Handler |
( |
Node | _Main, |
|
|
DllHandler | _dllhandler ) |
|
inline |
◆ CreateSubSock()
async Task xeno_rat_client.Handler.CreateSubSock |
( |
byte[] | data | ) |
|
|
inline |
Asynchronously creates a sub socket based on the provided data.
- Parameters
-
data | The byte array containing the necessary data for creating the sub socket. |
- Exceptions
-
IndexOutOfRangeException | Thrown when the data array does not contain the required elements. |
- Returns
- A task representing the asynchronous operation.
This method attempts to create a sub socket based on the provided data. It extracts the type and return ID from the data array and then connects to the main socket to create the sub socket. Once the sub socket is created, it is associated with the main socket and added as a sub node. Depending on the type of sub socket, it then proceeds to handle the receive operation accordingly. If the sub socket type is not recognized or if the sub socket is null, it is disconnected.
◆ DebugMenu()
async Task xeno_rat_client.Handler.DebugMenu |
( |
Node | subServer, |
|
|
byte[] | data ) |
|
inline |
Handles debug menu operations based on the provided opcode and data.
- Parameters
-
subServer | The node representing the sub-server. |
data | The byte array containing the data for the debug menu operation. |
- Returns
- A task representing the asynchronous operation.
This method processes the debug menu operations based on the provided opcode and data. The opcode determines the specific operation to be performed, such as retrieving DLLs, unloading a DLL, or obtaining the console log.
◆ GetAndSendInfo()
async Task xeno_rat_client.Handler.GetAndSendInfo |
( |
Node | Type0 | ) |
|
|
inlineprivate |
Asynchronously gets hardware information and sends it to the specified node.
- Parameters
-
Type0 | The node to which the information will be sent. |
- Exceptions
-
ArgumentNullException | Thrown when Type0 is null. |
- Returns
- An asynchronous task representing the operation.
This method retrieves hardware information such as HWID, username, client version, Windows version, antivirus information, and admin status. The hardware information is then sent to the specified node after encoding and concatenation.
◆ OnDisconnect()
void xeno_rat_client.Handler.OnDisconnect |
( |
Node | SubNode | ) |
|
|
inlineprivate |
Event handler for the disconnect event of a node.
- Parameters
-
SubNode | The node that has been disconnected. |
◆ SendUpdateInfo()
async Task xeno_rat_client.Handler.SendUpdateInfo |
( |
Node | node | ) |
|
|
inline |
Sends update information to the specified node asynchronously.
- Parameters
-
node | The node to which the update information is to be sent. |
- Exceptions
-
ArgumentNullException | Thrown when the node is null. |
- Returns
- A task representing the asynchronous operation.
This method retrieves the caption of the active window using Utils.GetCaptionOfActiveWindowAsync and the idle time using Utils.GetIdleTimeAsync. It then concatenates the window caption and idle time, converts it to UTF-8 encoded byte array, and sends it to the specified node using Node.SendAsync.
◆ setSetId()
async Task xeno_rat_client.Handler.setSetId |
( |
Node | subServer, |
|
|
byte[] | data ) |
|
inlineprivate |
Sets the ID of the subServer using the provided data.
- Parameters
-
subServer | The subServer for which the ID is to be set. |
data | The data containing the ID information. |
- Exceptions
-
ArgumentNullException | Thrown when subServer is null. |
- Returns
- An asynchronous task representing the setting of the ID.
This method sets the ID of the subServer using the provided data. It first converts a portion of the data to an integer using the BytesToInt method of the subServer's socket, and then sets this value as the ID of the subServer. After setting the ID, it sends a byte array containing a single byte (value 1) to the subServer using the SendAsync method, and awaits the completion of this operation.
◆ Type0Receive()
async Task xeno_rat_client.Handler.Type0Receive |
( |
| ) |
|
|
inline |
Asynchronously receives data and performs different actions based on the received opcode.
This method continuously receives data while the main connection is active. It processes the received opcode and performs different actions based on the opcode value. The method handles opcodes 0 to 4, where each opcode triggers a specific action:
- Opcode 0: Creates a sub-socket based on the received data.
- Opcode 1: Gets and sends information asynchronously.
- Opcode 2: Terminates the current process.
- Opcode 3: Restarts the application by starting a new process and terminating the current one.
- Opcode 4: Uninstalls the application using utility methods.
- Exceptions
-
Exception | Thrown when an error occurs during the data reception or processing. |
- Returns
- A task representing the asynchronous operation.
◆ Type1Receive()
async Task xeno_rat_client.Handler.Type1Receive |
( |
Node | subServer | ) |
|
|
inline |
Asynchronously receives heartbeat messages from the specified subServer and sends a heartbeat reply if the received message is valid.
- Parameters
-
subServer | The subServer node to receive heartbeat messages from. |
- Exceptions
-
TimeoutException | Thrown when the receive operation times out after 5000 milliseconds. |
- Returns
- A task representing the asynchronous operation.
This method sets a receive timeout of 5000 milliseconds on the subServer and continuously receives data from it while the subServer is connected and the main server is also connected. If no data is received within the timeout period, the method breaks the loop and exits. Upon receiving data, the method checks for a specific opcode in the received message and sends a heartbeat reply or failure message accordingly. After the loop exits, the method disconnects both the main server and the subServer.
◆ Type2Receive()
async Task xeno_rat_client.Handler.Type2Receive |
( |
Node | subServer | ) |
|
|
inline |
Asynchronously receives data from the specified subServer node and processes it based on the received opcode.
- Parameters
-
subServer | The node from which data is received. |
- Exceptions
-
Exception | Thrown when an error occurs during the data receiving process. |
- Returns
- A task representing the asynchronous operation.
This method continuously receives data from the specified subServer node and processes it based on the received opcode. The method checks for the connection status of both the subServer and the main server before processing the received data. If the received data is null, the method breaks the loop and stops receiving further data. The method then extracts the opcode from the received data and performs different actions based on the opcode value. If the opcode is 0, it sends an update info to the subServer. If the opcode is 1, it processes the data using the DllNodeHandler method from dllhandler. If the opcode is 2, it sets the ID for the subServer using the received data. If the opcode is 3, the method returns from the current execution context. If the opcode is 4, it triggers the DebugMenu method to process the received data. Once all processing is complete, the method disconnects the subServer node.
◆ dllhandler
◆ Main
Node xeno_rat_client.Handler.Main |
|
private |
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/xeno rat client/Handler.cs