Month: February 2014

Quick n’ Dirty Network Graph in Powershell

Posted on

This will be very short, sweet and to the point.

I was on a project recently where I was unable to access (and therefore monitor) any of the networking equipment and the WAN links thereof. Noticing that the issues that were occurring were due to a network problem I spoke with the folks who ran that particular network — they were no help. They gave me as little information as possible and punted the issue back to me saying it was a server problem. So here I am, no access to the network equipment, can’t monitor or log the WAN links, workstation in branch office having intermittent issues reaching the server in the main office. Enter powershell.


#-----Start-----
do {

#Ping google.com and select only the response time then output to file
test-connection google.com | Select-Object -Property ResponseTime >> pingoutput.csv

#Sleep for 10 seconds
Start-Sleep -s 10

#Write the time to the file
get-date >> pingoutput.csv

#Set the Time variable for the end while condition
$Time = (Get-Date).Hour

}

#While loop end condition states continue only if time is less than 5pm (24 hour clock)
while ($Time -le 17)
#-----End-----

The comments in the script state how it works and what each line does. After 5pm (the while loop end condition) you can grab that output .csv file and pull it in to excel. Once there you select your data real quick and you’ve got yourself a nice little graph of network latency in milliseconds over the period of the day.

network_latency

 

As you can tell there were some problems with this particular link.

 

 

There ya go!

 

Do you even Kerberos?

Posted on Updated on

As IT Professionals we all know the word kerberos. We all know the protocol kerberos. We all know that it does…things. How much do most of us really know though? Let’s talk about that.

Here are a few facts you should probably know for IT water cooler-type talk.

  • Kerberos is a network authentication protocol that works on a client-server model  utilizing a trusted third-party certificate server and is an integral part of a Microsoft-product driven network ie. Active Directory.
  •  Kerberos is NOT a Microsoft proprietary protocol nor is it only used for Microsoft environments. It was developed by MIT in the 1980s.
  • If Kerberos stops working, us sysadmins would probably lose our jobs.

( Link will be provided at the bottom of this post for more detailed information about kerberos)

Here is the quick and dirty way to demystify how kerberos works as shown above.

  1.  Client needs to talk to server –> sends service ticket to KDC to authenticate him and encrypts the service ticket with his password.
  2.  Server receives service request from client and verifies credentials using its’ Active Directory. If authentication is successful, the server sends a ticket-granting ticket (TGT) back to the client encrypted with the KDCs’ password.
  3.  The client sends the TGT back to the KDC and requests that he have a ticket to open a kerberos authenticated session with the server. The KDC then validates the clients TGT, and creates a session key encrypted with the destination servers’ password.
  4. The client sends that session key to the server and the server decrypts it with his own password and verifies the authentication that the KDC gave the client.
  5.  A kerberos authenticated session is now initiated between the client and the server.

A very good troubleshooting tool that can be used for kerberos is called kerbtray.exe. It unfortunately has not been updated to run on anything newer than Server 2003, but it will still run ok (just ignore the errors). A link will be provided at the bottom of the post for the download location.

After running the program, it will populate itself to the system tray, where you right click it for information. You can do one of two things — List or Purge.

kerbtay1

Clicking Purge here will purge all kerberos tickets so that new ones may be obtained. Clicking list will show the following.

kerbtray2

Here you can see what tickets you have, when they were obtained, when they expire, what flags they have, and what encryption type they’re using. This tool can be very useful for troubleshooting — if nothing else, it’s just cool to see.

Links: 

  Learn more about Kerberos:

http://www.upenn.edu/computing/pennkey/docs/kerbpres/siframes.htm
http://web.mit.edu/kerberos/
http://en.wikipedia.org/wiki/Kerberos_(protocol)

  Download for KerbTray:

http://www.microsoft.com/en-us/download/details.aspx?id=17657