Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. Dump user's password to try to crack them

Dump user's password to try to crack them

Scheduled Pinned Locked Moved Solved Support
22 Posts 7 Posters 3.8k Views 7 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • potemkin_aiP Offline
    potemkin_aiP Offline
    potemkin_ai
    wrote on last edited by
    #7

    mysql -uroot -ppassword box -e "select username,password from users;" > users.list - is a ready to use command, shall anyone be interested.

    @nebulon , @girish , I know it might sound silly, but you would just save me quite some time - and what's the encryption standard in use?

    1 Reply Last reply
    0
    • nebulonN Offline
      nebulonN Offline
      nebulon
      Staff
      wrote on last edited by
      #8

      The settings are https://git.cloudron.io/cloudron/box/-/blob/master/src/users.js#L98 so you can search through that file to see how passwords are handled internally.

      1 Reply Last reply
      0
      • potemkin_aiP Offline
        potemkin_aiP Offline
        potemkin_ai
        wrote on last edited by
        #9

        Thanks! Code worth thousands words 🙂

        1 Reply Last reply
        0
        • potemkin_aiP Offline
          potemkin_aiP Offline
          potemkin_ai
          wrote on last edited by
          #10

          Apologies, one more question:

          pbkdf2Async(password, salt, CRYPTO_ITERATIONS, CRYPTO_KEY_LENGTH, CRYPTO_DIGEST)
          

          Am I right that salt is a random piece of bytes that is stored somewhere (if so - where?) and password - is user's password?

          girishG 1 Reply Last reply
          1
          • potemkin_aiP potemkin_ai

            Apologies, one more question:

            pbkdf2Async(password, salt, CRYPTO_ITERATIONS, CRYPTO_KEY_LENGTH, CRYPTO_DIGEST)
            

            Am I right that salt is a random piece of bytes that is stored somewhere (if so - where?) and password - is user's password?

            girishG Offline
            girishG Offline
            girish
            Staff
            wrote on last edited by
            #11

            @potemkin_ai said in Dump user's password to try to crack them:

            Am I right that salt is a random piece of bytes that is stored somewhere (if so - where?) and password - is user's password?

            Passwords are stored in databases as a one way hash i.e you can only verify if the password is correct but cannot obtain the original password. In very naive terms, if the password (in numbers) is 10+32, imagine storing just 42 in the database. You don't know if 42 came from 40+2 or 50-8 and so on. With this approach, you don't the original math but it's always possible to verify given raw password if the password is correct.

            Turns out it's possible to pre-compute this "42" offline. Basically, you take millions of raw passwords and hash them . Then, you can just compare against a leaked database very quickly (it's just a string compare). This is called a rainbow table. To prevent this, you create a "salt". Think of salt as a random number thrown into the hash computation. Say 10 is our salt, we would store 52. Now, an attacker has to create a table for <rawpassword>+<hash>. We are talking very very large numbers here, so this is not possible anymore.

            Initially, people started with a single salt for the whole application. These days, you have a unique salt per user. The salt you see above is the per user unique salt. It's a field in the same table. Hope that answers!

            marcusquinnM 1 Reply Last reply
            3
            • potemkin_aiP Offline
              potemkin_aiP Offline
              potemkin_ai
              wrote on last edited by potemkin_ai
              #12

              @girish , thank you! Yeah, I'm aware about the theory, I was wondering how it's done on Cloudron.

              so this is not possible anymore

              That's exactly what I would like to check 🙂
              You know - people are always the weakest part of the chain...

              1 Reply Last reply
              0
              • potemkin_aiP Offline
                potemkin_aiP Offline
                potemkin_ai
                wrote on last edited by
                #13

                @girish , I know, it's been a while, but I've got my hands on server with a GPU, so I wanted to run a brute force on the hashes I've got - could you please, help me to identify which of the algorithms are you using in Cloudron?

                https://hashcat.net/wiki/doku.php?id=example_hashes

                My idea was that it's IPMI2 RAKP HMAC-SHA1 (7300 mode) - but hashcat refuses to agree with me on that 🙂

                1 Reply Last reply
                0
                • nebulonN Offline
                  nebulonN Offline
                  nebulon
                  Staff
                  wrote on last edited by
                  #14

                  The code link has changed I guess, so here we are now https://git.cloudron.io/platform/box/-/blob/master/src/users.js#L800

                  potemkin_aiP 1 Reply Last reply
                  0
                  • fbartelsF Offline
                    fbartelsF Offline
                    fbartels
                    App Dev
                    wrote on last edited by fbartels
                    #15

                    An interesting discussion and it confirms my expectation that Cloudron is following modern and good security practices.

                    in case others are coming back to this discussion later, gitlab also offers permalinks to code files and lines, so that will always work: https://git.cloudron.io/platform/box/-/blob/e536c94028b3ce56f468011af8ca656abb78b37f/src/users.js#L800 (only exception would be if this commit somehow gets completely removed from the repo).

                    The database is not exposed anywhere so setting a password as such does not add any extra security, which is why it is password to make that clear and avoid obfuscation.

                    You could switch to https://mariadb.com/kb/en/authentication-plugin-unix-socket/ to get rid of the password completely. this would also strengthen security further by limiting which local users have access.

                    Edit: does Cloudron have some internal logic like complexity rules apart from the "Password must be at least 8 and at most 265 characters" check of the ui?

                    nebulonN 1 Reply Last reply
                    2
                    • nebulonN nebulon

                      The code link has changed I guess, so here we are now https://git.cloudron.io/platform/box/-/blob/master/src/users.js#L800

                      potemkin_aiP Offline
                      potemkin_aiP Offline
                      potemkin_ai
                      wrote on last edited by
                      #16

                      @nebulon Thank you! Would you mind helping with selecting proper resulting encryption, please?

                      It'something at that page: https://hashcat.net/wiki/doku.php?id=example_hashes and I though it shall be 7300, but it isn't...

                      P.S. Yeah, forcing some password complexity would be nice!

                      potemkin_aiP 1 Reply Last reply
                      0
                      • girishG girish

                        @potemkin_ai said in Dump user's password to try to crack them:

                        Am I right that salt is a random piece of bytes that is stored somewhere (if so - where?) and password - is user's password?

                        Passwords are stored in databases as a one way hash i.e you can only verify if the password is correct but cannot obtain the original password. In very naive terms, if the password (in numbers) is 10+32, imagine storing just 42 in the database. You don't know if 42 came from 40+2 or 50-8 and so on. With this approach, you don't the original math but it's always possible to verify given raw password if the password is correct.

                        Turns out it's possible to pre-compute this "42" offline. Basically, you take millions of raw passwords and hash them . Then, you can just compare against a leaked database very quickly (it's just a string compare). This is called a rainbow table. To prevent this, you create a "salt". Think of salt as a random number thrown into the hash computation. Say 10 is our salt, we would store 52. Now, an attacker has to create a table for <rawpassword>+<hash>. We are talking very very large numbers here, so this is not possible anymore.

                        Initially, people started with a single salt for the whole application. These days, you have a unique salt per user. The salt you see above is the per user unique salt. It's a field in the same table. Hope that answers!

                        marcusquinnM Offline
                        marcusquinnM Offline
                        marcusquinn
                        wrote on last edited by
                        #17

                        @girish & @nebulon should have a podcast. SO much knowledge to share!

                        Web Design https://www.evergreen.je
                        Development https://brandlight.org
                        Life https://marcusquinn.com

                        1 Reply Last reply
                        1
                        • fbartelsF fbartels

                          An interesting discussion and it confirms my expectation that Cloudron is following modern and good security practices.

                          in case others are coming back to this discussion later, gitlab also offers permalinks to code files and lines, so that will always work: https://git.cloudron.io/platform/box/-/blob/e536c94028b3ce56f468011af8ca656abb78b37f/src/users.js#L800 (only exception would be if this commit somehow gets completely removed from the repo).

                          The database is not exposed anywhere so setting a password as such does not add any extra security, which is why it is password to make that clear and avoid obfuscation.

                          You could switch to https://mariadb.com/kb/en/authentication-plugin-unix-socket/ to get rid of the password completely. this would also strengthen security further by limiting which local users have access.

                          Edit: does Cloudron have some internal logic like complexity rules apart from the "Password must be at least 8 and at most 265 characters" check of the ui?

                          nebulonN Offline
                          nebulonN Offline
                          nebulon
                          Staff
                          wrote on last edited by
                          #18

                          @fbartels said in Dump user's password to try to crack them:

                          Edit: does Cloudron have some internal logic like complexity rules apart from the "Password must be at least 8 and at most 265 characters" check of the ui?

                          https://git.cloudron.io/platform/box/-/blob/master/src/users.js#L183 so we only have the length check. Some way for an admin to specify length and complexity would indeed be quite nice, but it would have to be a bit flexible, since we have seen various different requirements from users, depending on the environment where Cloudron operates in.

                          1 Reply Last reply
                          1
                          • necrevistonnezrN Offline
                            necrevistonnezrN Offline
                            necrevistonnezr
                            wrote on last edited by
                            #19

                            Length > Complexity. Always.
                            Both is better.
                            https://bitwarden.com/blog/how-long-should-my-password-be/
                            https://pages.nist.gov/800-63-3/sp800-63b.html#appA

                            1 Reply Last reply
                            2
                            • potemkin_aiP Offline
                              potemkin_aiP Offline
                              potemkin_ai
                              wrote on last edited by
                              #20

                              Length > Complexity. Always.

                              Yeah, that helps for the password to appear on monitors as a 3M sticks 🤗

                              necrevistonnezrN 1 Reply Last reply
                              1
                              • potemkin_aiP potemkin_ai

                                @nebulon Thank you! Would you mind helping with selecting proper resulting encryption, please?

                                It'something at that page: https://hashcat.net/wiki/doku.php?id=example_hashes and I though it shall be 7300, but it isn't...

                                P.S. Yeah, forcing some password complexity would be nice!

                                potemkin_aiP Offline
                                potemkin_aiP Offline
                                potemkin_ai
                                wrote on last edited by
                                #21

                                @potemkin_ai said in Dump user's password to try to crack them:

                                @nebulon Thank you! Would you mind helping with selecting proper resulting encryption, please?

                                It'something at that page: https://hashcat.net/wiki/doku.php?id=example_hashes and I though it shall be 7300, but it isn't...

                                P.S. Yeah, forcing some password complexity would be nice!

                                @nebulon , @girish , (or anyone else, actually) I offload the task from my radars for now, but as soon as you want me to run a brute-force attack of the algorithms you've chosen using modern GPU HW, please, let me know the function from hashcat to run.

                                For my or any other reference, here are the steps to do:

                                mysql -uroot -ppassword box -e "select username,password,salt from users;" > users.list # note salt field - it's a must
                                

                                Use hashcat -m $mode $password:$salt then to try if it will be accepted.
                                $mode to be taken from example hashes table above, better also verify if with hashcat -m $mode --example-hash - the later will show the hash structure expected by hashcat.

                                Once appropriate mode found (hashcat starts checking the hashes) - this could be offloaded to GPU for a much faster checks and verification against various dictionaries, etc.

                                I had to do some other password recovery task now and I was unpleasantly surprised with the speed of the brute force efficiency (with john just on modern CPU).

                                Shall my time permit, I will return here some time in the future; otherwise would be glad to pick up this task once Cloudron's resulting hash will be matched with hashcat's one (or a new mode created).

                                1 Reply Last reply
                                1
                                • potemkin_aiP potemkin_ai

                                  Length > Complexity. Always.

                                  Yeah, that helps for the password to appear on monitors as a 3M sticks 🤗

                                  necrevistonnezrN Offline
                                  necrevistonnezrN Offline
                                  necrevistonnezr
                                  wrote on last edited by
                                  #22
                                  This post is deleted!
                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Bookmarks
                                  • Search