xkill [原创]

Author: R&S

E-mail: yrwithsh@vip.sina.com

HomePage: fz5fz.yeah.net

Date: 10/04/2003

using System;

using System.Management;

using System.Threading;

class xkill

{

public static void usage()

{

Console.WriteLine();

Console.WriteLine("xkill v1.0 Beta, By R&S");

Console.WriteLine("E-mail: yrwithsh@vip.sina.com");

Console.WriteLine("H-Page: Http://fz5fz.yeah.net");

Console.WriteLine();

Console.WriteLine("Usage:  xkill [ip] [account] [password] [programme] [time(s)]");

Console.WriteLine("If its the localhost,dont need account and password");

Console.WriteLine("Example: xkill 218.194.X.X administrator 123 qq.exe 60");

Console.WriteLine("         xkill 218.194.X.X administrator NULL qq.exe 60");

Console.WriteLine("         xkill 127.0.0.1 qq.exe 60 (for localhost)");

}

public static void Main(string[] args)

{

if((args.Length!=5)&&(args.Length!=3))

{

usage();

Environment.Exit(0);

}

while((args[0]=="127.0.0.1")││(args[0]=="192.168.0.1"))

{

string KillName=args[1];

ManagementObjectSearcher link = new ManagementObjectSearcher("SELECT * From Win32_Process");

ManagementObjectCollection Collection = link.Get();

foreach (ManagementObject Process in Collection)

{

Console.WriteLine("{0} {1}",Convert.ToString(Process["Name"]).PadRight(15),Process["ExecutablePath"]);

if (Convert.ToString(Process["Name"])==KillName)

{

string[] Tparas = {"1"};

Process.InvokeMethod("Terminate", Tparas);

}

}

Console.WriteLine();

Console.WriteLine("Terminate it yet");

Thread.Sleep(Convert.ToInt32(args[2])*1000);

}

try{

do

{

string KillName=args[3];

ConnectionOptions Conn = new ConnectionOptions();

Conn.Username =args[1];

if(args[2]=="NULL")

{

Conn.Password ="";

}

else Conn.Password =args[2];

ManagementPath p = new ManagementPath("\\"+args[0]+"\root\cimv2");

ManagementScope ms = new ManagementScope(p,Conn);

ObjectQuery oq = new ObjectQuery("SELECT * FROM Win32_Process");

ManagementObjectSearcher link = new ManagementObjectSearcher(ms,oq);

ManagementObjectCollection Collection = link.Get();

Console.WriteLine("--------------------------------------------------------");

foreach (ManagementObject Process in Collection)

{

Console.WriteLine("{0}{1}",Convert.ToString(Process["Name"]).PadRight(15),Process["ExecutablePath"]);

if (Convert.ToString(Process["Name"])==KillName)

{

string[] Tparas = {"1"};

Process.InvokeMethod("Terminate", Tparas);

}

}

Thread.Sleep(Convert.ToInt32(args[4])*1000);

}while(true);

}

catch(Exception exObj)

{

Console.WriteLine();

Console.WriteLine("failed!");

Console.WriteLine(exObj.Message);

}

}

}

xkill [原创]

Author: R&S

E-mail: yrwithsh@vip.sina.com

HomePage: fz5fz.yeah.net

Date: 10/04/2003

using System;

using System.Management;

using System.Threading;

class xkill

{

public static void usage()

{

Console.WriteLine();

Console.WriteLine("xkill v1.0 Beta, By R&S");

Console.WriteLine("E-mail: yrwithsh@vip.sina.com");

Console.WriteLine("H-Page: Http://fz5fz.yeah.net");

Console.WriteLine();

Console.WriteLine("Usage:  xkill [ip] [account] [password] [programme] [time(s)]");

Console.WriteLine("If its the localhost,dont need account and password");

Console.WriteLine("Example: xkill 218.194.X.X administrator 123 qq.exe 60");

Console.WriteLine("         xkill 218.194.X.X administrator NULL qq.exe 60");

Console.WriteLine("         xkill 127.0.0.1 qq.exe 60 (for localhost)");

}

public static void Main(string[] args)

{

if((args.Length!=5)&&(args.Length!=3))

{

usage();

Environment.Exit(0);

}

while((args[0]=="127.0.0.1")││(args[0]=="192.168.0.1"))

{

string KillName=args[1];

ManagementObjectSearcher link = new ManagementObjectSearcher("SELECT * From Win32_Process");

ManagementObjectCollection Collection = link.Get();

foreach (ManagementObject Process in Collection)

{

Console.WriteLine("{0} {1}",Convert.ToString(Process["Name"]).PadRight(15),Process["ExecutablePath"]);

if (Convert.ToString(Process["Name"])==KillName)

{

string[] Tparas = {"1"};

Process.InvokeMethod("Terminate", Tparas);

}

}

Console.WriteLine();

Console.WriteLine("Terminate it yet");

Thread.Sleep(Convert.ToInt32(args[2])*1000);

}

try{

do

{

string KillName=args[3];

ConnectionOptions Conn = new ConnectionOptions();

Conn.Username =args[1];

if(args[2]=="NULL")

{

Conn.Password ="";

}

else Conn.Password =args[2];

ManagementPath p = new ManagementPath("\\"+args[0]+"\root\cimv2");

ManagementScope ms = new ManagementScope(p,Conn);

ObjectQuery oq = new ObjectQuery("SELECT * FROM Win32_Process");

ManagementObjectSearcher link = new ManagementObjectSearcher(ms,oq);

ManagementObjectCollection Collection = link.Get();

Console.WriteLine("--------------------------------------------------------");

foreach (ManagementObject Process in Collection)

{

Console.WriteLine("{0}{1}",Convert.ToString(Process["Name"]).PadRight(15),Process["ExecutablePath"]);

if (Convert.ToString(Process["Name"])==KillName)

{

string[] Tparas = {"1"};

Process.InvokeMethod("Terminate", Tparas);

}

}

Thread.Sleep(Convert.ToInt32(args[4])*1000);

}while(true);

}

catch(Exception exObj)

{

Console.WriteLine();

Console.WriteLine("failed!");

Console.WriteLine(exObj.Message);

}

}

}

