diff --git a/Packages/Arguments/Arguments.go b/Packages/Arguments/Arguments.go index c03e747..04f5306 100644 --- a/Packages/Arguments/Arguments.go +++ b/Packages/Arguments/Arguments.go @@ -23,8 +23,8 @@ type FlagOptions struct { } var ( - version = "3.1" - versionName = "Blue Moon" + version = "3.5" + versionName = "Star Dust" license = "MIT" author = "@nickvourd" github = "https://github.com/nickvourd/Supernova" diff --git a/Packages/Converters/Converters.go b/Packages/Converters/Converters.go index a0e1ece..b93d0c9 100644 --- a/Packages/Converters/Converters.go +++ b/Packages/Converters/Converters.go @@ -243,7 +243,7 @@ func ShellcodeDecimalArray2String(decArray []int) string { func ConvertObfShellcode2Template(shellcode string, language string, variable string) string { switch language { case "c": - template := fmt.Sprintf(`unsigned char %s[] = {%s};`, variable, shellcode) + template := fmt.Sprintf(`char* %s[] = {%s};`, variable, shellcode) return template case "csharp": template := fmt.Sprintf(`string[] %s = new string[] {%s};`, variable, shellcode) diff --git a/Packages/Obfuscators/Obfuscators.go b/Packages/Obfuscators/Obfuscators.go index a1b6cc8..c741f5f 100644 --- a/Packages/Obfuscators/Obfuscators.go +++ b/Packages/Obfuscators/Obfuscators.go @@ -5,7 +5,6 @@ import ( "Supernova/Packages/Converters" "fmt" "log" - "math/rand" "os" "strings" ) @@ -58,12 +57,14 @@ func EnsureSegmentLength(segment string, desiredLength int) (string, int, []stri if len(segment) < desiredLength { // Append random hex values until the segment reaches the desired length for len(segment) < desiredLength { - randomHex := fmt.Sprintf("%02X", rand.Intn(240)+16) + //randomHex := fmt.Sprintf("%02X", rand.Intn(240)+16) + randomHex := "90" segment += strings.ToLower(randomHex) randomHexValues = append(randomHexValues, randomHex) totalRandomHexAdded++ } } + return segment, totalRandomHexAdded, randomHexValues } @@ -166,7 +167,8 @@ func MacObfuscation(shellcode string) (string, int, []string) { if len(group) < 6 { // Generate and append random hex values to the group for j := len(group); j < 6; j++ { - randomHex := fmt.Sprintf("%02X", rand.Intn(240)+16) + //randomHex := fmt.Sprintf("%02X", rand.Intn(240)+16) + randomHex := "90" group = append(group, strings.ToLower(randomHex)) randomHexValues = append(randomHexValues, randomHex) randomHexCount++ @@ -201,7 +203,8 @@ func IPv6Obfuscation(shellcode string) ([]string, int, []string) { // Generate random hexadecimal values and append them to the shellcode for i := 0; i < remaining; i = i + 2 { - randomHex := fmt.Sprintf("%X", rand.Intn(240)+16) + //randomHex := fmt.Sprintf("%X", rand.Intn(240)+16) + randomHex := "90" shellcode += strings.ToLower(randomHex) randomHexValues = append(randomHexValues, randomHex) randomHexCount++ @@ -233,15 +236,10 @@ func IPv6Obfuscation(shellcode string) ([]string, int, []string) { } // IPv4Obfuscation function -func IPv4Obfuscation(shellcode string) string { +func IPv4Obfuscation(shellcode string) (string, int, []string) { // Arrays to store added numbers and their hexadecimal representations - var addedNumbers []int var hexRepresentations []string - - // Variables eclaration - var pronous string = "it" - var pronousNum string = "number" - var result string + var addedNumbers []int // Split the original string into chunks of four digits chunks := strings.Fields(shellcode) @@ -267,18 +265,15 @@ func IPv4Obfuscation(shellcode string) string { // Loop until the length of chunkResult is equal to 4 for len(chunkResult) < 4 { - // Generate a random decimal from 0 to 255 - randomNumber := rand.Intn(256) - - // Convert decimal to hexadecimal - randomHex := fmt.Sprintf("0x%X", randomNumber) + //randomHex := fmt.Sprintf("0x%X", randomNumber) + randomNumber := 90 // Convert the random number to a string randomString := fmt.Sprintf("%d", randomNumber) // Add the random number and its hexadecimal representation to arrays addedNumbers = append(addedNumbers, randomNumber) - hexRepresentations = append(hexRepresentations, randomHex) + hexRepresentations = append(hexRepresentations, randomString) // Add the random string to the slice chunkResult = append(chunkResult, randomString) @@ -287,45 +282,12 @@ func IPv4Obfuscation(shellcode string) string { // Print the message with the count of added numbers and their details count := len(addedNumbers) - // if count more than one - if count > 1 { - pronousNum = "numbers" - } - - if count > 0 { - fmt.Printf("[+] Configure payload length evenly for IPv4 obfuscation by adding %d random %s:\n\n", count, pronousNum) - - // Iterate over each element and build the result string - for i, num := range addedNumbers { - hexRep := hexRepresentations[i] - - // Append the formatted string to the result - if i < count-1 { - result += fmt.Sprintf(Colors.BoldRed("%d "), num) - result += fmt.Sprintf("=> byte(%s)", Colors.BoldMagneta(strings.ToLower(hexRep))) - result += ", " - } else { - result += fmt.Sprintf(Colors.BoldRed("%d "), num) - result += fmt.Sprintf("=> byte(%s)", Colors.BoldMagneta(strings.ToLower(hexRep))) - } - } - - fmt.Print(" " + result + "\n\n") - - // if generated numbers are more than one - if count > 1 { - pronous = "them" - } - - fmt.Printf("[!] Be sure to remove %s during the implementation process!\n\n", pronous) - } - // Join the last remaining elements into a string with dots configResult := strings.Join(chunkResult, ".") shellcodeProperty += "\"" + configResult + "\"" - return shellcodeProperty + return shellcodeProperty, count, hexRepresentations } // DetectObfuscation function @@ -347,7 +309,19 @@ func DetectObfuscation(obfuscation string, shellcode []string) string { shellcodeStr := Converters.ShellcodeDecimalArray2String(shellcodeDecArray) // Call function named IPv4Obfuscation - obfuscatedShellcodeString = IPv4Obfuscation(shellcodeStr) + obfuscatedShellcodeString, randomHexCount, randomHexValues := IPv4Obfuscation(shellcodeStr) + + // if count more than zero + if randomHexCount > 0 { + // if count more than one + if randomHexCount > 1 { + pronousChar = "bytes" + pronous = "them" + } + + // Call function named CustomPayloadMessage + CustomPayloadMessage(obfuscation, randomHexCount, randomHexValues, pronous, pronousChar) + } return obfuscatedShellcodeString case "ipv6": @@ -429,7 +403,7 @@ func CustomPayloadMessage(obfuscation string, randomHexCount int, randomHexValue // Declare variables var hexString string - fmt.Printf("[+] Configure payload length evenly for %s obfuscation by adding %d random %s:\n\n", obfuscation, randomHexCount, pronousChar) + fmt.Printf("[+] Configure payload length evenly for %s obfuscation by adding %d NOP %s:\n\n", strings.ToUpper(obfuscation), randomHexCount, pronousChar) // Iterate over each character for i, char := range randomHexValues { @@ -444,6 +418,5 @@ func CustomPayloadMessage(obfuscation string, randomHexCount int, randomHexValue fmt.Print(" " + hexString + "\n\n") - fmt.Printf("[!] Be sure to remove %s during the implementation process!\n\n", pronous) - + //fmt.Printf("[!] Be sure to remove %s during the implementation process!\n\n", pronous) } diff --git a/README.md b/README.md index 06eb462..6e98c24 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Real fucking shellcode encryptor & obfuscator. Supernova is an open-source tool that empowers users to securely encrypt and/or obfuscate their raw shellcode. ![Static Badge](https://img.shields.io/badge/Golang-cyan?style=flat&logoSize=auto) -![Static Badge](https://img.shields.io/badge/Version-3.1%20(Blue%20Moon)-red?link=https%3A%2F%2Fgithub.com%2Fnickvourd%2FSupernova%2Freleases) +![Static Badge](https://img.shields.io/badge/Version-3.5%20(Star%20Dust)-red?link=https%3A%2F%2Fgithub.com%2Fnickvourd%2FSupernova%2Freleases) Supernova supports various features beyond those typically found in a common shellcode encryptor tool. Please refer to the Features section for more information. @@ -142,7 +142,7 @@ go build Supernova ███████║╚██████╔╝██║ ███████╗██║ ██║██║ ╚████║╚██████╔╝ ╚████╔╝ ██║ ██║ ╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ -Supernova v3.1 - Real fucking shellcode encryptor & obfuscator tool. +Supernova v3.5 - Real fucking shellcode encryptor & obfuscator tool. Supernova is an open source tool licensed under MIT. Written with <3 by @nickvourd. Please visit https://github.com/nickvourd/Supernova for more... diff --git a/go.mod b/go.mod index 89d2d50..3673b78 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ toolchain go1.24.2 require ( github.com/fatih/color v1.18.0 - golang.org/x/crypto v0.37.0 + golang.org/x/crypto v0.38.0 ) require ( github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - golang.org/x/sys v0.32.0 // indirect + golang.org/x/sys v0.33.0 // indirect ) diff --git a/go.sum b/go.sum index 63fcfea..26f7c95 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,10 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= +golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=