khast3x / h8mail

Email OSINT & Password breach hunting tool, locally or using premium services. Supports chasing down related email
Other
4.17k stars 519 forks source link

be more robust for errors in the database #13

Closed PlasmaHH closed 5 years ago

PlasmaHH commented 5 years ago

At some rare places instead of a : the database entries are seperated by a ; which throws things of

I have replaced

t.breachcomp_passw.append(line.split(":")[1]) with t.breachcomp_passw.append(re.split("[;:]",line)[-1]) for me to make it work.

khast3x commented 5 years ago

Hello, could you please give an example to reproduce the bug? Thanks I'll check it out 👌

PlasmaHH commented 5 years ago

I don't know if you have the exact same database as I have, so to reproduce it grep in the bc database for ; and then take that email in a file, do a h8mail.py -t yourfile -bc whatever --local and observe:

Warning: Breach compilation list index out of range
Traceback (most recent call last):
  File "h8mail.py", line 230, in <module>
    main(args)
  File "h8mail.py", line 205, in main
    print_results(breached_targets)
  File "h8mail.py", line 81, in print_results
    for target in target_objs:
TypeError: 'NoneType' object is not iterable

Which is due to the [1] done on the split() result which is a single element list. I did it the above way to include ; for seperation as well as just print whatever is in the list last which also works if no separator was found.

khast3x commented 5 years ago

Hello,

Could you try the v2 branch? Version is still in development but issue might be fixed

Run git checkout v2 inside the h8mail directory to do so.

Cheers