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)

HTTP server

HTTP is an application protocol built on top of the TCP layer. The concept is relatively simple; you can craft a request using plain text. In the first line, you will provide the method, such as GET or POST, along with the path and the HTTP version you are conforming to. After that, you will provide a series of key and value pairs to describe your request. Generally, you need to provide a Host value so that the server knows which website you are requesting. A simple HTTP request might look like this:

GET /archive HTTP/1.1
Host: www.devdungeon.com  

You don't need to worry about all of the details in the HTTP specification though. Go provides a net/http package that comes with several tools for easily creating production-ready web servers, including support for HTTP/2.0 with Go 1.6 and newer. This section covers topics related to running and securing HTTP servers...