Xeno-rat
Loading...
Searching...
No Matches
xeno_rat_server.Forms.OfflineKeylogger Class Reference
Inheritance diagram for xeno_rat_server.Forms.OfflineKeylogger:
Collaboration diagram for xeno_rat_server.Forms.OfflineKeylogger:

Public Member Functions

 OfflineKeylogger (Node _client)
 
string Normalize (string input)
 Replaces the placeholders [enter] and [space] in the input string with the corresponding newline and space characters, respectively, and returns the modified string.
 

Protected Member Functions

override void Dispose (bool disposing)
 Releases the unmanaged resources used by the Component and optionally releases the managed resources.
 

Private Member Functions

void OnTempDisconnect (Node node)
 Handles the event of temporary disconnection of a node.
 
async Task< bool > IsStarted ()
 Checks if the client is started and returns a boolean value indicating the status.
 
async Task InitializeAsync ()
 Asynchronously initializes the object by receiving data from the client and updating the status.
 
async Task StartKeylogger ()
 Starts the keylogger by sending a byte array with value 1 to the client asynchronously.
 
async Task StopKeylogger ()
 Stops the keylogger by sending a byte array with value 2 to the client asynchronously.
 
async Task< Dictionary< string, string > > GetKeylogs ()
 Asynchronously retrieves keylogs from the client and returns them as a dictionary.
 
async Task UpdateStatus ()
 Updates the status and displays it on the label.
 
void OfflineKeylogger_Load (object sender, EventArgs e)
 Event handler for the form load event.
 
void listView1_ItemActivate (object sender, EventArgs e)
 Handles the event when an item in the list view is activated.
 
async void button1_Click (object sender, EventArgs e)
 Starts the keylogger and updates the status.
 
async void button2_Click (object sender, EventArgs e)
 Stops the keylogger and updates the status asynchronously.
 
async void button3_Click (object sender, EventArgs e)
 Updates the status and retrieves keylogs, then populates the UI with the retrieved data.
 
void InitializeComponent ()
 Initializes the components of the form including labels, text boxes, list view, and buttons.
 

Static Private Member Functions

static Dictionary< string, string > ConvertBytesToDictionary (byte[] data, int offset)
 Converts a byte array to a dictionary of strings using null-terminated strings as keys and values.
 

Private Attributes

Node client
 
bool started = false
 
Dictionary< string, string > applications = new Dictionary<string, string>()
 
System.ComponentModel.IContainer components = null
 Required designer variable.
 
System.Windows.Forms.Label label2
 
System.Windows.Forms.Label label1
 
System.Windows.Forms.TextBox textBox1
 
System.Windows.Forms.ListView listView1
 
System.Windows.Forms.ColumnHeader columnHeader1
 
System.Windows.Forms.Label label3
 
System.Windows.Forms.Button button1
 
System.Windows.Forms.Button button2
 
System.Windows.Forms.Button button3
 

Constructor & Destructor Documentation

◆ OfflineKeylogger()

xeno_rat_server.Forms.OfflineKeylogger.OfflineKeylogger ( Node _client)
inline
Here is the call graph for this function:

Member Function Documentation

◆ button1_Click()

async void xeno_rat_server.Forms.OfflineKeylogger.button1_Click ( object sender,
EventArgs e )
inlineprivate

Starts the keylogger and updates the status.

This method asynchronously starts the keylogger and updates the status.

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

◆ button2_Click()

async void xeno_rat_server.Forms.OfflineKeylogger.button2_Click ( object sender,
EventArgs e )
inlineprivate

Stops the keylogger and updates the status asynchronously.

This method asynchronously stops the keylogger and updates the status.

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

◆ button3_Click()

async void xeno_rat_server.Forms.OfflineKeylogger.button3_Click ( object sender,
EventArgs e )
inlineprivate

Updates the status and retrieves keylogs, then populates the UI with the retrieved data.

