Exemple #1
0
    def do_create(self, args):
        '''\n\tDescription: Create a new session & append it into the queue
    \tUsage: create <site> <username> <wordlist>\n'''
        if not args: return
        args = args.split()

        if len(args) != 3:
            print '\n\t[-] Error: This Function takes 3 arguments ({} given)\n'.format(
                len(args))
            return

        site = args[0].lower()
        username = args[1].title()
        wordlist = args[2]

        if not site in sites:
            print '\n\t[-] Error: `{}` is not supported. Only {} are supported\n'.\
            format(site, ', '.join([_.title() for _ in sites]))
            return

        if not exists(wordlist):
            print '\n\t[-] Error: Unable to locate `{}`\n'.format(wordlist)
            return

        bruter = Bruteforce(site, username, wordlist)
        ID = self.retrieve_ID(site.title(), username, wordlist)
        if '{} {} {}'.format(site, username, wordlist) in self.session_history:
            return
        else:
            self.session_history.append('{} {} {}'.format(
                site, username, wordlist))

        if ID:
            try:
                if raw_input('\n\tDo you want to use saved data? [Y/n] '
                             ).lower() == 'y':
                    data = self.retrieve_data(ID)
                    if data[-1]:
                        bruter.passlist.queue = eval(data[-1])
                    if data[-2]:
                        bruter.retrieve = True
                        bruter.attempts = eval(data[-2])
                    if data[-3]:
                        bruter.locked = eval(data[-3])
                else:
                    self.delete(ID)
                    ID = 0
            except:
                return

        bruter.session = Session(database_path, ID, site, username, wordlist)
        self._sessions.put(Regulate(bruter))
        if ID: print
Exemple #2
0
    def do_recreate(self, args):
        '''\n\tDescription: Recreate one session or more from the database
    \tUsage: recreate <id>\n'''

        database = {}
        for num, session in enumerate(self.get_database()):
            database[num] = session

        for index in args:
            if not index.isdigit(): continue
            if not int(index) in database: continue

            session = database[int(index)]
            ID = int(session[0])

            site = str(session[1]).lower()
            username = str(session[2])
            wordlist = str(session[3])

            locked = session[4]
            attempts = session[5]
            passlist = eval(session[6]) if session[6] else []

            if '{} {} {}'.format(site, username,
                                 wordlist) in self.session_history:
                return
            else:
                self.session_history.append('{} {} {}'.format(
                    site, username, wordlist))
            bruter = Bruteforce(site, username, wordlist)
            bruter.retrieve = True

            bruter.username = username
            bruter.wordlist = wordlist

            bruter.locked = locked
            bruter.attempts = attempts
            bruter.passlist.queue = passlist

            bruter.session = Session(database_path, ID, site, username,
                                     wordlist)
            self._sessions.put(Regulate(bruter))

            print '\n\tRecreating {} ...\n'.format(index)
            sleep(1)
Exemple #3
0
    def do_create(self, args):
        '''\n\tDescription: Create a new session & append it into the queue
    \tUsage: create <username> <wordlist>\n'''
        if not args: return
        args = args.split()

        if len(args) != 2:
            print '\n\t[-] Error: This Function takes 2 arguments ({} given)\n'.format(
                len(args))
            return

        username = args[0].title()
        wordlist = args[1]

        if not exists(wordlist):
            print '\n\t[-] Error: Unable to locate `{}`\n'.format(wordlist)
            return

        bruter = Bruteforce(username, wordlist)
        ID = self.retrieve_ID(username, wordlist)
        if username in self.session_history: return
        else: self.session_history.append(username)

        if ID:
            try:
                if raw_input('\n\tDo you want to use saved data? [Y/n] '
                             ).lower() == 'y':
                    data = self.retrieve_data(ID)
                    if data[-1]:
                        bruter.passlist.queue = eval(data[-1])
                    if data[-2]:
                        bruter.retrieve = True
                        bruter.attempts = eval(data[-2])
                else:
                    self.delete(ID)
                    ID = 0
            except:
                return

        bruter.session = Session(database_path, ID, username, wordlist)
        self._sessions.put(Regulate(bruter))
        if ID: print