Пример #1
0
def welcome():
	h.print_title("WELCOME TO VMM VERSION 1.0")
	print("Please select the input mode you would like to use")
	print("1 for manual input mode, 2 for csv import mode")
	text_in = ''
	while (text_in != 'q'):
		text_in = h.Raw_Input("Please enter the corresponding number: ")
		try:
			mode = int(text_in)
			if (mode_dict.has_key(mode)):
				return mode
			print("Invalid mode entered")
		except:
			print("Invalid mode entered")
Пример #2
0
def check_substr():
    clear()
    print_title()
    strx = input(
        Fore.GREEN +
        "Enter the sub-string you want to search in Password Database: " +
        Fore.RED +
        "\n(It is CASE SENSITIVE and SPACES will also be counted)\n\n" +
        Fore.WHITE + "#" + Fore.BLUE + "")
    i = 0
    #(Found, File) = (False, None)
    clear()
    print_title()
    print(Fore.GREEN + "\nSearching for " + Fore.RED + strx + Fore.GREEN +
          " and its Sub-Strings in Password Database.\n")
    print(Fore.WHITE +
          "It may take Several Minutes. To interrupt, Press CTRL+C.\n\n")
    hide_cursor()
    num = 0
    try:
        total_pass = 0
        for x in files:
            total_pass = total_pass + file_len(data_path + '/' + x)

        for x in files:
            file = open(data_path + '/' + x, 'r', encoding='latin1')
            (c, r) = get_terminal_size()
            print(Back.CYAN + (c - 1) * ' ', end='\r')

            for line in file:
                line = line.strip()
                #(c, r) = get_terminal_size()
                #print (Back.BLUE + (c-1)*' ', end = '\r')
                i = i + 1
                zx = Back.CYAN + Fore.BLACK + "Checking " + Fore.MAGENTA + "{:>13}".format(
                    line[:13]
                ) + Fore.BLACK + " in file " + Fore.MAGENTA + "{:>25}  ".format(
                    x[:25]) + Fore.RED + str((i * 100) // total_pass) + "%"
                print(zx, end='\r')
                l = line.find(strx)
                if (l is not -1):
                    num = num + 1
                    #l = line.find (strx)
                    lenx = len(strx)
                    linex = Fore.BLUE + line[:l] + Fore.MAGENTA + line[
                        l:l + lenx] + Fore.BLUE + line[lenx:]
                    (c, r) = get_terminal_size()
                    print(Back.BLACK + (c - 1) * ' ', end='\r')
                    print(Fore.WHITE + "{:>6}: ".format(num) + " " + linex +
                          " " + Style.DIM + Fore.WHITE + " in " + Fore.BLUE +
                          x + Style.RESET_ALL)
                    (c, r) = get_terminal_size()
                    print(Back.CYAN + (c - 1) * ' ', end='\r')
            file.close()
        (c, r) = get_terminal_size()
        print(Back.BLACK + (c - 1) * ' ', end='\r')

        print(Fore.GREEN + "\n\n[+]" + Fore.WHITE +
              " Script Succeded. Result was " + Fore.BLUE +
              "{} result(s)".format(num) + Fore.WHITE)
    except KeyboardInterrupt:
        (c, r) = get_terminal_size()
        print(Back.BLACK + (c - 1) * ' ', end='\r')
        print(Fore.GREEN + "\n[+]" + Fore.WHITE +
              " Script Succeded. Result was " + Fore.BLUE +
              "Interrupted by User, {} results found.".format(num) +
              Fore.WHITE)
    show_cursor()
    exit(0)
Пример #3
0
def check_file():
    clear()
    print_title()
    print("This thing is under Development.")
Пример #4
0
def check_one():
    clear()
    #print ("in check 1")
    print_title()
    strx = input(
        Fore.GREEN + "Enter the password you want to check: " + Fore.RED +
        "\n(It is CASE SENSITIVE and SPACES will also be counted)\n\n" +
        Fore.WHITE + "#" + Fore.BLUE + "")
    i = 0
    (Found, File) = (False, None)
    clear()
    print_title()
    print(Fore.GREEN + "\nSearching for " + Fore.RED + strx + Fore.GREEN +
          " in Password Database.\n")
    print(Fore.WHITE +
          "It may take Several Minutes. To interrupt, Press CTRL+C.\n\n")
    hide_cursor()
    try:
        total_pass = 0
        for x in files:
            total_pass = total_pass + file_len(data_path + '/' + x)

        for x in files:
            if Found:
                break
            file = open(data_path + '/' + x, 'r', encoding='latin1')
            (c, r) = get_terminal_size()
            print(Back.CYAN + (c - 1) * ' ', end='\r')

            for line in file:
                line = line.strip()
                #(c, r) = get_terminal_size()
                #print (Back.BLUE + (c-1)*' ', end = '\r')
                i = i + 1
                zx = Back.CYAN + Fore.BLACK + "Checking " + Fore.MAGENTA + "{:>13}".format(
                    line[:13]
                ) + Fore.BLACK + " in file " + Fore.MAGENTA + "{:>25}  ".format(
                    x[:25]) + Fore.RED + str((i * 100) // total_pass) + "%"
                print(zx, end='\r')
                if (line == strx):
                    (Found, File) = (True, x)
                    file.close()
                    break
            file.close()
        (c, r) = get_terminal_size()
        print(Back.BLACK + (c - 1) * ' ', end='\r')
        if Found:
            print(
                Fore.RED +
                "Your password was available in the password database in file "
                + Fore.BLUE + File + Fore.RED +
                ". You should immediately change this password if u have used it somewhere."
            )
        else:
            print(
                Fore.GREEN +
                "Great! Your password is not available in any of the Password Database, and it should be secure enough."
            )

        print(Fore.GREEN + "\n\n[+]" + Fore.WHITE +
              " Script Succeded. Result was " + Fore.BLUE +
              ("Unsecure Password" if Found else "Secure Password") +
              Fore.WHITE)
    except KeyboardInterrupt:
        (c, r) = get_terminal_size()
        print(Back.BLACK + (c - 1) * ' ', end='\r')
        print(Fore.GREEN + "\n[+]" + Fore.WHITE +
              " Script Succeded. Result was " + Fore.BLUE +
              "Interrupted by User" + Fore.WHITE)
    show_cursor()
    exit(0)
Пример #5
0
              " Script Succeded. Result was " + Fore.BLUE +
              "Interrupted by User, {} results found.".format(num) +
              Fore.WHITE)
    show_cursor()
    exit(0)


if len(files) is 0:
    print(
        Fore.RED + "[-]" + Fore.WHITE +
        " Empty Database. Please add some password lists in '{}/' directory..."
        .format(data_path))
    show_cursor()
    exit()

print_title()
print(Fore.GREEN + "\nCHOOSE YOUR SAFE-CHECK:\n")
print(
    Fore.BLUE +
    " 1. Check a Specific password in the database.\n 2. List Passwords containing a specified sub-string or word.\n 3. Check all Passwords present as list in a .txt file.\n\n\n"
)

while (True):
    x = input(Fore.GREEN + "ENTER YOUR CHOICE (0 to exit): " + Fore.BLUE + "#")
    choice = 0
    try:
        choice = int(x)
        if (choice > 3) or (choice < 0):
            raise Exception
        break
    except Exception as e:
Пример #6
0
    def __init__(self, session_user_id, api_id, api_hash, proxy=None):
        """"" Initializes the SmartTelegramClient
        :param session_used_id: Name of the *.session file
        :param api_id: Telegram's api_id acquired through my.telegram.org.
        :param api_hash: Telegram's api_hash.
        :param proxy: Optional proxy tuple/dictionary.
        """

        print_title('Initialization')

        # The first step is to initialize the TelegramClient, as we are
        # subclassing it, we need to call super().__init__(). On a more
        # normal case you would want 'client = TelegramClient(...)'
        super().__init__(
            session_user_id,
            api_id,
            api_hash,
            connection=ConnectionTcpAbridged,
            # If you're using a proxy, set it here.
            proxy=proxy)

        # Calling .connect() may raise a connection error False, so you need
        # to except those before continuing. Otherwise you may want to retry
        # as done here.
        print('Connecting to Telegram servers...')
        try:
            loop.run_until_complete(self.connect())
            print('Connected Successfully')
        except IOError:
            # We handle IOError and not ConnectionError because
            # PySocks' errors do not subclass ConnectionError
            # (so this will work with and without proxies).
            print('Initial connection failed. Retrying...')
            loop.run_until_complete(self.connect())

        # If the user hasn't called .sign_in() or .sign_up() yet, they won't
        # be authorized. The first thing you must do is authorize. Calling
        # .sign_in() should only be done once as the information is saved on
        # the *.session file so you don't need to enter the code every time.
        if not loop.run_until_complete(self.is_user_authorized()):
            print('First run. Sending code request...')
            user_phone = input('Enter your phone: ')
            loop.run_until_complete(self.sign_in(user_phone))

            self_user = None
            while self_user is None:
                code = input('Enter the code you just received: ')
                try:
                    self_user = loop.run_until_complete(
                        self.sign_in(code=code))

                # Two-step verification may be enabled, and .sign_in will
                # raise this error. If that's the case ask for the password.
                # Note that getpass() may not work on PyCharm due to a bug,
                # if that's the case simply change it for input().
                except SessionPasswordNeededError:
                    pw = getpass('Two step verification is enabled. '
                                 'Please enter your password: ')

                    self_user = loop.run_until_complete(
                        self.sign_in(password=pw))

        self.chats = None
        self.chat_entities = None

        self.account = Account()