Preventing Attacks on IoT Networks and Devices