Giter Club home page Giter Club logo

chrome-pwd-dumper-rs's Introduction

Hi there zeon256 here.

  • ๐Ÿ”ญ Iโ€™m currently a year 4 computer science student studying at NTU Singapore
  • ๐Ÿซ I'm am doing my professional internship @GovTechSG as a Software Engineer
  • ๐Ÿ’ผ I've worked at Home Team Science & Technology Agency (HTX) and GovTech
  • ๐Ÿ“ซ How to reach me: [email protected]
  • โšก Fun fact: I like the rust ๐Ÿฆ€ programming language
  • Currently the maintainer of lta-rs, justbus-rs and pulau-rs
  • Prefered editor: Helix + Zellij or VSCode + Dance
  • Main OS: Arch Linux + MacOS (school/work)
  • Other programming languages: C++, TypeScript, Javascript, Java, Kotlin, C#, C, Python, Go

chrome-pwd-dumper-rs's People

Stargazers

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

Watchers

 avatar  avatar

chrome-pwd-dumper-rs's Issues

Support for new Microsoft Edge

It seems like the new Microsoft Edge browser also has the same Login Data file for saved passwords. Will investigate into it and see if I can extend the current version to dump passwords for the new browser. Also since the new Microsoft browser uses chromium internally, I am assuming that other variants of browsers that uses the same engine has a high probability of having the same file.

Possible memory safety issue

Problem 1

The use of Vec::from_raw_parts usage, in this case, is not safe the as the data is not allocated by the same allocator. Dropping this Vec may corrupt the internal data structures of the allocator.

Proposed solution

/// Wrapper around DPAPI `CryptUnprotectData`
pub fn crypt_unprotect_data(data_buf: &mut [u8]) -> Result<Vec<u8>, DumperError> {
    let buf_ptr = data_buf.as_mut_ptr();
    let buf_len = data_buf.len();
    let mut data_in = DATA_BLOB {
        cbData: buf_len as u32,
        pbData: buf_ptr,
    };

    let mut data_out = unsafe { std::mem::zeroed() };

    let unprotect_result = unsafe {
        CryptUnprotectData(
            &mut data_in,
            ptr::null_mut(),
            ptr::null_mut(),
            ptr::null_mut(),
            ptr::null_mut(),
            0,
            &mut data_out,
        )
    };

    if unprotect_result == 0 {
        let error = unsafe { GetLastError() };
        return Err(DumperError::DpapiFailedToDecrypt(error));
    }

    let size = data_out.cbData as usize;
    let v = unsafe { slice::from_raw_parts(data_out.pbData, size).to_vec() };
    Ok(v)
}

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.