Analysis and Evaluation of the Windows Event Log - Bill Buchanan
Analysis and Evaluation of the Windows Event Log - Bill Buchanan
Analysis and Evaluation of the Windows Event Log - Bill Buchanan
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
C:\Documents <strong>and</strong> Settings\Barrie\My ...-aes\simpletcpclient2-aes\Program.cs<br />
using System;<br />
using System.Net;<br />
using System.Net.Sockets;<br />
using System.Text;<br />
using System.IO;<br />
using System.Diagnostics;<br />
using System.Security.Cryptography;<br />
using System.Text.RegularExpressions;<br />
using System.Security.Principal;<br />
1<br />
public class SimpleTcpClient<br />
{<br />
public static void Main()<br />
{<br />
GlobalClass.myCount = 0;<br />
GlobalClass.user = <strong>Windows</strong>Identity.GetCurrent().Name;<br />
Console.WriteLine("Enter a key");<br />
GlobalClass.key = Convert.ToString(Console.ReadLine());<br />
// Generate AES Keys<br />
AES.passPhrase = Generate(40, 60); // R<strong>and</strong>om Length between 40-60<br />
AES.saltValue = Generate(40, 60); // R<strong>and</strong>om Length between 40-60<br />
AES.hashAlgorithm = "SHA1";<br />
// can be "MD5"<br />
AES.passwordIterations = 2;<br />
// can be any number<br />
AES.initVector = Generate(16, 16); // RFixed Length <strong>of</strong> 16<br />
AES.keySize = 256; // can be 192 or 128<br />
// Connect to server<br />
connecttoserver();<br />
// Create a new FileSystemWatcher <strong>and</strong> set its properties.<br />
FileSystemWatcher watcher = new FileSystemWatcher();<br />
watcher.Path = "c:\\Test\\";<br />
watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite<br />
| NotifyFilters.FileName | NotifyFilters.DirectoryName;<br />
watcher.Filter = "*.*";<br />
watcher.IncludeSubdirectories = true;<br />
// Add event h<strong>and</strong>lers.<br />
watcher.Changed += new FileSystem<strong>Event</strong>H<strong>and</strong>ler(OnChanged);<br />
watcher.Created += new FileSystem<strong>Event</strong>H<strong>and</strong>ler(OnChanged);<br />
watcher.Deleted += new FileSystem<strong>Event</strong>H<strong>and</strong>ler(OnChanged);<br />
watcher.Renamed += new Renamed<strong>Event</strong>H<strong>and</strong>ler(OnRenamed);<br />
// Begin watching.<br />
watcher.InternalBufferSize = 131072; //128 KB<br />
watcher.EnableRaising<strong>Event</strong>s = true;<br />
// Create 2nd FileSystemWatcher <strong>and</strong> set its properties.<br />
FileSystemWatcher watcher2 = new FileSystemWatcher();<br />
watcher2.Path = "c:\\Test 2\\";<br />
watcher2.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite<br />
| NotifyFilters.FileName | NotifyFilters.DirectoryName;<br />
watcher.Filter = "*.*";<br />
watcher.IncludeSubdirectories = true;<br />
// Add event h<strong>and</strong>lers.<br />
watcher2.Changed += new FileSystem<strong>Event</strong>H<strong>and</strong>ler(OnChanged);<br />
watcher2.Created += new FileSystem<strong>Event</strong>H<strong>and</strong>ler(OnChanged);<br />
watcher2.Deleted += new FileSystem<strong>Event</strong>H<strong>and</strong>ler(OnChanged);<br />
watcher2.Renamed += new Renamed<strong>Event</strong>H<strong>and</strong>ler(OnRenamed);<br />
// Begin watching.<br />
watcher2.EnableRaising<strong>Event</strong>s = true;<br />
while (true)<br />
{<br />
Console.WriteLine("Enter message to send");<br />
string message = Convert.ToString(Console.ReadLine());<br />
if (message == "exit")<br />
break;<br />
sendmsg(message);<br />
}