Intelligent Model for Cyber Attack Detection and Prevention