Port Scanning and Traffic Analysis System Using Artificial Intelligence

Authors

DOI:

https://doi.org/10.64059/eiu.v4i4.61

Keywords:

Port scanning, network traffic analysis, intrusion detection, Machine Learning, Random Forest, CICIDS2017, Network Security

Abstract

This paper presents an integrated system for port scanning and network traffic analysis that leverages machine learning to detect malicious activity in real time. The proposed platform combines three core components—an active port scanner, a passive packet sniffer, and an AI-based classifier—within a unified graphical user interface. The system is implemented in Python using the socket library for TCP SYN and UDP scans, Scapy for packet capture and flow-based feature extraction, and a Random Forest model built with scikit-learn. Both synthetic traffic, generated using Scapy, and real traffic from the CICIDS2017 dataset are used to train and evaluate the model on 15 temporal, statistical and behavioral features. Experiments conducted on a lab network with 50 devices show that the port-scanning module detects 98% of open ports with a scanning speed of 120 ports per second and a false-positive rate of 2%. On the traffic classification task, the AI engine achieves 95% accuracy, 93% precision, 96% recall and a 94.5% F1-score while processing up to 1,200 packets per second with less than 50 ms detection latency. Compared with Snort and Wireshark, the proposed system improves detection accuracy and reduces false positives, while obtaining a usability rating of 4.7/5 from test users. These results indicate that integrating port scanning, traffic analysis and AI in a single tool can significantly enhance practical network monitoring and intrusion detection.

Author Biographies

  • Nasser H. Almofari, Al-Nasser University

    Department of IT, Faculty of Engineering and Information Technology, Al-Nasser University, Sana'a, Yemen

  • Malek Algabri, Sana'a University

    Department of Cybersecurity, Faculty of Engineering and Information Technology, Emirates International University, Sana'a, Yemen.
    Computer Science Department, Faculty of Computer and Information Technology, Sana’a University, Yemen.

  • Osama Al‑Joufi, Emirates International University

    Department of Cybersecurity, Faculty of Engineering and Information Technology, Emirates International University, Sana'a, Yemen.

  • Hammoud Al‑Humaydah, Emirates International University

    Department of Cybersecurity, Faculty of Engineering and Information Technology, Emirates International University, Sana'a, Yemen.

  • Gamil R. S. Qaid, Emirates International University

    Department of Cybersecurity, Faculty of Engineering and Information Technology, Emirates International University, Sana'a, Yemen.
    Computer Engineering Department, Faculty of Computer Sciences and Engineering, Hodeida University, Yemen.

  • Farouk Abduh Kamil Al‑Fahaidy, Ibb University
    Department of Electrical Engineering, Ibb University, Ibb City, Yemen
  • Haitham Al‑Hazbi, Emirates International University

    Department of Cybersecurity, Faculty of Engineering and Information Technology, Emirates International University, Sana'a, Yemen.

  • Amer Al‑Matari, Emirates International University

    Department of Cybersecurity, Faculty of Engineering and Information Technology, Emirates International University, Sana'a, Yemen.

  • Ayman Al‑Mohammadi, Emirates International University

    Department of Cybersecurity, Faculty of Engineering and Information Technology, Emirates International University, Sana'a, Yemen.

  • Suhail Al‑Amashi, Emirates International University

    Department of Cybersecurity, Faculty of Engineering and Information Technology, Emirates International University, Sana'a, Yemen.

References

Abu Bakar, R., & Kijsirikul, B. (2023). Enhancing Network Visibility and Security with Advanced Port Scanning Techniques. Sensors, 23(17), 7541. https://doi.org/10.3390/s23177541

Bhardwaj, A., Mangat, V., Vig, R., Halder, S., & Conti, M. (2021). Distributed denial of service attacks in cloud: State-of-the-art of scientific and commercial solutions. Computer Science Review, 39, 100332. https://doi.org/10.1016/j.cosrev.2020.100332

Djenna, A., Harous, S., & Saidouni, D. E. (2021). Internet of Things Meet Internet of Threats: New Concern Cyber Security Issues of Critical Cyber Infrastructure. Applied Sciences, 11(10), 4580. https://doi.org/10.3390/app11104580

Jakkani, A. K. (2024). Real-Time Network Traffic Analysis and Anomaly Detection to Enhance Network Security and Performance: Machine Learning Approaches. Journal of Electronics, Computer Networking and Applied Mathematics , 4(4), 32–44. https://doi.org/10.55529/jecnam.44.32.44

Liu, Q., Hagenmeyer, V., & Keller, H. B. (2021). A Review of Rule Learning-Based Intrusion Detection Systems and Their Prospects in Smart Grids. IEEE Access, 9, 57542–57564. https://doi.org/10.1109/access.2021.3071263

Markowsky, L., & Markowsky, G. (2015). Scanning for vulnerable devices in the Internet of Things. Proceedings of the 2015 IEEE 8th International Conference on Intelligent Data Acquisition and Advanced Computing Systems: Technology and Applications, IDAACS 2015, 1, 463–467. https://doi.org/10.1109/IDAACS.2015.7340779

Mashaleh, A. S., Almseidin, M., Alhamadeen, H., Aljarrah, S. J., Alauthman, M., Gawanmeh, A., & Qiqieh, I. (2025). A Hybrid Approach for Anomaly Detection with PCA-Driven CNNs. 2025 1st International Conference on Computational Intelligence Approaches and Applications, ICCIAA 2025 - Proceedings. https://doi.org/10.1109/ICCIAA65327.2025.11013445

Mirza, A. (2023). Port Scanning: Techniques, Tools and Detection. https://doi.org/10.31224/3053

Ozkan-Okay, M., Akin, E., Aslan, Ö., Kosunalp, S., Iliev, T., Stoyanov, I., & Beloev, I. (2024). A Comprehensive Survey: Evaluating the Efficiency of Artificial Intelligence and Machine Learning Techniques on Cyber Security Solutions. IEEE Access, 12, 12229–12256. https://doi.org/10.1109/access.2024.3355547

thesis, T. V.-M., TKK, H. U. of T., & 2004, undefined. (2004). Traffic analysis and modeling of IP core networks. Netlab.Tkk.FiT ViipuriMaster’s Thesis, Helsinki University of Technology TKK, 2004•netlab.Tkk.Fi. http://www.netlab.tkk.fi/julkaisut/tyot/diplomityot/1039/diplomityo.pdf

Timo Viipuri. (2004). Traffic analysis and modeling of IP core networks. Master’s thesis, Helsinki University of Technology TKK.

Downloads

Published

2025-12-31

How to Cite

Almofari, N. H. ., Algabri, M. ., Al‑Joufi, O. ., Al‑Humaydah, H. ., Qaid, G. R. S. ., Al‑Fahaidy, F. A. K. ., Al‑Hazbi, H. ., Al‑Matari, A. ., Al‑Mohammadi, . A., & Al‑Amashi, S. . (2025). Port Scanning and Traffic Analysis System Using Artificial Intelligence. Emirates International University Journal, 4(4), 208-223. https://doi.org/10.64059/eiu.v4i4.61

Similar Articles

1-10 of 19

You may also start an advanced similarity search for this article.