C#版查杀本地/远程进程工具的更多相关文章

  1. 查杀进程小工具——WPF和MVVM初体验

    最近因为工作需要,研究了一下桌面应用程序.在winform.WPF.Electron等几种技术里,最终选择了WPF作为最后的选型.WPF最吸引我的地方,就是MVVM模式了.MVVM模式完全把界面和业务 ...

  2. linux下python版webshell后门查杀工具

    使用说明: 1.查杀指定路径:python webshell.py 路径 2.按时间查找文件:python webshell.py 路径 “2013-09-28 00:00:00″ # -*- cod ...

  3. 病毒木马查杀实战第017篇:U盘病毒之专杀工具的编写

    前言 经过前几次的讨论,我们对于这次的U盘病毒已经有了一定的了解,那么这次我们就依据病毒的行为特征,来编写针对于这次U盘病毒的专杀工具. 专杀工具功能说明 因为这次是一个U盘病毒,所以我打算把这次的专 ...

  4. 病毒木马查杀实战第011篇:QQ盗号木马之专杀工具的编写

    前言 由于我已经在<病毒木马查杀第004篇:熊猫烧香之专杀工具的编写>中编写了一个比较通用的专杀工具的框架,而这个框架对于本病毒来说,经过简单修改也是基本适用的,所以本文就不讨论那些重叠的 ...

  5. Linux 僵尸进程查杀

    僵尸进程概念 僵尸进程(Zombie process)通俗来说指那些虽然已经终止的进程,但仍然保留一些信息,等待其父进程为其收尸. 书面形式一点:一个进程结束了,但是他的父进程没有等待(调用wait ...

  6. shell脚本执行查找进程,然后查杀进程

    shell 执行查找进程,然后查杀进程脚本如下: ps -ef | grep 'IOE' |grep -v 'grep'| awk '{print \$2}' |while read pid; do ...

  7. windows查看端口占用情况及查杀进程

    我们平时在做web开发运行web服务器或运行某个应用时会报错,提示该应用的端口号已被占用,我们可以用以下的方法解决. 解决方法一:重新为应用配置端口. 解决方法二:找到占用端口的应用并关闭该应用释放占 ...

  8. Linux 僵尸进程的筛选和查杀

    一.筛选 ps -A -o stat,ppid,pid,cmd | grep -e '^[Zz]' 二.查杀 ps -A -o stat,ppid,pid,cmd | grep -e '^[Zz]' ...

  9. db2 查杀死锁进程

    db2 查杀死锁进命令 db2 get snapshot for locks on (需要snapshot的访问权限) db2 list applications db2 "force ap ...

随机推荐

  1. 传递 hdu 5961 拓扑排序有无环~

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=5961 题目为中文,这里就不描述题意了. 思路: 从题目陈述来看,他将一个有向图用一个邻接矩阵来表示,并且分 ...

  2. Kubernetes网络模型概念

    Kubernetes网络模型 Kubernetes网络模型设计的一个基础原则是:每个Pod都拥有一个独立的IP地址,而且假定所有Pod都在一个可以直接连通的.扁平的网络空间中.所以不管它们是否运行在同 ...

  3. Django一些开发经验

    总结一些 Django 开发的小经验.先说一些最最基础的吧. 使用 virtualenv 隔离开发环境 使用 pip 管理项目依赖,主要就是一个小技巧,使用 pip freeze > requi ...

  4. 机器学习之路:python线性回归分类器 LogisticRegression SGDClassifier 进行良恶性肿瘤分类预测

    使用python3 学习了线性回归的api 分别使用逻辑斯蒂回归  和   随机参数估计回归 对良恶性肿瘤进行预测 我把数据集下载到了本地,可以来我的git下载源代码和数据集:https://gith ...

  5. Linux驱动之PCI

    <背景> PCI设备有许多地址配置的寄存器,初始化时这寄存器来配置设备的总线地址,配置好后CPU就可以访问该设备的各项资源了.(提炼:配置总线地址)   <配置寄存器>   ( ...

  6. BZOJ 2959: 长跑 lct 双联通分量 并查集 splay

    http://www.lydsy.com/JudgeOnline/problem.php?id=2959 用两个并查集维护双联通分量的编号和合并. #include<iostream> # ...

  7. Codeforces Round #361 (Div. 2) E. Mike and Geometry Problem 离散化 排列组合

    E. Mike and Geometry Problem 题目连接: http://www.codeforces.com/contest/689/problem/E Description Mike ...

  8. SpringMVC 方法参数设置

    /** 在方法中配置参数: (1) 内置对象配置: request:获取cookie.请求头... 获取项目根路径 request.getContextPath() response:用于ajax的输 ...

  9. android下前端开发诡异bug记录&解决方法

    1.border-radius有bug,围不住background 描述:设置了border-radius后,背景色依然会从圆角里冒出来 解决方法:在设置了border-radius的容器加上back ...

  10. ios 得到目录大小 进率是1000

    - (CGFloat)folderSizeAtPath:(NSString *) folderPath {     NSFileManager * manager = [NSFileManager d ...