Xeno-rat
|
Classes | |
struct | LASTINPUTINFO |
Static Public Member Functions | |
static async Task< string > | GetCaptionOfActiveWindowAsync () |
Retrieves the caption of the active window asynchronously. | |
static string | GetCaptionOfActiveWindow () |
Retrieves the caption of the active window. | |
static bool | IsAdmin () |
Checks if the current user is an admin and returns a boolean value indicating the result. | |
static string | GetAntivirus () |
Retrieves the installed antivirus products on the local machine and returns a comma-separated list of the product names. | |
static string | GetWindowsVersion () |
Retrieves the Windows version and architecture information. | |
static string | HWID () |
Generates a unique hardware identifier (HWID) based on various system parameters. | |
static string | GetHash (string strToHash) |
Computes the MD5 hash of the input string and returns the first 20 characters in uppercase. | |
static async Task< Node > | ConnectAndSetupAsync (Socket sock, byte[] key, int type=0, int ID=0, Action< Node > OnDisconnect=null) |
Connects to a socket, sets up a node, and authenticates it asynchronously. | |
static async Task | RemoveStartup (string executablePath) |
Removes any startup entries related to the specified executable path. | |
static async Task | Uninstall () |
Uninstalls the application by removing it from startup, executing a command to delete the application file, and then terminating the current process. | |
static async Task< bool > | AddToStartupNonAdmin (string executablePath, string name="XenoUpdateManager") |
Adds the specified executable to the current user's startup registry without requiring admin privileges. | |
static async Task< bool > | AddToStartupAdmin (string executablePath, string name="XenoUpdateManager") |
Adds the specified executable to the Windows startup for all users and returns a boolean indicating whether the operation was successful. | |
static async Task< uint > | GetIdleTimeAsync () |
Asynchronously retrieves the system's idle time in milliseconds. | |
static uint | GetIdleTime () |
Retrieves the number of milliseconds that have elapsed since the last input event (keyboard or mouse) was received. | |
Private Member Functions | |
static bool | IsUserAnAdmin () |
Determines whether the current user is a member of the administrator group. | |
static IntPtr | GetForegroundWindow () |
Retrieves a handle to the foreground window (the window with which the user is currently working). | |
static int | GetWindowText (IntPtr hWnd, StringBuilder text, int count) |
Retrieves the text of the specified window's title bar, if it has one. | |
static int | GetWindowTextLength (IntPtr hWnd) |
Retrieves the length, in characters, of the specified window's title bar text (if it has one). If the specified window is a control, the function retrieves the length of the text within the control. | |
static IntPtr | GetWindowThreadProcessId (IntPtr hWnd, out uint ProcessId) |
Retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window. | |
static bool | GetLastInputInfo (ref LASTINPUTINFO plii) |
Retrieves the time of the last input event. | |
static bool | CloseHandle (IntPtr hObject) |
Closes an open object handle. | |
|
inlinestatic |
Adds the specified executable to the Windows startup for all users and returns a boolean indicating whether the operation was successful.
executablePath | The full path to the executable file to be added to the startup. |
name | The name of the task to be created in the Windows Task Scheduler. Default is "XenoUpdateManager". |
true
if the task was created successfully; otherwise, false
.System.Exception | Thrown if an error occurs while attempting to add the task to the Windows Task Scheduler. |
|
inlinestatic |
Adds the specified executable to the current user's startup registry without requiring admin privileges.
executablePath | The full path to the executable file to be added to the startup. |
name | The name under which the executable will be added to the startup (default is "XenoUpdateManager"). |
true
if the operation was successful; otherwise, false
.System.Security.SecurityException | Thrown when the user does not have permission to access the registry key. |
|
private |
Closes an open object handle.
hObject | A handle to an open object. |
This method closes an open object handle. If the function succeeds, the return value is true. If the function fails, the return value is false.
|
inlinestatic |
Connects to a socket, sets up a node, and authenticates it asynchronously.
sock | The socket to connect to. |
key | The byte array key for authentication. |
type | The type of authentication (default is 0). |
ID | The ID for authentication (default is 0). |
OnDisconnect | An action to be performed on disconnection (default is null). |
This method connects to the specified socket, creates a new node with the provided socket handler and disconnection action. It then attempts to authenticate the node asynchronously with the specified type and ID. If the authentication is successful, the authenticated node is returned; otherwise, null is returned.
|
inlinestatic |
Retrieves the installed antivirus products on the local machine and returns a comma-separated list of the product names.
System.Exception | An exception may be thrown if there is an issue retrieving the antivirus products. |
|
inlinestatic |
Retrieves the caption of the active window.
This method retrieves the caption of the active window by obtaining the handle of the foreground window and using it to get the window text. It then retrieves the process ID associated with the window handle and uses it to get the process information, which is used to construct the caption. If the window title is empty, only the process name is used as the caption; otherwise, the process name is appended with the window title.
|
inlinestatic |
Retrieves the caption of the active window asynchronously.
This method asynchronously retrieves the caption of the active window by executing the GetCaptionOfActiveWindow method within a separate task.
|
private |
Retrieves a handle to the foreground window (the window with which the user is currently working).
This method retrieves a handle to the foreground window, which is the window that the user is currently interacting with. The handle can be used to perform various operations on the window, such as sending messages or modifying its properties.
|
inlinestatic |
Computes the MD5 hash of the input string and returns the first 20 characters in uppercase.
strToHash | The input string to be hashed. |
This method computes the MD5 hash of the input string using the MD5CryptoServiceProvider class. It then converts the hash bytes to a hexadecimal string and truncates it to 20 characters. The resulting hash is returned in uppercase.
|
inlinestatic |
Retrieves the number of milliseconds that have elapsed since the last input event (keyboard or mouse) was received.
This method retrieves the idle time by using the GetLastInputInfo function to obtain the time of the last input event and then calculates the difference between the current time and the last input time to determine the idle time.
|
inlinestatic |
Asynchronously retrieves the system's idle time in milliseconds.
This method asynchronously retrieves the system's idle time by running the GetIdleTime method in a separate task.
|
private |
Retrieves the time of the last input event.
plii | A reference to a LASTINPUTINFO structure that receives the time of the last input event. |
This method retrieves the time (in milliseconds) of the last input event. The input events include keyboard and mouse input.
|
inlinestatic |
Retrieves the Windows version and architecture information.
This method retrieves the Windows version and architecture information using WMI (Windows Management Instrumentation). It queries the Win32_OperatingSystem class to obtain the necessary information. The method returns a string containing the Windows version and architecture details.
|
private |
Retrieves the text of the specified window's title bar, if it has one.
hWnd | A handle to the window or control containing the text. |
text | The buffer that will receive the text. |
count | The maximum number of characters to copy to the buffer, including the null-terminating character. |
|
private |
Retrieves the length, in characters, of the specified window's title bar text (if it has one). If the specified window is a control, the function retrieves the length of the text within the control.
hWnd | A handle to the window or control. |
Win32Exception | Thrown when an error occurs while retrieving the window's title bar text length. |
|
private |
Retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window.
hWnd | A handle to the window. |
ProcessId | When this method returns, contains the identifier of the process that created the window. |
|
inlinestatic |
Generates a unique hardware identifier (HWID) based on various system parameters.
This method combines various system parameters such as processor count, user name, machine name, operating system version, and total size of the system drive to create a unique hardware identifier (HWID). The method uses a hashing function to generate the HWID and returns it as a string. If any exception occurs during the generation process, the method returns "UNKNOWN" to indicate that the HWID could not be generated accurately.
|
inlinestatic |
Checks if the current user is an admin and returns a boolean value indicating the result.
This method internally calls the IsUserAnAdmin method to determine if the current user has admin privileges. If an exception occurs during the check, the method returns false.
|
private |
Determines whether the current user is a member of the administrator group.
|
inlinestatic |
Removes any startup entries related to the specified executable path.
executablePath | The path of the executable for which startup entries need to be removed. |
System.Security.SecurityException | The caller does not have the required permission. |
System.InvalidOperationException | The schtasks.exe process is already running. |
System.ComponentModel.Win32Exception | An error occurred when accessing the native Windows API. |
This method removes any startup entries related to the specified executable path from the system's startup configurations. It first checks for scheduled tasks using schtasks.exe and deletes any task that runs the specified executable. Then, it checks the registry for any startup entries and removes them if they match the specified executable path.
|
inlinestatic |
Uninstalls the application by removing it from startup, executing a command to delete the application file, and then terminating the current process.
This method removes the application from the startup, deletes the application file using a command executed in a hidden command prompt window, and then terminates the current process.