Playing with sockets (port scan)
Pepelux has wrote a paper about port scanning at low level. It explains anonymous port scan, playing with net packet headers using raw sockets. It shows most used scan techniques (xmas, fin, etc.), through own raw sockets code and examples. It also explains a little about SO’s detection.