コード例 #1
0
def startup():
    core.clear()
    # print("[" + green + "+" + rr + "]  Starting Mal-editor... ") (we dont need this , to much text on screen )
    print("[" + green + "OK" + rr + "] Mal-editor Successfully Started!")
    core.maleditorlogo()
    options()

    whole_file = []
    CurrentFileName = "Untitled"
    if operating_system == "Linux":
        raw_cmd = read_from_file(os.path.join(sys.path[0], "allcmds.txt"))
    else:
        raw_cmd = read_from_file("~/mal-factory/allcmds.txt")

    try:
        while True:
            command = input(red + "Mal" + green + "Editor" + rr + " > ")
            if command == "99" or command.lower() == "exit" or command.lower(
            ) == "quit" or command.lower() == "e":
                raise KeyboardInterrupt

            elif command.split(" ")[0] == "r":
                try:
                    whole_file.pop(int(command.split(" ")[1]))
                except:
                    print("[!] Error trying to remove a line")
                set_screen(whole_file, CurrentFileName)

            elif command == "s":
                try:
                    filename = input(blue + "[*] Save as" + rr + ": ")
                    CurrentFileName = filename
                    savefile = open("~/{}.txt".format(filename), "w")
                    for element in whole_file:
                        savefile.write(element + "\n")
                    savefile.close()
                except Exception:
                    print(red + "[!] Error saving file as " + filename + rr)

                print(green + "[ OK ] File saved in ~/{}".format(filename) +
                      rr)

            elif check_command(command, raw_cmd):
                whole_file.append(command)
                set_screen(whole_file, CurrentFileName)
            else:
                set_screen(whole_file, CurrentFileName)
                print(rr + "\n[" + red + "-" + rr + "] Not a valid command: " +
                      command)

            core.clear()
            options()
            show_file(whole_file, CurrentFileName)

    except KeyboardInterrupt:
        main.startup()
    except Exception:
        print(red + core.bold + "[!] Error in MalEditor")
        raise
コード例 #2
0
ファイル: gmails.py プロジェクト: 5l1v3r1/googleot
def inbox(username, password):
    try:
        while True:
            answer = input(core.red + "G" + core.white + "mail" + core.yellow +
                           " > " + core.r + "")
            answer = answer.split(" ")
            if answer[0] == "help":
                print("\n-----------\n")
                print(core.ul + "The Help/Command Menu" + core.r)
                print("\nhelp - Opens this help menu")
                print(
                    "send <*****@*****.**> <*****@*****.**> - Send an email with your gmail account"
                )
                print("exit - Go back to the homepage")
                print("\n-----------\n")
            elif answer[0] == "exit":
                main.startup()
            elif answer[0] == "send":
                try:
                    FROM = answer[1]
                    TO = answer[2]
                    SUBJECT = input("\nSubject: ")
                    print("\n--- Type 'quit' to Finish! ---")
                    TEXT = ""
                    x = 1
                    while True:
                        message = input(str(x) + ": ")
                        if message.lower() == "quit" or message.lower() == "q":
                            print("\n")
                            break
                        TEXT = TEXT + message + "\n"
                        x += 1
                    BODY = '\r\n'.join([
                        'To: %s' % TO,
                        'From: %s' % FROM,
                        'Subject: %s' % SUBJECT, '', TEXT
                    ])
                    try:
                        server.sendmail(username, [TO], BODY)
                        print('Your email was sent!')
                    except:
                        print(
                            "Error sending mail! Does the recipient's email exist?"
                        )
                except:
                    print(
                        "\nError: Could not send email! Your command was incorrectly set.\n"
                    )
            else:
                print("\nCommand '" + str(answer) +
                      "' was not found. Please type 'help' for help.\n")
    except KeyboardInterrupt:
        main.startup()
    except:
        print("\nError: Can't find input.\n")
