
批处理如下;
@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);//获取服务器Ip
IPEndPoint 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();
}
}
运行此程序;
然后再运行批处理,则提示如下;
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)