The Internet of Things (IoT) is gradually spreading across the globe, offering a wide variety of opportunities across every part of our lives. Unfortunately, the Internet of Things comes with several information technology flaws and exploits. As the number of security vulnerabilities continues to rise, cybersecurity remains a serious problem for every business in cyberspace. In recent times thousands of zero-day attacks are known to exist. As a result, the addition of new attacks emerges regularly several protocols, mostly from the IoT. There are minor modifications to previously reported cyberattacks. This suggests that even advanced mechanisms like basic machine learning systems have a hard time identifying anomalies. IoT applications pose various threats to businesses, according to security experts. Because of the widespread acceptance of IoT devices, their variety, standardization challenges, and inherent versatility, businesses need an intelligent mechanism capable of the detecting unauthorized IoT devices automatically and connected to their networks. In this study, a machine learning approach is used to identify unauthorized IoT devices by detection of sybil and buffer overflow attack among IoT devices infrastructure. The CNN technique focuses on detecting the attack or activity of any malicious node, as well as attempting to resolve the problem. In this research, CNN, a deep learning technique, was applied for extracting features from the network traffic data to accurately identify malicious IoT devices.