Malware Development
  • Golang Malware Development
  • Malware Development In Golang - Introduction
    • Golang Programming Intro
      • 1. Preparing the Go Environment
      • 2. Hello World
      • 3. Calling MessageBox winAPI from GO
      • 4. Shellcode Runner
  • Code Injection Techniques
    • Shellcode Injection
      • 1. Classic Shellcode Injection
      • 2. Process Hollowing
      • 3. QueueUserAPC
    • DLL Injection
      • 1. Dll Injection
      • 2. Reflective DLL Injection
  • Payloads
    • Payloads
      • 1. Basic DLL using Golang
      • 2. Malicious DLL using Golang
      • 3. Malicious XLL using Golang
    • Shellcode development
      • 1. Keystone Engine
      • 2. Windows x64 Shellcode Development intro
      • 3. Transforming DLLs into Shellcode
  • Evasion
    • AV Bypass
      • 1. Introduction
      • 2. Remove the shellcode from the payload
      • 3. Delay Execution
        • 1. time.Sleep() 1/2
        • 2. time.Sleep() 2/2
        • 3. Custom Sleep function
      • 4. XOR Encryption
      • 5. AMSI Bypass
    • EDR Bypass
      • 1. Setting up a testing environment
      • 2. Userland Hooks
        • 1. What are userland hooks?
        • 2. Load a fresh copy of the dll from disk
        • 3. Programmatically detect ntdll hooks
        • 4. Direct and Indirect Syscalls (shellcode runner)
      • 3. VPN abuse for Endpoint Protection Evasion
        • 1. Global Protect Abuse 1/2
        • 2. Global Protect Abuse 2/2
Powered by GitBook
On this page

Was this helpful?

  1. Malware Development In Golang - Introduction
  2. Golang Programming Intro

2. Hello World

#golang #helloworld

Last updated 1 year ago

Was this helpful?

To make sure that everything is running as expected let's write a quick "hello world" program.

Create a new folder where the project will live and run the following command:

go mod init helloWorld

Running the command will create the file.

We then have to create a main.go file in the same directory.

The hello world code is shown below:

main.go
package main

import "fmt"

func main() {
	fmt.Println("Hello World")

}

To simply run the code, navigate to the same directory as main.go and execute:

go run .

To build it as a stand alone executable simply run

go build .

The beauty of go unlike other languages is that it will figure out all dependencies and packages used. No need to download them separately.

go.mod