hashview / hashview-old

A web front-end for password cracking and analytics
http://www.hashview.io
GNU General Public License v3.0
620 stars 134 forks source link

wordlist not updating #336

Closed margeson closed 6 years ago

margeson commented 7 years ago

The page https://x.x.x.x:p/wordlist/list does not update after uploading a text file into ./control/wordlists.

I am using version 0.7.1

pwc@ubuntu:~/hashview/control/wordlists$ cat ../../VERSION 0.7.1

This is the wordlist file that was uploaded to ./control/wordlists

pwc@ubuntu:~/hashview/control/wordlists$ ll wordlist-long-cain.txt

-rw-rw-r-- 1 pwc pwc 3149586 Sep 21 10:23 wordlist-long-cain.txt

Here is the data stored in the wordlist table

pwc@ubuntu:~/hashview/config$ mysql -u root -p


Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3019
Server version: 5.7.19-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use hashview;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> select * from wordlists;
+----+---------------------+---------+---------------------------------+-----------------------------------------------------------------------------------------------------+-----------+------------------------------------------------------------------+
| id | lastupdated         | type    | name                            | path                                                                                                | size      | checksum                                                         |
+----+---------------------+---------+---------------------------------+-----------------------------------------------------------------------------------------------------+-----------+------------------------------------------------------------------+
|  1 | 2017-09-20 09:33:02 | dynamic | Smart Wordlist                  | control/wordlists/SmartWordlist.txt                                                                 | 3590      | d94c74c551667fac6c5b6867baa857b85e5ea9100db3508a5a3ceabac9de6abb |
|  2 | 2017-09-20 09:33:02 | static  | DEFAULT WORDLIST                | control/wordlists/password                                                                          | 3546      | 2dd79902220fa879a330d9246da147984b705087a52ad17de3803acfafe7badc |
|  5 | 2017-09-20 15:05:20 | static  | short-500_common_passwords      | control/wordlists/wordlist-short-500_common_passwords-wmjznvewkhsqd5g9rzd6hetyltcoucaft88t.txt      | 500       | 63c8449e5d43d7ae7e6eaaec19b3bcff86ff150189e22d9f849e9ba5000205bb |
|  6 | 2017-09-20 15:42:18 | static  | short-500_common_passwords_gzip | control/wordlists/wordlist-short-500_common_passwords_gzip-d6qq3x9la3imo1u7u2u47qavluhpdw5v7000.txt | 10        | d09e7965c3aa36bc2870779903c06ab195367a2bf88ae699ee3561f4e90f5067 |
| 10 | 2017-09-21 06:15:25 | static  | pwned-password-update1          | control/wordlists/wordlist-pwned-password-update1-5sz7g5wdjqco1eui7u5k089n845fleok1h1h.txt          | 13675934  | 59176d1304a1c31a51aa8a1d926eb0a6b042fcfca553ae2213f01f8e5ff160fe |
| 11 | 2017-09-21 06:29:24 | static  | pwned-password-1.0              | control/wordlists/wordlist-pwned-password-1.0-2qak2uusvm7txbbree3ar0zbfe29ybdiysiv.txt              | 306259512 | e9edc7e0987f0e4333fe5c8f0a72d95811a8c99a7304e7d9e790dd3c10845ef4 |
| 12 | 2017-09-21 08:02:51 | static  | test-hashcat                    | control/wordlists/wordlist-test-hashcat-grksoc9yk3967hsqt1k7vpeaxfh95d9emt8l.txt                    | 0         | NULL                                                             |
| 13 | 2017-09-21 08:19:22 | static  | onvia-wordlist                  | control/wordlists/wordlist-onvia-wordlist-kffawsu16d462yt9ig1vitezb9vr9ie470zy.txt                  | 0         | NULL                                                             |
+----+---------------------+---------+---------------------------------+-----------------------------------------------------------------------------------------------------+-----------+------------------------------------------------------------------+
8 rows in set (0.00 sec) ```
margeson commented 7 years ago

Also, restarting hashview does not work. Please help :smile:

i128 commented 7 years ago

So, wordlist importation happens in two steps. There is a background worker called wordlist importer it does two things: 1) Reads the state of the control/wordlists/* directory and compares it to the entries in the DB. If there's a new file, it'll add a line to the table (which we do not see) and set the size to 0. 2) next it checks all entries in the wordlist table and for every wordlist that has the size set to zero, it will run a wl -l on the file to get the count of entries.

now because we're not seeing this, chances are the wordlist importer background task has crashed. Typically a restart of hashview will force it to respawn, but there are instances where the thread has chashed, but not exited. I suspect you are in that state now. To fix it... refer to this issue here: https://github.com/hashview/hashview/issues/264

If you see those stale processes after exiting hashview, then you can either 1) Kill each pid that has "resq" listed under ps -ef | grep resq or 2) reboot the server.

Stale / hung threads are a known issue with hashview, and I hope to tackle it with our next incremental release. Try the above and report back if it works or not.

i128 commented 6 years ago

Closing, let me know if this comes back up.