The Internet of Things (IoT) is an advancing important technology offers multiple perks, such as webcams, baby monitors, room temperature controllers, smart security cameras and intelligent home automations resulting in the creation of intelligent settings that greatly simplify daily living. However, there are cybersecurity dangers associated with IoT devices due to their lack of protection. For example, Internet of Things botnets have become a major risk. IoT has been a boon for attackers to perform malicious attacks like information theft, DDoS, sending junk data to disrupt networks. IoT devices face serious security issues, from having default weak and common passwords, and a lack of security, rarely and poorly monitored, to having open access to management systems, always connected to the internet. In this paper, we used the N-BaIoT dataset which includes datasets of 9 IoT devices infected with 2 Bot viruses Mirai and Bashlite, where each botnet has 5 sub-attacks and the benign datasets of 9 devices. An analysis with the N-BaIoT dataset which initially had 115 features were reduced to 35 features by using manual reduction and further reduced to single feature in 5-time instances equivalent to 5 features using heat map. We then classified the sub-attacks of 2 botnets and benign of 9 IoT devices by using 7 Machine Learning based classifiers in the Weka tool and Python and compared our results with the manually reduced 35 Features and Heat map based 5 features. Performance metrics like correctly classified, incorrectly classified instances and time taken to build the model were evaluated to verify the proposed work. We found out that over 3 ensemble machine learning classifiers performed extremely well with 99 % accuracies for all devices. In order to verify the logic of our work we tried implementing our proposed model in a different dataset with 3 ensemble classifiers and were able to achieve high detection rates.