I am studying port scanning as a penetration testing technique and I decided to experiment with creating TCP packets from scratch using scapy python library. At the moment I am also writing a port scanner from scratch so I decided to share the solution for one of the most difficult tasks I cam across with; performing a tcp connect scan.