Book Image

Security with Go

By : John Daniel Leon, Karthik Gaekwad
Book Image

Security with Go

By: John Daniel Leon, Karthik Gaekwad

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)

Capturing with filters

The following program demonstrates how to set filters. Filters use the BPF format. If you have ever used Wireshark, you are probably already familiar with filters. There are many filter options that can be logically combined. Filters can be incredibly complex, and there are many cheat sheets online with common filters and examples of neat tricks. Here are a few examples to give you an idea of some very basic filters:

  • host 192.168.0.123
  • dst net 192.168.0.0/24
  • port 22
  • not broadcast and not multicast

Some of the preceding filters should be self-explanatory. The host filter will show only packets to or from that host. The dst net filter will capture incoming traffic that is going to a 192.168.0.* address. The port filter is watching only for port 22 traffic. The not broadcast and not multicast filter demonstrates how you can negate and combine multiple filters...