Black Hat Go: Go Programming for Hackers and Pentesters
368 pages
English
PDF
4.5

Black Hat Go: Go Programming for Hackers and Pentesters

Black Hat Go: Go Programming for Hackers and Pentesters

Author:

Year:

Summary:

Introduction

The book "Black Hat Go: Go Programming for Hackers and Pentesters" (original title — Black Hat Go: Go Programming for Hackers and Pentesters) is a practical guide written by three information security experts: Tom Steele, Chris Patten, and Dan Kottmann. Published in 2020 by No Starch Press, the book quickly gained popularity among cybersecurity professionals and Go developers looking to expand their skills in writing penetration testing tools.

Unlike traditional Go books that focus on web development or microservices, Black Hat Go offers a unique perspective on the language from an attacker's point of view. The authors demonstrate how to leverage the power of Go (compilation speed, built-in concurrency support, cross-compilation) to create fast, reliable, and stealthy tools that can be used in both legitimate pentests and research purposes.

What is this book about?

Black Hat Go consists of 12 chapters, each dedicated to a specific aspect of writing security tools. The book starts with Go basics for those already familiar with programming but quickly moves to advanced topics:

  • Chapters 1-2: A quick overview of Go syntax, working with packages, structs, interfaces, and error handling.
  • Chapter 3: Creating TCP and HTTP clients and servers, writing a simple port scanner and web crawler.
  • Chapter 4: Working with DNS — writing your own DNS resolver, spoofing DNS requests, using DNS for data exfiltration.
  • Chapter 5: HTTP attacks — creating tools for password brute-forcing, traffic sniffing, header spoofing, and authentication bypass.
  • Chapter 6: Vulnerability exploitation — writing shellcode in Go, working with Metasploit, creating payloads.
  • Chapter 7: Sniffing and spoofing — packet interception, ARP spoofing, traffic analysis using gopacket.
  • Chapter 8: Post-exploitation — writing backdoors, implants, working with C2 (Command & Control) via WebSocket and TLS.
  • Chapter 9: Reverse engineering — disassembling Go binaries, bypassing antivirus, packing and obfuscating code.
  • Chapter 10: Cryptography — implementing encryption, hashing, working with TLS and certificates.
  • Chapter 11: Automation — writing vulnerability scanners, integration with Shodan, Censys, VirusTotal.
  • Chapter 12: Real-world cases — examples of using Go in actual pentests, tips for writing your own tools.

Who is this book for?

The book is intended for readers who already have basic programming knowledge (preferably in Go or another compiled language) and are interested in cybersecurity. It will be useful for:

  • Penetration testing specialists (pentesters) who want to automate their tasks and write their own tools.
  • Go developers looking to transition into the security field or understand how their code can be attacked.
  • Students of cybersecurity courses seeking practical examples in a modern language.
  • Anyone who wants to learn how to create effective and stealthy tools for ethical hacking.

What will the reader learn?

After reading the book, you will be able to:

  • Write fast port scanners and web crawlers in Go.
  • Create your own DNS and HTTP tools for reconnaissance and attacks.
  • Develop payloads and backdoors resistant to detection.
  • Intercept and analyze network traffic using the gopacket library.
  • Implement encryption and secure communication channels for C2.
  • Obfuscate and pack Go binaries to bypass antivirus.

Recommendations