Please disable your ad-blocker to access the content


Why use Go for hacking?

Home » Programming Language » Golang » Why use Go for hacking?

Prior to Go, you could prioritize ease of use by using dynamically typed languages-such as Python, Ruby, or PHP at the expense of performance and safety. Alternatively, you could use a statically typed programming language, like C or C++, that offers high performance and safety but isn’t very user-friendly. Go is stripped of much of the ugliness of C, its primary ancestor, making development more user-friendly. At the same time, it’s a statically typed language that produces syntax errors at compile time, increasing your assurance that your code will actually run safely. As it’s compiled, it performs more optimally than interpreted languages and was designed with multicore computing considerations, making concurrent programming a breeze.

These reasons for using Go don’t concern security practitioners specifically. However, many of the language’s features are particularly useful for hackers and adversaries:

Clean package management system Go’s package management solution is elegant and integrated directly with Go’s tooling. Through the use of the Go binary, you can easily download , compile, and install packages and dependencies, which makes consuming third-party libraries simple and generally free from conflict.

Cross-compilation One of the best features in Go is its ability to cross-compile executables. So long as your code doesn’t interact with raw C, you can easily write code on your Linux or Mac system but compile the code in a Windows-friendly, Portable Executable format.

Rich standard library Time spent developing in other languages has helped us appreciate the extent of Go’s standard library. Many modern languages lack the standard libraries required to perform many common tasks such as crypto, network communications, database connectivity, and data encoding (JSON, XML, Base64, hex). Go includes many of these critical functions and libraries as part of the language’s standard packaging, reducing the effort necessary to correctly set up your development environment or to call the functions.

Concurrency Unlike languages that have been around longer, Go was released around the same time as the initial mainstream multicore processors became available. For this reason, Go’s concurrency patterns and performance optimizations are tuned specifically to this model.

Why you might not love Go : Extra Stuff

Go isn’t a perfect solution to every problem. Here are some of the downsides of the language:

Binary size When you compile a binary in Go, the binary is likely to be multiple megabytes in size. You can strip debugging symbols and use a packer to help reduce the size, but these steps require attention. This can be a drawback, particularly for security practitioners who need to attach a binary to an email, host it on a shared filesystem, or transfer it over a network.

Verbosity While Go is less verbose than languages like C#, Java, or even C/C++, you still might find that the simplistic language construct forces you to be overly expressive for things like lists (called slices in Go), processing, looping, or error handling, A python one-liner might easily become a three-liner in Go.

your comments are appreciated and if you wants to see your articles on this platform then please shoot a mail at this address

Thanks for reading