Query Based intrusion detection system