25.12.2014 Views

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

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Barrie Codona, BSc (Hons) Network Computing, 2007<br />

5 Implementation<br />

5.1 Introduction<br />

The three components, <strong>the</strong> event logger, <strong>the</strong> data archiving system <strong>and</strong> event viewer,<br />

that have been developed were created using C# <strong>and</strong> <strong>the</strong> .NET framework that is<br />

provided by Micros<strong>of</strong>t. These were chosen for <strong>the</strong>ir rapid deployment ability, <strong>and</strong> <strong>the</strong>y<br />

fully support such things as XML, encryption <strong>and</strong> socket programming.<br />

5.2 <strong>Event</strong> <strong>Log</strong>ger<br />

The event logging application will be resident on <strong>the</strong> client machine, its purpose is to<br />

monitor <strong>the</strong> file system for files within specified directories being modified. After it<br />

has captured <strong>the</strong>se events it <strong>the</strong>n constructs an XML sting that conatins all <strong>the</strong> ddetials<br />

<strong>of</strong> <strong>the</strong> event, this than has a hash signature tagged onto it. The whole string gets<br />

encrypted <strong>and</strong> sent to <strong>the</strong> data archiving system.<br />

5.2.1 Connecting to Server<br />

Figure 20 shows <strong>the</strong> code that is used for <strong>the</strong> Client to be able to establish a TCP<br />

connection to <strong>the</strong> server. The code allows for IP Addresses, Domain Names <strong>and</strong> local<br />

machine names to be entered for <strong>the</strong> server, it resolves <strong>the</strong>m by using DNS.<br />

Console.Write("Connecting to server... ");<br />

Byte[] data = new byte[10240];<br />

IPHostEntry host = Dns.GetHostEntry("localhost");<br />

IPAddress ipAddr = host.AddressList[0];<br />

// Specify <strong>the</strong> port to connect too.<br />

IPEndPoint ipep = new IPEndPoint(ipAddr, 13000);<br />

// Specify <strong>the</strong> path to watch.<br />

Socket server = new<br />

Socket(AddressFamily.InterNetwork,SocketType.Stream,<br />

ProtocolType.Tcp);<br />

try<br />

{<br />

server.Connect(ipep);<br />

}<br />

catch (SocketException e)<br />

{<br />

Console.WriteLine("Failed!");<br />

Console.WriteLine(e.ToString());<br />

Console.ReadLine();<br />

return;<br />

}<br />

Figure 20: Connecting to a Server<br />

41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!