xme / known_hosts_bruteforcer

Perl script to bruteforce SSH known_hosts files.
http://blog.rootshell.be/2010/11/03/bruteforcing-ssh-known_hosts-files/
25 stars 11 forks source link

Line number off-by-one bug #12

Open jawaad-ahmad opened 3 years ago

jawaad-ahmad commented 3 years ago

Ran on my ~/.ssh/known_hosts file as follows:

$ ./known_hosts_bruteforcer.pl -i -s 192.168.0.0

Received the following output on the first few lines:

*** Found host: 192.168.0.9 (line 7) ***
*** Found host: 192.168.0.10 (line 20) ***
...

Opened known_hosts and deleted Line 7 of the file and re-ran:

*** Found host: 192.168.0.9 (line 6) ***
*** Found host: 192.168.0.10 (line 19) ***

Expected the 192.168.0.9 line to disappear.

Reverted the change and deleted instead Line 8 of the file and re-ran. This produced the expected output:

*** Found host: 192.168.0.10 (line 19) ***