コード例 #3
0
def startup():
    try:
        clear()
        core.testchrome()
        print("")
        print(core.red + core.bold + "[+] " + core.r + "Relies on Googler " +
              core.red + core.bold + "[-] " + core.r + core.lcyan + core.ul +
              "https://github.com/jarun/googler" + core.r + core.red +
              core.bold + " [+]" + core.r + "\n")
        print(core.ul + "Please type 'help' for help!" + core.r + "\n")
        while True:
            answer = input(core.lblue + "S" + core.red + "e" + core.yellow +
                           "a" + core.lblue + "r" + core.green + "c" +
                           core.red + "h" + core.yellow + " > " + core.r + "")
            answer = answer.split(" ")
            if answer[0] == "exit":
                main.startup()
            elif answer[0] == "lines":
                try:
                    lines = answer[1]
                    print("\n# of lines set to " + answer[1] + "\n")
                except:
                    print(
                        "\nError: Could not set lines. Please do 'lines <#>'\n"
                    )
            elif answer[0] == "help":
                print("\n-----------\n")
                print(core.ul + "The Help/Command Menu" + core.r)
                print("\nhelp - Opens the help menu")
                print("exit - Exits back to the main menu")
                print(
                    "lines <number> - Set the amount of search results you want per search"
                )
                print(
                    "search <word> - Search for any specific thing. \n" +
                    "(This can be anything that is not a command already said above.)"
                )
                print("\n----------- \n")
            elif answer[0] == "search":
                try:
                    search = answer[1]
                    os.system("googler -n " + lines + " google.com " + search +
                              "\n")
                    input("Please press {ENTER} to continue... " + core.invis)
                    startup()
                except:
                    print(
                        "\nError: Could not search. \nMake sure you have Googler installed and type 'search <word>'!\n"
                    )
            else:
                print("\n " + answer +
                      " is not a command. Please type 'help' for help. \n")
    except KeyboardInterrupt:
        main.startup()
コード例 #4
0
ファイル: gmails.py プロジェクト: 5l1v3r1/googleot
def startup():
    try:
        clear()
        core.logo()
        core.name()
        print("")
        print("(Username Ex: [email protected])")
        print("(Password Ex: password1234)")
        print("")
        login()
    except KeyboardInterrupt:
        main.startup()
