How to use Python to build a basic intrusion detection system?