mubix / whitechapel-ng

Next Generation of White Chapel
21 stars 7 forks source link

New Lines being added to cleartext passwords #13

Closed nullthreat closed 10 years ago

nullthreat commented 10 years ago

Pushing an update in a few min to fix this issue. This is an application breaking issue, if you have a new line in your clear text word it will be hashed WITH the new line causing incorrect hashes to be generated. Once the fix is pushed this will not be an issue any longer.

To fix current installs:

pass = Passwords.all
@passfix = []
pass.each do |p|
    @passfix << p.cleartext.gsub("\n", "") + ":" + p.source
end

Pwhashes.destroy_all
Passwords.destroy_all

@passfix.each do |passwd|
    passwd = passwd.split(":")
    Passwords.add_cleartext_one(passwd[0], passwd[1])
end
nullthreat commented 10 years ago

Fix pushed, Thanks to @zwned for spotting the issue