This method asynchronously updates the status and retrieves keylogs. If no keylogs are retrieved, the method returns without populating the UI. If keylogs are retrieved, the method populates the UI with the retrieved data.

Exceptions
ExceptionThrown when an error occurs while updating the status or retrieving keylogs.
Returns
No explicit return value.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConvertBytesToDictionary()

static Dictionary< string, string > xeno_rat_server.Forms.OfflineKeylogger.ConvertBytesToDictionary ( byte[] data,
int offset )
inlinestaticprivate

Converts a byte array to a dictionary of strings using null-terminated strings as keys and values.

Parameters
dataThe byte array to be converted.
offsetThe offset in the byte array from which to start the conversion.
Returns
A dictionary containing the key-value pairs extracted from the byte array.

This method iterates through the byte array starting from the specified offset, extracting null-terminated strings as keys and values for the dictionary. It uses a StringBuilder to accumulate the characters until a null terminator is encountered, indicating the end of a key or a value. The extracted key-value pairs are then added to the dictionary, and the method returns the resulting dictionary.

Here is the caller graph for this function:

◆ Dispose()

override void xeno_rat_server.Forms.OfflineKeylogger.Dispose ( bool disposing)
inlineprotected

Releases the unmanaged resources used by the Component and optionally releases the managed resources.

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.

This method releases the unmanaged resources used by the Component and optionally releases the managed resources. If disposing is true, this method releases all resources held by any managed objects that this Component references. This method is called by the public Dispose() method and the Finalize method.

◆ GetKeylogs()

async Task< Dictionary< string, string > > xeno_rat_server.Forms.OfflineKeylogger.GetKeylogs ( )
inlineprivate

Asynchronously retrieves keylogs from the client and returns them as a dictionary.

Returns
A dictionary containing the keylogs received from the client.

This method sends a byte array with the value 3 to the client using the SendAsync method of the client object. It then receives a byte array from the client using the ReceiveAsync method of the client object. If the received data is null, the method disconnects from the client and returns an empty dictionary. If an exception occurs during the conversion of the received byte array to a dictionary using the ConvertBytesToDictionary method, the method catches the exception and returns an empty dictionary.

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

◆ InitializeAsync()

async Task xeno_rat_server.Forms.OfflineKeylogger.InitializeAsync ( )
inlineprivate

Asynchronously initializes the object by receiving data from the client and updating the status.

This method asynchronously receives data from the client using the client and updates the status. If the received data is null, has a length not equal to 1, or the first element is not equal to 1, an error message is displayed. If the object is disposed, the method returns without further processing. If an error occurs during the process of displaying the error message and closing the object, it is caught and ignored.

Exceptions
System.ObjectDisposedExceptionThrown when the object is disposed.
Returns
A task representing the asynchronous operation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeComponent()

void xeno_rat_server.Forms.OfflineKeylogger.InitializeComponent ( )
inlineprivate

Initializes the components of the form including labels, text boxes, list view, and buttons.

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

◆ IsStarted()

async Task< bool > xeno_rat_server.Forms.OfflineKeylogger.IsStarted ( )
inlineprivate

Checks if the client is started and returns a boolean value indicating the status.

Returns
True if the client is started; otherwise, false.

This method sends a byte array with a single element of value 0 to the client using the SendAsync method. It then receives a byte array from the client using the ReceiveAsync method and checks if the received data is null or has a length different from 1. If the data does not meet the expected criteria, the method disconnects the client and returns false. Otherwise, it returns true if the first element of the received data is equal to 1.

Exceptions
System.InvalidOperationExceptionThrown when an asynchronous operation is not valid for the current state of the object.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ listView1_ItemActivate()

void xeno_rat_server.Forms.OfflineKeylogger.listView1_ItemActivate ( object sender,
EventArgs e )
inlineprivate

Handles the event when an item in the list view is activated.

Parameters
senderThe source of the event.
eAn EventArgs that contains the event data.

