Xkill [Original]
Author:r&s
e-mail: [Email protected]
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: [email protected]");
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 (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 (), 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 (), 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 [Original]
Author:r&s
e-mail: [Email protected]
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: [email protected]");
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 (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 (), 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 (), 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 # version Avira local/remote process tools