As the Internet of Things (IoT) increases along with the cost of sensors decrease, more and more people are interested in the concept of the Internet of Things (IoT). Denial of service (DoS) and distributed denial of service (DDoS) attacks could be launched against these IoT devices. When there are many different types of IoT devices, security risks increase. There is currently no protocol in place to guarantee the security of IoT gadgets. However, resilience only works when there is constant observation and flexible planning. This can dynamically and flexibly deal with security threats to IoT devices without putting any extra load on the IoT devices themselves. This study proposes a strategy for quickly detecting and counteracting suspicious activity and malicious attacks. In Machine Learning, both Linear SVM and Non-Linear SVM techniques are employed, but the latter yields more accurate results. The accuracy of linear SVM is 93%. However, the accuracy increases to 97.8% when non-linear SVM is used.