Xeno-rat
Loading...
Searching...
No Matches
xeno_rat_client.Handler Class Reference
Collaboration diagram for xeno_rat_client.Handler:

Public Member Functions

 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.
 

Private Member Functions

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.
 

Private Attributes

Node Main
 
DllHandler dllhandler
 

Constructor & Destructor Documentation

◆ Handler()

xeno_rat_client.Handler.Handler ( Node _Main,
DllHandler _dllhandler )
inline

Member Function Documentation

◆ CreateSubSock()

async Task xeno_rat_client.Handler.CreateSubSock ( byte[] data)
inline

Asynchronously creates a sub socket based on the provided data.

Parameters
dataThe byte array containing the necessary data for creating the sub socket.
Exceptions
IndexOutOfRangeExceptionThrown 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
subServerThe node representing the sub-server.
dataThe 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAndSendInfo()

async Task xeno_rat_client.Handler.GetAndSendInfo ( Node Type0)
inlineprivate

Asynchronously gets hardware information and sends it to the specified node.

Parameters
Type0The node to which the information will be sent.
Exceptions
ArgumentNullExceptionThrown 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnDisconnect()

void xeno_rat_client.Handler.OnDisconnect ( Node SubNode)
inlineprivate

Event handler for the disconnect event of a node.

Parameters
SubNodeThe node that has been disconnected.
Here is the caller graph for this function:

◆ SendUpdateInfo()

async Task xeno_rat_client.Handler.SendUpdateInfo ( Node node)
inline

Sends update information to the specified node asynchronously.

Parameters
nodeThe node to which the update information is to be sent.
Exceptions
ArgumentNullExceptionThrown 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSetId()

async Task xeno_rat_client.Handler.setSetId ( Node subServer,
byte[] data )
inlineprivate

Sets the ID of the subServer using the provided data.

Parameters
subServerThe subServer for which the ID is to be set.
dataThe data containing the ID information.
Exceptions
ArgumentNullExceptionThrown 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
ExceptionThrown when an error occurs during the data reception or processing.
Returns
A task representing the asynchronous operation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
subServerThe subServer node to receive heartbeat messages from.
Exceptions
TimeoutExceptionThrown 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
subServerThe node from which data is received.
Exceptions
ExceptionThrown 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.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ dllhandler

DllHandler xeno_rat_client.Handler.dllhandler
private

◆ Main

Node xeno_rat_client.Handler.Main
private

The documentation for this class was generated from the following file: