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)

Cross compiling

Cross compiling is a feature that comes with Go and is very easy to use. It can be particularly useful if you are on a Linux machine performing a penetration test and you need to compile a custom reverse shell that will run on a Windows machine that you compromised.

You can target several architectures and operating systems, and all you need to do is modify an environment variable. There is no need for any extra tools or compilers. Everything is built in for Go.

Simply change the GOARCH and GOOS environment variables to match your desired build target. You can build for Windows, Mac, Linux, and more. You can also build for the prominent 32-bit and 64-bit desktop processors as well as ARM and MIPS for devices such as the Raspberry Pi.

As of this writing, the possible values for GOARCH are as follows: