批处理检查电脑是否中了冰河木马
生活随笔
收集整理的这篇文章主要介绍了
批处理检查电脑是否中了冰河木马
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
批处理如下;
@echo off netstat -a -n > a.txt type a.txt | find "7626" && echo "Congratulations! You have infected GLACIER!" del a.txt pause & exit功能主要是检查7626端口是否被占用;如占用,则提示电脑感染了冰河木马;7626是冰河木马的默认端口;
运行一下;没有中木马;
批处理主要是检查端口占用情况,然后输出到一个文本文件,然后中文本文件中查找字符串"7626";如果找到7626,则提示中木马;运行完之后硬盘上并没有输出的文本文件,因为下一句语句删除了该文本文件;
下面来自己写一个程序,程序打开7626端口;
using System; using System.Text; using System.Collections.Generic; using System.Net; using System.Net.Sockets;class Program {static void Main(string[] args){string host = "127.0.0.1";//定义了一个服务器主机号int port = 7626;//端口号IPAddress ip = IPAddress.Parse(host);//获取服务器IpIPEndPoint endPoint = new IPEndPoint(ip, port);//定义EndPoint对象Socket socket1 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);//定义一个socket对象socket1.Bind(endPoint);//绑定endpoint对象socket1.Listen(0);//监听Console.WriteLine("建立连接:");Socket tempSocket = socket1.Accept();//创建一个新的socket用于与客户端通信string strReceive = "";Byte[] receiveBytes = new Byte[1024];int ibyte = tempSocket.Receive(receiveBytes, receiveBytes.Length, 0);//接受信息strReceive += Encoding.ASCII.GetString(receiveBytes, 0, ibyte);Console.WriteLine("接受来自客户端的信息为:" + strReceive);string strSend = "Successful";Byte[] SendBytes = Encoding.ASCII.GetBytes(strSend);//发送成功响应tempSocket.Send(SendBytes, 0);tempSocket.Close();//关闭套接字socket1.Close();Console.ReadLine();} }运行此程序;
然后再运行批处理,则提示如下;
总结
以上是生活随笔为你收集整理的批处理检查电脑是否中了冰河木马的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 附加到IIS进程调试页面
- 下一篇: 首次使用Windbg调试dNet程序