A Secure and Strategic Approach to Keep IoT Devices Safe from Malware Attack