Giter VIP home page Giter VIP logo

azpwpush's Introduction

AzPWPush

AzPwPush is a password push tool that can be used to generate URLs with a one-time password. Use cases are sharing temporary credentials or validating someone's access.

It's possible to use both generated passwords, or self-entered passwords.

How it works

When deploying this function to Azure, the function will have 3 URLS

/Generate - Generates a password from a 10000 word wordlist. The password will exists out of 3 words, and 5 random characters.

/Create - Creates a unique password and URL/

/Get - allows you to retrieve the password. The password will also immediately be destroyed, invalidating the URL for future use.

A Cleanup function runs every hour to clean up the old password files. This is done based on the Maximum Age.

Todo

Documentation :(

azpwpush's People

Contributors

itfranck avatar kelvintegelaar avatar shellster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

azpwpush's Issues

Password Creation Method may accidentally store wrong password

Admittedly, this issue is user error, but if a user passes in a Password parameter and does not correctly escape a "=" sign, the current method of grabbing the password value, will only grab everything to the right of the last "=" sign. This could cause serious, unintended consequences. There is already a separate issue for the not allowing passing of a password as a GET parameter.

Feature Request: X Views, Then Delete Option

Password Pusher has a cool feature where you can restrict a password to X number of views before it is deleted (otherwise it will delete after X days). I think this would be a nice feature to add. It would probably require changing the password storage format to a a JSON string with a "NumberOfRemainingViews" attribute as well. Again, I will implement this in my branch, and would be happy to include a PR at some point, if you are interested.

Blank/no password

When we try to create a password, random or own created password. The Get URL shows nothing in the password box.
Any ideas how we can resolve this?

Feature Request: Ability to Early Delete a Password

I'll probably implement this in my own branch sometime this next week, but I think a /Delete endpoint would be nice, and a link to that on the /Get page, so that a user can delete a password after retrieving it and not leave it lying around for 5 days or whatever if they don't want to.

Password creation process may result in overwrite of existing password

Admittedly it is unlikely, but conceivably the same random number could be chosen twice in a short period of time. In such an instance, the current code would overwrite the existing password with the new one. This could result in leaking a password to the wrong recipient. Please consider catching this case and generating a new id (also see separate issue on using GUID instead). I will be forking and adding/testing fixes for all the issues I just reported, in the near future. Thanks for this great starting point.

Bug: after waking DPAPI is not always loaded on Azure Functions

Azure functions can go idle and restart when they are requested on the consumption plan. DPAPI does not always work after wake. I suspect that the function wakes on a non-windows host which does not have the DPAPI.

Moving away from DPAPI seems like the step to take.

Security consideration - Password should not be in the URL

Security wise, the form should do a Post and the URL should not contain the password in clear text ever, for 2 reason.

  1. Browser history
    Password is saved in clear text in the browser history.
    image

2 User (Code 18)
If the user give the url from the address bar instead of the url in the form.
(eg: I do sometimes that by mistake with Onetimesecret.com ), you end up giving the actual password in clear text and it will never burn.

Using Onetimesecret as a reference,

  1. The form is a Post
  2. The return url is an ID unrelated to the secret.
  3. There's a button click to view & burn the secret from the #2 location (So that even if you give the private url away, the password is burnt as soon as it is viewed anyway.

Is GUID really Safe?

I feel terrible, since I suggested moving to GUID's for ID's. GUIDs are guaranteed unique, and as of UUID Type 4 which is what the New-GUID method in Powershell uses, they are not directly tied to the network MAC address, however, they are seeded largely from values that are known, or could become known to an attacker. Should an attacker know when a password was generated, they can conceivably narrow down possible GUID's to a fairly small range. The consensus is that UUID's are not unguessable and should not be used for passwords (or things that lead to passwords): https://stackoverflow.com/questions/643445/how-easily-can-you-guess-a-guid-that-might-be-generated

I know we are moving into the theoretical here, but it might be good to additionally add 8 hex bytes from a CRNG to the end of the string with something like this: https://github.com/virtualox/Get-RandomHex/blob/master/Get-RandomHex.ps1

The above change should ensure that the ID is unique, un-guessable, and long and unique enough that it cannot be enumerated even by an attacker with significant information about the environment that it runs under.

Consider GUID instead of numeric ID

Password URLs pick a random URL number between: 1 and 999999999999999. This can result in very short URL's that are easily enumerated. Given that there is no rate limiting there is a pretty decent change that an attacker could successfully enumerate a password in a reasonable period of time. Please consider something like [guid]::NewGuid() instead for the ID.

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.