コード例 #5
0
ファイル: gmails.py プロジェクト: asian-code/googleot
def login():
  try:
    gmail_sender = input("Please put your Gmail Username: "******"Please enter your password: "******"" or gmail_passwd == "":
      print("\nSorry! You used an unknown character. Please type in your credentials correctly!")
      getpass.getpass("Please press {ENTER} to continue... ")
      startup()
    authenticate(gmail_sender, gmail_passwd)
  except KeyboardInterrupt:
    main.startup()
コード例 #6
0
ファイル: gmailemail.py プロジェクト: saleguas/malfactory
def startup():
    try:
        clear()
        print(line)
        core.gmaillogo()
        print(NP)
        print(line)
        core.gmailname()
        print("")
        print(core.rr + "[" + core.blue + "+" + core.rr +
              "] (Username Ex: [email protected])")
        print(core.rr + "[" + core.blue + "+" + core.rr +
              "] (Password Ex: password1234)")
        print("")
        login()
    except KeyboardInterrupt:
        main.startup()
コード例 #7
0
ファイル: gmailemail.py プロジェクト: saleguas/malfactory
def login():
    try:
        gmail_sender = input("Please put your " + gmail + " Username: "******"Please enter your " + core.red + "password" +
                             core.rr + ": " + core.invis)
        gmail_passwd = str(gmail_passwd)
        print(core.rr + "")
        if gmail_sender == "" or gmail_passwd == "":
            print(
                core.rr +
                "\nSorry! You used an unknown character. Please type in your credentials correctly!"
            )
            input("Please press {ENTER} to continue... " + core.invis)
            print(core.rr + "")
            startup()
        authenticate(gmail_sender, gmail_passwd)
    except KeyboardInterrupt:
        main.startup()
コード例 #8
0
    drawnCow = canvas.create_rectangle(cow.location[0] * 10,
                                       cow.location[1] * 10,
                                       (cow.location[0] * 10) - 10,
                                       (cow.location[1] * 10) + 10,
                                       fill=getColor(cow.initialHealth))

    return drawnCow


#draw grid
for i in range(50):
    canvas.create_line(0, 10 * i, 500, 10 * i)
    canvas.create_line(10 * i, 0, 10 * i, 500)

#generate cows from main.py script
cows = main.startup()
#draw cows and create list of locations
drawnCows = {}
for cow in cows:
    drawnCow = drawCow(cow)
    drawnCows[cow.cowId] = drawnCow

#animate cows
for x in range(500):
    cowLocations = []
    cowsToRemove = []
    totalHealth = 0
    print('----')
    for i in range(len(cows)):
        print(cows[i].health)
        #move cows
コード例 #9
0
ファイル: gmailemail.py プロジェクト: saleguas/malfactory
def inbox(username, password):
    try:
        print(line)
        core.gmaillogo()
        print(line + "\n")
        while True:
            answer = input(gmail + core.yellow + " > " + core.rr + "")
            answer = answer.lower()
            answer = answer.split(" ")
            if answer[0] == "help":
                print("\n-----------\n")
                print(core.ul + "The Help/Command Menu" + core.rr)
                print("\nhelp - Opens this help menu")
                print("reload - Reloads the screen")
                print("template - See the gmail templates")
                print(
                    "send <*****@*****.**> - Send an email with your gmail account"
                )
                print(
                    "send <*****@*****.**> -t <template> - Send an email with a pre-set template with your gmail account"
                )
                print("exit - Go back to the homepage")
                print("\n-----------\n")
            elif answer[0] == "template" or answer[0] == "templates":
                print("""\n-----------\n
(DO NOT USE THIS FOR ILLEGAL PURPOUSES
\n-----------\n
NP - (Nigerian Prince) - Send an email asking people to help a helpless rich nigerian prince
* REQUIRES FIRSTNAME AND LASTNAME
-----------
ITD - (IT Department) - Send an email pretending to be a company's I.T department
* REQUIRES LASTNAME, COMPANYNAME
-----------
UA - (Unauthorized Access) - Send an email claiming someone's account has reached unauthorized access
* REQUIRES FIRSTNAME, LASTNAME, COMPANYNAME, AND USERNAME
-----------
RSU - (Router Software Update) - Send an email from a router company asking to download a software update
* REQUIRES FIRSTNAME, LASTNAME, COMPANYNAME, ROUTERNAME
-----------
ISU - (ISP Software Update) - Send an email from an Internet Service Provider company asking to download a software update
* REQUIRES FIRSTNAME, LASTNAME, COMPANYNAME, AND ADDRESS
\n-----------\n
LME - (Legitimate Malfactory Email) - Send an email expressing that the email contains malware from Malfactory
-----------
LMAE - (Legitimate Malware Analysis Email) - Send an email expressing that the email contains malware for analysis
\n-----------\n""")
            elif answer[0] == "exit":
                main.startup()
            elif answer[0] == "reload" or answer[0] == "clear":
                core.clear()
                print(line)
                core.gmaillogo()
                print(line + "\n")
            elif answer[0] == "send":
                try:
                    TO = answer[1]
                    SUBJECT = input("\nSubject: ")
                    print("\n--- Type 'quit' to Finish! ---")
                    TEXT = ""
                    x = 1
                    while True:
                        message = input(str(x) + ": ")
                        if message.lower() == "quit" or message.lower() == "q":
                            print("\n")
                            break
                        TEXT = TEXT + message + "\n"
                        x += 1
                    BODY = '\r\n'.join([
                        'To: %s' % TO,
                        'From: %s' % username,
                        'Subject: %s' % SUBJECT, '', TEXT
                    ])
                    try:
                        server.sendmail(username, [TO], BODY)
                        print('Your email was sent!')
                    except:
                        print(
                            "Error sending mail! Does the recipient's email exist?"
                        )
                except:
                    print(
                        "\nError: Could not send email! Your command was incorrectly set.\n"
                    )
            elif answer[0] == "send" and answer[3] == "-t":
                try:
                    TO = answer[1]
                    TEMPLATE = answer[3]
                    SUBJECT = input("\nSubject: ")
                    TEXT = TEMPLATE
                    print(TEMPLATE)
                    try:
                        server.sendmail(username, [TO], BODY)
                        print('Your email was sent!')
                    except:
                        print(
                            "Error sending mail! Does the recipient's email exist?"
                        )
                except:
                    print(
                        "\nError: Could not send email! Your command was incorrectly set.\n"
                    )
            else:
                print("\nCommand '" + str(answer) +
                      "' was not found. Please type 'help' for help.\n")
    except KeyboardInterrupt:
        main.startup()
    except:
        print("\nError: Can't find input.\n")
        raise
コード例 #10
0
ファイル: runme.py プロジェクト: asian-code/googleot
#!/usr/bin/python3

import main

main.startup()
コード例 #11
0
                        type=str,
                        default=main.def_mnt_point)
    parser.add_argument("-s",
                        "--src",
                        help="MySQL data path, default '/cs/mysql/data'",
                        nargs='?',
                        type=str,
                        default=main.def_mysql_data_src)
    args = parser.parse_args()

    input_fs = def_fs_type
    input_dev = ""
    input_mnt = def_mnt_point
    input_src = def_mysql_data_src

    if args.fs != None and len(args.fs) > 0:
        input_fs = args.fs
    if len(args.device) > 0:
        input_dev = args.device[0]
    if args.mount != None and len(args.mount) > 0:
        input_mnt = args.mount.rstrip('/')
    if args.src != None and len(args.src) > 0:
        input_src = args.src.rstrip('/')

    ret = main.startup(input_dev, input_mnt, input_fs, input_src)

    if ret == 0:
        exit(0)
    else:
        exit(1)