Master's Thesis

Scago: a Go library for implementing network protocols and cybersecurity testing

Tiago Miguel Fernandes Diogo2023

Key information

Authors:

Tiago Miguel Fernandes Diogo (Tiago Miguel Fernandes Diogo)

Supervisors:

Rui Jorge Morais Tomaz Valadas (Rui Jorge Morais Tomaz Valadas)

Published in

11/15/2023

Abstract

Numa era em que a segurança na Internet é primordial, as ferramentas de cibersegurança que simulam ataques para identificar vulnerabilidades de sistemas são essenciais. Scapy é uma biblioteca Python especializada na manipulação de pacotes. É amplamente utilizada para tarefas de rede, como varreduras, traceroute e testes de cibersegurança. Nesta Dissertação de Mestrado, desenvolvemos uma ferramenta semelhante ao Scapy, utilizando a linguagem de programação Golang, conhecida pelo seu rápido desempenho, baixo consumo de memória e excelente suporte à concorrência. Scago baseia-se na biblioteca gopacket. Segue a arquitetura do Scapy e tenta imitar a sua legibilidade e interface amigável ao utilizador. Atualmente, a biblioteca Scago suporta os seguintes ataques: inundação TCP SYN, overflow de CAM, envenenamento de cache ARP, sequestro de bridge raiz STP, dupla etiquetagem VLAN, spoofing de DHCP, spoofing de DNS e envenenamento de RIP. Comparamos a implementação destes ataques no Scago com implementações equivalentes usando o Scapy. Os nossos resultados mostram que o Scago é significativamente mais rápido que o Scapy, especialmente nas implementações de ataques DoS. Além disso, embora a legibilidade do Scapy seja geralmente melhor, ela diminui em ataques que requerem o uso de concorrência. A biblioteca permite ao utilizador desenvolver scripts personalizáveis e criar pacotes personalizados. Sendo uma ferramenta modular, contribuímos para a biblioteca pública gopacket adicionando suporte para as camadas de protocolo RIP e 802.3. In an era where Internet security is paramount, cybersecurity tools that simulate attacks to pinpoint system vulnerabilities are vital. Scapy is a Python library that specializes in packet manipulation. It is widely used for network tasks such as scanning, tracerouting, and cybersecurity testing. In this MSc Dissertation we developed a tool akin to Scapy, utilizing the Golang programming language, renowned for its fast performance, low memory overhead, and exceptional concurrency support. Scago is built upon the gopacket library. It follows the Scapy architecture and tries to mimic its readability and user-friendly interface. The Scago library currently supports the following attacks: TCP SYN flood, CAM overflow, ARP cache poisoning, STP root bridge hijack, VLAN double tagging, DHCP spoofing, DNS spoofing and RIP poisoning. We compared the Scago implementation of these attacks with equivalent implementations using Scapy. Our results show that Scago is significantly faster than Scapy, especially in the implementations of DoS attacks. Moreover, while the readability of Scapy is in general better, it becomes worse for attacks that require the use of concurrency. The library gives the user freedom to develop customizable scripts and create custom packets. Being a modular tool, we contributed to the public library gopacket by adding support to RIP and 802.3 protocol layers. This work was supported by Instituto de Telecomunicações.

Publication details

Authors in the community:

Supervisors of this institution:

RENATES TID

203766547

Degree Name

Mestrado em Engenharia de Telecomunicações e Informática

Fields of Science and Technology (FOS)

electrical-engineering-electronic-engineering-information-engineering - Electrical engineering, electronic engineering, information engineering

Keywords

  • Scapy
  • Golang
  • cybersecurity
  • network
  • packet
  • attacks
  • cibersegurança
  • rede
  • pacote
  • ataques

Publication language (ISO code)

eng - English

Rights type:

Embargo lifted

Date available:

10/12/2024

Institution name

Instituto Superior Técnico