GithubHelp home page GithubHelp logo

sts10 / medic Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 2.0 427 KB

Check the "health" of passwords in a KeePass database

Home Page: https://sts10.github.io/2019/02/01/medic.html

License: MIT License

Rust 100.00%
rust passwords keepass keepassxc haveibeenpwned hibp hibpwned offline password

medic's Introduction

medic's People

Contributors

dependabot[bot] avatar sts10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

medic's Issues

Accept files of actual passwords for comparison

Currently, Medic can accept a list of SHA1 hashes to check against the given KeePass database's passwords.

Wondering if it would be useful if, through a different flag/option, Medic could take a file of actual, non-hashed passwords; which users might have. Should be pretty easy to implement...

Test for more types of KeePass database failures

Write tests for following possible cases:

  • no file extension on given keepass database
  • "corrupted" DB
  • fail to open db for other reason
  • A KeePass entry that has no title

Next, make sure that, whether the new tests pass or fail, the program itself handles these cases (relatively) well!

Improve error handling (read: remove more `unwrap` calls)

Specifically in lib.rs.

For example:

  • Consider replacing the unwraps with real error-handling tools, such as eprintln!, expect, or unwrap_or_else
  • Specifically: Consider changing the output of get_entries function to a Result to make error handling more natural.
  • More broadly, figure out the best place in the "chain" of functions to handle errors. Where do the turtles end? Every unwrap should be a question: What should happen if the provided file has no file extension, etc. (Reference 1; reference 2)

Don't allow app to connect to internet at all

Currently, for convenience, this tool allows users to check the passwords of a KeePass database against the HaveIBeenPwned Pwned Passwords list. Users can perform this check in one of two ways:

1. ONLINE HIBP Check

This tool takes the first 5 characters of the hash of a password, and sends it to HaveIBeenPwned servers via the service's API. A number of potential matches come back, at which point the tool searches for an exact match (which would indicate an exposed password). As explained in the API documentation:

When a password hash with the same first 5 characters is found in the Pwned Passwords repository, the API will respond with an HTTP 200 and include the suffix of every hash beginning with the specified prefix, followed by a count of how many times it appears in the data set. The API consumer can then search the results of the response for the presence of their source hash and if not found, the password does not exist in the data set.

Note: I currently force users to give explicit permission to perform this check:

println!("\n\nHeads up! I'll be sending the first 5 characters of the hashes of your passwords over the internet to HaveIBeenPwned. \nType allow to allow this");
if gets().unwrap() == "allow" {
    println!("Cool, I'll check your KeePass passwords over the internet now...\n");
    // ...

2. OFFLINE HIBP Check

The tool also allows users to perform this check entirely offline, however the user must first download the ~11GB exposed passwords list themselves, then provide that text file to this tool so it can do the check. To execute this procedure, this tool does not need to connect to the internet.

For a variety of reasons, the OFFLINE method is more secure. Even though the ONLINE method only sends 5 characters of a hash of user passwords, that's still more than nothing.

Thus I'm thinking of removing the ONLINE option (option 2). This way the entire tool never connects to the internet, which would be more in line with how KeePassXC, a commonly used application for interacting with KeePass databases, works by default (except features like "Download favicon").

I could even put a "paranoid" check in place such that tool can't open a KeePass database if it's able to connect to the internet, forcing the user to disable their internet connection in order to use the tool at all.

Questions

What do you think? Should I offer the ONLINE check at all? Make it harder to access somehow?

Are you less likely to use this tool because there's an option to send 5 characters of your passwords' hashes over the internet? Does removing that feature in order to allay these security concerns provide a net benefit that outweighs the usefulness of the online check?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.