How to remove THC-Hydra password limit?
#7
(04-24-2021, 06:17 PM)poppopret Wrote: Recompile with the following change:

hydra.c >

Line 223:

Code:
#define MAX_LINES 50000000



to



Code:
#define MAX_LINES 65000000



bumping it up to 65M.



Needs a lot more modifications for supporting anything more than 65M. You might be able to get 65.5M at most out of it, I'm not 100% sure how the code works since most of it uses pretty outdated standards and hydra.c is if/else hell, but IIRC it has something to do with the fact that the length of the file is stored in a size_t (16bit) type and cast to 32/64bit depending on the compiler.

This if you want to work on the source code. Alternatively instead of using THC-HYDRA why not use Patator? As far as i am aware it has no upper limit.

Failing that you can always use a Python wrapper for Hydra. In fact i was bored so i wrote a quick one for you, might have a bug or two, because i haven't tested it yet. But feel free to fix it or make any adjustments to it that you may desire.

Code:
#!/usr/bin/env python3
#____  ____            __
#\  \ /  /____  _____/  |_  ___________
# \  Y  // __ \_/ ___\  __\/  _ \_  __ \
#  \    /\  ___/\  \___|  | (  <_> )  | \/
#  \___/  \___  >\___  >__|  \____/|__|
#              \/    \/
#----Authored by Vector/NullArray
##############################################
import os
import sys
import time
import random

TOTAL_LINES = 0
MAX_LINES  = 50000000

def names():   
    NEW = ['A1','B1','C1','D1','A2','B2','C2','D2']
    while True:
        name = "output" + random.choice(NEW) + ".txt"
        if not os.isfile(name):
            return name
   

def lists_processing(f_path=''): 
    if f_path == '':
        return print("[!] No path specified")
    elif f_path != '':
        try:
            with open('r', f_path) as infile:
                infile.read()
        except IOError:
            return print("[!] Invalid path specified")
   
    for i in xrange(MAX_LINES):
        for lines in infile:   
            TOTAL_LINES +=1
       
        if TOTAL_LINES >= MAX_LINES or TOTAL_LINES == MAX_LINES:
            n = names()
            try:
                os.system("tail -n " + MAX_LINES + " " + f_path + " >> " n)
            except Exception as e:
                print("[!] Operation Failed")
                time.sleep(2)
                sys.exit(e)
            continue   
        else:
            return "True"   
       
     

                   
def main(targets='',user='',passw=''):
    os.system("hydra -l" + user +" -P " + passw + " -M " + targets)
   
   
if __name__ == '__main__':
   
    targets=input("[+] Path to target list.")
    if os.isfile(targets):
        print("[+] List found")
    else:
        print("[!] List not found")
        sys.exit(0)
       
    user=input("[+] Path to user list.")
    if os.isfile(user):
        print("[+] List found")
    else:
        print("[!] List not found")
        sys.exit(0)
   
    while True:
        passw=input("[+] Path to password list.")
        if os.isfile(passw):
            print("[+] List found")
            print("[+] Checking length, auto resolving...")
            a = lists_processing(passw)
        if "path" in a:
            print("[!] List not found")
            sys.exit(0)
        elif "True" in path:
            print("[+] Lists found and resolved.\nShowing new lists if applicable.")
            os.system("ls *.txt")
           
            q=input("[+] Enter new password file? [Y/n or Q to Quit]: ").lower()
            if 'y'in q:
                passw=input("[+] Path to password list.")
                main(targets,user,passw)
            elif 'n' in q:
                main(targets,user,passw)
            elif 'q' in q:
                print("[!] Quitting...")
                sys.exit(0)           
            else:
                print("[!] Unhandled Option")
                sys.exit(0)
                   
        else:
            print("[!] List not found")
            sys.exit(0)
Reply


Messages In This Thread
RE: How to remove THC-Hydra password limit? - by Vector - 04-27-2021, 01:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can you name a few open source tools for offline password cracking? ShadowRaider 2 7,173 06-30-2020, 01:54 AM
Last Post: poppopret
  How Secure is Your Password? Cryptography 21 33,360 12-29-2016, 08:12 PM
Last Post: VenAAX
  Group Policy Preference Password finder. Vector 4 11,651 06-06-2016, 07:45 PM
Last Post: Vector
  2,000,000+ Password List Cryptography 0 7,165 06-10-2015, 10:36 PM
Last Post: Cryptography