Book Image

Security with Go

By : John Daniel Leon
Book Image

Security with Go

By: John Daniel Leon

Overview of this book

Go is becoming more and more popular as a language for security experts. Its wide use in server and cloud environments, its speed and ease of use, and its evident capabilities for data analysis, have made it a prime choice for developers who need to think about security. Security with Go is the first Golang security book, and it is useful for both blue team and red team applications. With this book, you will learn how to write secure software, monitor your systems, secure your data, attack systems, and extract information. Defensive topics include cryptography, forensics, packet capturing, and building secure web applications. Offensive topics include brute force, port scanning, packet injection, web scraping, social engineering, and post exploitation techniques.
Table of Contents (15 chapters)

Packet Capturing and Injection

Packet capturing is the process of monitoring the raw traffic going through a network. This applies to wired Ethernet and wireless network devices. The tcpdump and libpcap packages are the standard when it comes to packet capturing. They were written in the 1980s and are still being used today. The gopacket package not only wraps the C libraries but also adds layers of Go abstraction to make it more idiomatic to Go and practical to use.

The pcap library allows you to gather information about network devices, read packets off the wire, store traffic in a .pcap file, filter traffic based on a number of criteria, or forge custom packets and send them through the network device. For the pcap library, filtering is done with Berkeley Packet Filters (BPF).

There are countless uses of packet capturing. It can be used to set up honeypots and monitor what...