2021-01-08 17:28:09 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"strings"
|
2021-01-15 10:52:04 +00:00
|
|
|
"github.com/Schmenn/discord-exploits/exploits"
|
|
|
|
"github.com/Schmenn/discord-exploits/modules"
|
2021-01-08 17:28:09 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
quiet bool = false
|
|
|
|
inputFile string = "no input file provided"
|
|
|
|
mode string = "no mode specified"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
args := os.Args[1:]
|
|
|
|
handleArgs(args, &quiet)
|
|
|
|
if !quiet {
|
2021-01-10 20:18:44 +00:00
|
|
|
modules.Welcome()
|
2021-01-08 17:28:09 +00:00
|
|
|
}
|
|
|
|
|
2021-01-10 20:18:44 +00:00
|
|
|
fmt.Println("input file: " + inputFile)
|
|
|
|
fmt.Println("mode: " + mode)
|
2021-01-08 17:28:09 +00:00
|
|
|
|
|
|
|
initCommand(inputFile, mode)
|
2021-01-15 10:52:04 +00:00
|
|
|
|
2021-01-08 17:28:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func handleArgs(args []string, quiet *bool) {
|
2021-01-10 20:18:44 +00:00
|
|
|
|
|
|
|
for i, s := range args {
|
|
|
|
switch s {
|
2021-01-15 10:52:04 +00:00
|
|
|
// Quiet
|
2021-01-12 10:36:43 +00:00
|
|
|
case "-q", "--quiet":
|
2021-01-10 20:18:44 +00:00
|
|
|
*quiet = true
|
2021-01-08 17:28:09 +00:00
|
|
|
|
2021-01-10 20:18:44 +00:00
|
|
|
// Input File
|
|
|
|
case "-i":
|
|
|
|
inputFile = args[i+1]
|
2021-01-08 17:28:09 +00:00
|
|
|
|
2021-01-10 20:18:44 +00:00
|
|
|
// Mode Selection
|
|
|
|
case "-m":
|
|
|
|
mode = args[i+1]
|
2021-01-08 17:28:09 +00:00
|
|
|
|
2021-01-10 20:18:44 +00:00
|
|
|
// Help Message
|
|
|
|
case "-h":
|
|
|
|
modules.Help(os.Args[0])
|
|
|
|
*quiet = true
|
|
|
|
return
|
2021-01-08 17:28:09 +00:00
|
|
|
|
2021-01-10 20:18:44 +00:00
|
|
|
default:
|
|
|
|
break
|
2021-01-08 17:28:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-01-15 10:52:04 +00:00
|
|
|
/*func initCommand(inputFile string, mode string) {
|
2021-01-08 20:20:04 +00:00
|
|
|
inputFile = strings.ToLower(inputFile)
|
2021-01-08 17:28:09 +00:00
|
|
|
switch strings.ToLower(mode) {
|
2021-01-12 10:36:43 +00:00
|
|
|
case "e":
|
2021-01-08 17:28:09 +00:00
|
|
|
if strings.HasSuffix(inputFile, ".webm") {
|
|
|
|
fmt.Println("editing video.")
|
|
|
|
exploits.RunExpandingVideoTask(inputFile)
|
|
|
|
fmt.Println("completed task.")
|
|
|
|
} else {
|
2021-01-15 10:52:04 +00:00
|
|
|
fmt.Println("File is not a webm or mp4, check -h")
|
2021-01-08 17:28:09 +00:00
|
|
|
}
|
2021-01-12 10:36:43 +00:00
|
|
|
case "n":
|
2021-01-10 20:18:44 +00:00
|
|
|
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")
|
|
|
|
}
|
2021-01-12 10:36:43 +00:00
|
|
|
case "0", "z":
|
2021-01-10 20:18:44 +00:00
|
|
|
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")
|
|
|
|
}
|
2021-01-12 10:36:43 +00:00
|
|
|
case "v":
|
2021-01-08 20:20:04 +00:00
|
|
|
if strings.HasSuffix(inputFile, ".png") {
|
|
|
|
fmt.Println("editing photo.")
|
|
|
|
exploits.RunVirusImageTask(inputFile)
|
|
|
|
fmt.Println("completed task.")
|
|
|
|
} else {
|
|
|
|
fmt.Println("File is not a png, check -h")
|
|
|
|
}
|
2021-01-08 17:28:09 +00:00
|
|
|
}
|
|
|
|
}
|
2021-01-15 10:52:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
func initCommand(inputFile string, mode string) {
|
|
|
|
inputFile = strings.ToLower(inputFile)
|
|
|
|
|
|
|
|
if strings.HasSuffix(inputFile, ".webm") {
|
|
|
|
|
|
|
|
switch mode {
|
|
|
|
case "e":
|
|
|
|
fmt.Println("editing video.")
|
|
|
|
exploits.RunExpandingVideoTask(inputFile)
|
|
|
|
fmt.Println("completed task.")
|
|
|
|
case "n":
|
|
|
|
fmt.Println("editing video.")
|
|
|
|
exploits.RunNegativeVideoTask(inputFile)
|
|
|
|
fmt.Println("completed task.")
|
|
|
|
case "0", "z":
|
|
|
|
fmt.Println("editing video.")
|
|
|
|
exploits.RunZeroVideoTask(inputFile)
|
|
|
|
fmt.Println("completed task.")
|
|
|
|
default:
|
|
|
|
fmt.Println("the mode doesn't match the file")
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if strings.HasSuffix(inputFile, ".mp4") {
|
|
|
|
|
|
|
|
switch mode {
|
|
|
|
case "e":
|
|
|
|
fmt.Println("transcoding video from mp4 to webm")
|
|
|
|
out := modules.Transcode(inputFile, "webm")
|
|
|
|
fmt.Println("finished transcoding video from mp4 to webm")
|
|
|
|
fmt.Println("editing video.")
|
|
|
|
exploits.RunExpandingVideoTask(out)
|
|
|
|
fmt.Println("completed task.")
|
|
|
|
os.Remove(out)
|
|
|
|
|
|
|
|
case "n":
|
|
|
|
fmt.Println("transcoding video from mp4 to webm")
|
|
|
|
out := modules.Transcode(inputFile, "webm")
|
|
|
|
fmt.Println("finished transcoding video from mp4 to webm")
|
|
|
|
fmt.Println("editing video.")
|
|
|
|
exploits.RunNegativeVideoTask(out)
|
|
|
|
fmt.Println("completed task.")
|
|
|
|
os.Remove(out)
|
|
|
|
|
|
|
|
case "0", "z":
|
|
|
|
fmt.Println("transcoding video from mp4 to webm")
|
|
|
|
out := modules.Transcode(inputFile, "webm")
|
|
|
|
fmt.Println("finished transcoding video from mp4 to webm")
|
|
|
|
fmt.Println("editing video.")
|
|
|
|
exploits.RunZeroVideoTask(out)
|
|
|
|
fmt.Println("completed task.")
|
|
|
|
os.Remove(out)
|
|
|
|
|
|
|
|
default:
|
|
|
|
fmt.Println("the mode doesn't match the file")
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if strings.HasSuffix(inputFile, ".png") {
|
|
|
|
fmt.Println("editing photo.")
|
|
|
|
exploits.RunVirusImageTask(inputFile)
|
|
|
|
fmt.Println("completed task.")
|
|
|
|
|
|
|
|
} else if strings.HasSuffix(inputFile, ".jpg") {
|
|
|
|
fmt.Println("transcoding image from jpg to png")
|
|
|
|
out := modules.Transcode(inputFile, "png")
|
|
|
|
fmt.Println("finished transcoding image from jpg to png")
|
|
|
|
fmt.Println("editing photo.")
|
|
|
|
exploits.RunVirusImageTask(out)
|
|
|
|
fmt.Println("completed task.")
|
|
|
|
os.Remove(out)
|
|
|
|
|
|
|
|
} else if strings.HasSuffix(inputFile, ".jpeg") {
|
|
|
|
if strings.ToLower(mode) != "v" || strings.ToLower(mode) == "no mode specified"{
|
|
|
|
fmt.Println("the mode is not compatible with the image, proceeding to run the virus image task anyway")
|
|
|
|
}
|
|
|
|
fmt.Println("transcoding image from jpeg to png")
|
|
|
|
out := modules.Transcode(inputFile, "png")
|
|
|
|
fmt.Println("finished transcoding image from jpeg to png")
|
|
|
|
fmt.Println("editing photo.")
|
|
|
|
exploits.RunVirusImageTask(out)
|
|
|
|
fmt.Println("completed task.")
|
|
|
|
os.Remove(out)
|
|
|
|
} else {
|
|
|
|
if inputFile == "no input file provided" {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|