Fifth-generation (5G) mobile networks are being deployed all over the world and researchers are concerned about the network's security against hacking. Researchers have focused heavily on this topic in recent years as new technologies attempt to integrate into numerous sectors of corporate and social organizations. Malicious software referred to as malware, is an unwanted application that attackers frequently use to execute online attacks. Advanced packing and obfuscation methods are being used by malware variants to continue their evolution. Due to several application features in 5G networks such as APIs, calls and SMS, it is difficult to detect and classify malware attacks. In a variety of research areas, deep learning (DL) techniques are effectively utilized to address malware-related solutions. Especially, convolutional neural networks (CNN) played a crucial role in the classification of malware detection in 5G networks and the Internet of Things (IoT). In this work, a lightweight CNN architecture with a sequential Long Short-Term Memory (LSTM) layer is developed for malware detection and classification trained on the Malimg dataset. The results prove that the proposed approach achieves 99.8% accuracy with an F1-score of 0.9925 for malware detection and outperforms state-of-the-art approaches in the literature. The classification performance is improved up to 12.8% and 14% in terms of accuracy and F1-score, respectively when compared with existing malware classification models.