Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

URL encoding for 2.x

Boris Ent
2013-05-13
2013-05-13
  • Boris Ent
    Boris Ent
    2013-05-13

    How do I encode this 1.x URL entry to work in 2.x?
      User Name: \Files\Clients\Secret.kdb:Confidential
      URL: {APPDIR}\notepad.exe ""{USERNAME}""

    In 1.x it launches just fine with:
      url-override: cmd://keerun "{URL}" "Open" "{USERNAME}" "{PASSWORD}" "{PASSWORD}{ENTER}"

    KeePass 2.x produces this error message:
      “The specified file could not be found.”

    Thanks

     
  • wellread1
    wellread1
    2013-05-13

    The cmd:// prefix tells KeePass to execute whatever follows on a windows command line. keerun is a third party app with a command line syntax "similar to KeeForm". The error message suggests when the fully expanded command is executed, windows can not find one or more files specified on the command line.

    Try expanding the placeholders and run the resultant keerun command line from the Windows Run command (Win+R). With some work you should be able to find the incorrect path(s).

    Also is it possible that keerun requires the KeeForm plugin be installed in KeePass 2.x?

    Finally I note a reference to a KeePass 1.x database in the User Name. I don't know how that argument is being used by keerun, but KeePass 2.x does not open KeePass 1.x databases.

     
    Last edit: wellread1 2013-05-13
    • Boris Ent
      Boris Ent
      2013-05-13

      Thanks for the quick reply.

      All the points you mentioned were taken into account.

      From the console I have just tried launching:
        >KeePass.exe "Secret.kdb:Confidential"

      The same message:
        “The specified file could not be found.”

      All works well when I just run:
        >KeePass.exe "Secret.kdb"

      The error appears with the data stream “:Confidential”

      The data stream is clearly visible when I invoke:
        >dir /r

      Regards

       
  • Paul
    Paul
    2013-05-13

    You can open databases from the KeePass URL field by specifying the database and password via the encrypted password place holder. Use values similar to the ones below, but remove the ":Confidential" from the username entry.
    cmd://{APPDIR}\KeePass.exe "{USERNAME}" -pw-enc:"{PASSWORD-ENC}"

    cheers, Paul

     
    • Boris Ent
      Boris Ent
      2013-05-13

      Thanks Paul for your input.

      The ADS “:Confidential” is the database I want to open.

      “:Confidential” is an “Alternate Data Stream” in WinNT.

      An ADS can be viewed with dir /r and Powershell.

      For more info, please refer to:
      https://en.wikipedia.org/wiki/NTFS#Alternate_data_streams_.28ADS.29

      KeePass 1.x works well with ADS.

      I’m trying to figure out how I can pass the “:” in the file name to KeePass 2.x by-passing .NET pathname parser.

      Any ideas?

      Cheers

       
  • Paul
    Paul
    2013-05-13

    As you can't do it on the command line it will probably require a modification to the KeePass code. I can't see that happening in a hurry.

    p.s. Security through obfuscation is not really security, plus backup and recovery are much harder.

    cheers, Paul

     
    • Boris Ent
      Boris Ent
      2013-05-13

      Thanks for your response.

      We agree that ADS isn’t a security measure.

      It’s not hidden; & there are a number tools out there that can manipulate it.

      For instance WinRAR handles ADS perfectly.

      We’ve had no problems backing up or archiving ADS.

      A small benefit is that ADS can’t be copied to non-NTFS partitions.

      For a long time it’s been part of the system that I inherited.

      Cheers