This method checks if any item is selected in the list view. If an item is selected, it retrieves the text from the first column of the selected item in the list view and sets the text of textBox1 to the normalized value of the corresponding application from the 'applications' dictionary.

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

◆ Normalize()

string xeno_rat_server.Forms.OfflineKeylogger.Normalize ( string input)
inline

Replaces the placeholders [enter] and [space] in the input string with the corresponding newline and space characters, respectively, and returns the modified string.

Parameters
inputThe input string containing placeholders to be replaced.
Returns
The modified string with placeholders replaced.
Here is the caller graph for this function:

◆ OfflineKeylogger_Load()

void xeno_rat_server.Forms.OfflineKeylogger.OfflineKeylogger_Load ( object sender,
EventArgs e )
inlineprivate

Event handler for the form load event.

Parameters
senderThe source of the event.
eAn EventArgs that contains the event data.
Here is the caller graph for this function:

◆ OnTempDisconnect()

void xeno_rat_server.Forms.OfflineKeylogger.OnTempDisconnect ( Node node)
inlineprivate

Handles the event of temporary disconnection of a node.

Parameters
nodeThe node that has been temporarily disconnected.

If the current object is disposed, the method returns without performing any action. Displays a message box with the text "Socket closed!". Invokes the Close method on the current object using Control.BeginInvoke(Delegate). Any exceptions that occur during the invocation are caught and ignored.

Here is the caller graph for this function:

◆ StartKeylogger()

async Task xeno_rat_server.Forms.OfflineKeylogger.StartKeylogger ( )
inlineprivate

Starts the keylogger by sending a byte array with value 1 to the client asynchronously.

Returns
A task representing the asynchronous operation.
Exceptions
ExceptionThrown when an error occurs while sending the byte array to the client.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StopKeylogger()

async Task xeno_rat_server.Forms.OfflineKeylogger.StopKeylogger ( )
inlineprivate

Stops the keylogger by sending a byte array with value 2 to the client asynchronously.

This method sends a byte array with value 2 to the client using an asynchronous operation to stop the keylogger.

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

◆ UpdateStatus()

async Task xeno_rat_server.Forms.OfflineKeylogger.UpdateStatus ( )
inlineprivate

Updates the status and displays it on the label.

This method asynchronously updates the status by calling the IsStarted method and then updates the label to display the current status.

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

Member Data Documentation

◆ applications

Dictionary<string, string> xeno_rat_server.Forms.OfflineKeylogger.applications = new Dictionary<string, string>()
private

◆ button1

System.Windows.Forms.Button xeno_rat_server.Forms.OfflineKeylogger.button1
private

◆ button2

System.Windows.Forms.Button xeno_rat_server.Forms.OfflineKeylogger.button2
private

◆ button3

System.Windows.Forms.Button xeno_rat_server.Forms.OfflineKeylogger.button3
private

◆ client

Node xeno_rat_server.Forms.OfflineKeylogger.client
private

◆ columnHeader1

System.Windows.Forms.ColumnHeader xeno_rat_server.Forms.OfflineKeylogger.columnHeader1
private

◆ components

System.ComponentModel.IContainer xeno_rat_server.Forms.OfflineKeylogger.components = null
private

Required designer variable.

◆ label1

System.Windows.Forms.Label xeno_rat_server.Forms.OfflineKeylogger.label1
private

◆ label2

System.Windows.Forms.Label xeno_rat_server.Forms.OfflineKeylogger.label2
private

◆ label3

System.Windows.Forms.Label xeno_rat_server.Forms.OfflineKeylogger.label3
private

◆ listView1

System.Windows.Forms.ListView xeno_rat_server.Forms.OfflineKeylogger.listView1
private

◆ started

bool xeno_rat_server.Forms.OfflineKeylogger.started = false
private

◆ textBox1

System.Windows.Forms.TextBox xeno_rat_server.Forms.OfflineKeylogger.textBox1
private

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