Menu

#1721 IOProtocolExt v1.12 - FTPS connection to Fritzbox 7490

KeePass_2.x
closed
nobody
None
5
2018-05-04
2018-03-19
Markus
No

Hi all,

First of all, KeePass is indeed an incredibly great tool!

Following problem with getting KeePass 2.38 download a database file from a Fritzbox 7490 using an FTPS connection (using IOProtocol v1.12 plugin): KeePass finds the database but after entering the credentials it returns the error message "Failed to load the specified file! The file header is corrupted. Less data than expected could be read from the file."

I have set FTPS "Explicit TLS/SSL" to "Yes". If I open WinSCP.exe from the IOProtocolExt_WinSCP folder I can connect, download the database file and open that local copy with KeePass without any problems.

I have read about this issue (bug?) in other threads but apparently haven't come accross a solution.

Can anyone tell me what's wrong or how to make KeePass open the database correctly?

Much appreciated.

Markus

Discussion

1 2 > >> (Page 1 of 2)
  • Dominik Reichl

    Dominik Reichl - 2018-03-19

    My suggestion would be to update the WinSCP copy in the 'IOProtocolExt_WinSCP' folder. Maybe the WinSCP developer has already fixed this.

    Best regards,
    Dominik

     
  • Markus

    Markus - 2018-03-19

    Thx for your quick feedback. Tried but did not help as I'm already using the latest available version.

     
  • Paul

    Paul - 2018-03-19

    What happens if you set Explicit TLS/SSL to No?

    cheers, Paul

     
  • Markus

    Markus - 2018-03-20

    It gives the error message as you would expect, i.e.: "An exception occured during a WebClient request. [...] connection failed [...] TLS connect error in SSLv2/v3 read server hello A, can't establish TLS connection [...]".

    The FTP server has been configured such that it doesn't accept unsecure FTP connections, only FTPS.

     
  • Paul

    Paul - 2018-03-20

    When you request the file in KeePass does the WinSCP log show the connection is explicit TLS?

    cheers, Paul

     
  • Markus

    Markus - 2018-03-20

    Where can I see that? There seems to be no logfile in either the KeePass or the WinSCP folder.

     
  • Paul

    Paul - 2018-03-20

    Run WinSCP manually and set the logging level you want, close WinSCP. A log will now be generated every time you connect.

    cheers, Paul

     
  • Markus

    Markus - 2018-03-21

    I think the explicit TLS connection works. Below is the full log:

    . 2018-03-21 09:21:47.253 Session name:###@######.myfritz.net (Ad-Hoc site)
    . 2018-03-21 09:21:47.253 Host name: ######.myfritz.net (Port: 47658)
    . 2018-03-21 09:21:47.253 User name: ### (Password: Yes, Key file: No)
    . 2018-03-21 09:21:47.253 Transfer Protocol: FTP
    . 2018-03-21 09:21:47.253 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
    . 2018-03-21 09:21:47.253 Disable Nagle: No
    . 2018-03-21 09:21:47.253 Proxy: none
    . 2018-03-21 09:21:47.253 Send buffer: 262144
    . 2018-03-21 09:21:47.253 UTF: 2
    . 2018-03-21 09:21:47.253 FTP: FTPS: Explicit TLS; Passive: Yes [Force IP: A]; MLSD: A [List all: A]
    . 2018-03-21 09:21:47.253 Session reuse: Yes
    . 2018-03-21 09:21:47.253 TLS/SSL versions: TLSv1.0-TLSv1.2
    . 2018-03-21 09:21:47.253 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
    . 2018-03-21 09:21:47.253 Cache directory changes: Yes, Permanent: Yes
    . 2018-03-21 09:21:47.253 Timezone offset: 0h 0m
    . 2018-03-21 09:21:47.253 --------------------------------------------------------------------------
    . 2018-03-21 09:21:47.253 Connecting to ####.myfritz.net:47658 ...
    . 2018-03-21 09:21:47.285 Connected with ####.myfritz.net:47658, negotiating TLS connection...
    < 2018-03-21 09:21:47.380 220 FRITZ!Box7490 FTP server ready.

    2018-03-21 09:21:47.380 AUTH TLS
    < 2018-03-21 09:21:47.551 234 Authentication method accepted
    . 2018-03-21 09:21:48.253 Verifying certificate for "" with fingerprint ########################### and 18 failures
    . 2018-03-21 09:21:48.285 Certificate verified against Windows certificate store
    . 2018-03-21 09:21:48.285 Certificate common name "#######.myfritz.net" matches hostname
    . 2018-03-21 09:21:48.285 Using TLSv1.2, cipher TLSv1/SSLv3: ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
    . 2018-03-21 09:21:48.285 TLS connection established. Waiting for welcome message...
    2018-03-21 09:21:48.285 USER ###
    < 2018-03-21 09:21:48.411 331 Password required for ###.
    2018-03-21 09:21:48.411 PASS *****
    < 2018-03-21 09:21:48.505 230 User ### logged in.
    2018-03-21 09:21:48.505 SYST
    < 2018-03-21 09:21:48.536 215 UNIX Type: L8 Version: Linux 3.10.73
    2018-03-21 09:21:48.536 FEAT
    < 2018-03-21 09:21:48.567 211- Extensions supported:
    < 2018-03-21 09:21:48.801 UTF8
    < 2018-03-21 09:21:48.801 MDTM
    < 2018-03-21 09:21:48.801 SIZE
    < 2018-03-21 09:21:48.801 AUTH TLS
    < 2018-03-21 09:21:48.801 PBSZ
    < 2018-03-21 09:21:48.801 PROT
    < 2018-03-21 09:21:48.801 211 end
    2018-03-21 09:21:48.801 OPTS UTF8 ON
    < 2018-03-21 09:21:48.817 200 UTF8 ON
    2018-03-21 09:21:48.817 PBSZ 0
    < 2018-03-21 09:21:48.848 200 ok
    2018-03-21 09:21:48.848 PROT P
    < 2018-03-21 09:21:48.879 200 Data channel will be secured
    . 2018-03-21 09:21:48.879 Connected
    . 2018-03-21 09:21:48.879 --------------------------------------------------------------------------
    . 2018-03-21 09:21:48.879 Using FTP protocol.
    . 2018-03-21 09:21:48.879 Doing startup conversation with host.
    2018-03-21 09:21:48.879 PWD
    < 2018-03-21 09:21:48.910 257 "/" is current directory.
    . 2018-03-21 09:21:48.910 Getting current directory name.
    . 2018-03-21 09:21:48.910 Startup conversation with host finished.
    < 2018-03-21 09:21:48.910 Script: Active session: [1] ###@###.myfritz.net
    2018-03-21 09:21:48.910 Script: get "test.kdbx" "C:\Users###\AppData\Local\Temp\tmpADEE.tmp"
    . 2018-03-21 09:21:48.910 Listing file "test.kdbx".
    . 2018-03-21 09:21:48.910 Retrieving file information...
    2018-03-21 09:21:48.910 PWD
    < 2018-03-21 09:21:48.926 257 "/" is current directory.
    2018-03-21 09:21:48.926 CWD /test.kdbx
    < 2018-03-21 09:21:48.957 550 /test.kdbx: Not a directory.
    2018-03-21 09:21:48.957 TYPE I
    < 2018-03-21 09:21:48.988 200 Type set to I.
    2018-03-21 09:21:48.988 SIZE /test.kdbx
    < 2018-03-21 09:21:49.020 213 334414
    2018-03-21 09:21:49.020 MDTM /test.kdbx
    < 2018-03-21 09:21:49.035 550 /test.kdbx: No such file or directory
    . 2018-03-21 09:21:49.035 Could not retrieve file information
    < 2018-03-21 09:21:49.035 Script: Can't get attributes of file 'test.kdbx'.
    < 2018-03-21 09:21:49.035 Script: Could not retrieve file information

    < 2018-03-21 09:21:49.035 /test.kdbx: No such file or directory
    . 2018-03-21 09:21:49.035 Script: Failed
    . 2018-03-21 09:21:49.035 Script: Exit code: 1
    . 2018-03-21 09:21:49.035 Disconnected from server

     
  • Paul

    Paul - 2018-03-21

    Looks like the MDTM problem noted here.
    https://winscp.net/forum/viewtopic.php?t=22239

    cheers, Paul

     
  • Markus

    Markus - 2018-03-21

    ...which effectively means that this bug does not allow KeePass to access via WinSCP any files on AVM Fritzbox FTPS servers?

    Thanks for the hint, Paul!

    Is there any plugin other than the IOProtocol that supports FTPS? Couldn't find any so far...

     
  • Paul

    Paul - 2018-03-21

    IOProtocol is the only plug-in for FTPS at present. As it works most places it seems unlikely another one will be created.

    cheers, Paul

     
  • Mads

    Mads - 2018-03-26

    Dear all

    I have the same problem and finaly found a solution. In the advanced tab added the following command to "Raw settings" FtpUseMlsd=1. This will disable MDTM and use list instead which works.

    Best regards
    Mads

     
  • Markus

    Markus - 2018-03-27

    Hi Mads,

    Very interesting approach! However, doesn't seem to work with the Fritzbox FTPS server either, at least in my case (same error message)...

    Best,
    Markus

     
  • Mads

    Mads - 2018-03-27

    Hi Markus

    What does it say in the WinSCP logs?

     
  • Markus

    Markus - 2018-03-27

    Here's the log:

    . 2018-03-27 12:10:26.118 --------------------------------------------------------------------------
    . 2018-03-27 12:10:26.118 WinSCP Version 5.7.7 (Build 6257) (OS 6.1.7601 Service Pack 1 - Windows 7 Enterprise)
    . 2018-03-27 12:10:26.118 Configuration: C:\Users###\KeePass-2.38\IOProtocolExt_WinSCP\WinSCP.ini
    . 2018-03-27 12:10:26.118 Log level: Normal
    . 2018-03-27 12:10:26.118 Local account: ###
    . 2018-03-27 12:10:26.118 Working directory: C:\Users###\KeePass-2.38
    . 2018-03-27 12:10:26.118 Process ID: 8656
    . 2018-03-27 12:10:26.118 Command-line: "C:\Users###\KeePass-2.38\IOProtocolExt_WinSCP\WinSCP.exe" /console=577 /consoleinstance=_7940_193 "/script=C:\Users###\AppData\Local\Temp\tmp1E42.tmp"
    . 2018-03-27 12:10:26.118 Time zone: Current: GMT+2, Standard: GMT+1 (Mitteleuropäische Zeit), DST: GMT+2 (Mitteleuropäische Sommerzeit), DST Start: 25.03.2018, DST End: 28.10.2018
    . 2018-03-27 12:10:26.118 Login time: Dienstag, 27. März 2018 12:10:26
    . 2018-03-27 12:10:26.118 --------------------------------------------------------------------------
    . 2018-03-27 12:10:26.118 Script: Retrospectively logging previous script records:

    2018-03-27 12:10:26.118 Script: option echo off
    < 2018-03-27 12:10:26.118 Script: echo off
    2018-03-27 12:10:26.118 Script: option batch abort
    < 2018-03-27 12:10:26.118 Script: batch abort
    < 2018-03-27 12:10:26.118 Script: reconnecttime 120
    2018-03-27 12:10:26.118 Script: option confirm off
    < 2018-03-27 12:10:26.118 Script: confirm off
    2018-03-27 12:10:26.118 Script: option transfer binary
    < 2018-03-27 12:10:26.118 Script: transfer binary
    2018-03-27 12:10:26.118 Script: open ftps://###:@###.myfritz.net:47658 -explicit -certificate=* -rawsettings FtpUseMlsd=1
    . 2018-03-27 12:10:26.118 --------------------------------------------------------------------------
    . 2018-03-27 12:10:26.118 Session name: ###@###.myfritz.net (Ad-Hoc site)
    . 2018-03-27 12:10:26.118 Host name: ###.myfritz.net (Port: 47658)
    . 2018-03-27 12:10:26.118 User name: ### (Password: Yes, Key file: No)
    . 2018-03-27 12:10:26.118 Transfer Protocol: FTP
    . 2018-03-27 12:10:26.118 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
    . 2018-03-27 12:10:26.118 Disable Nagle: No
    . 2018-03-27 12:10:26.118 Proxy: none
    . 2018-03-27 12:10:26.118 Send buffer: 262144
    . 2018-03-27 12:10:26.118 UTF: 2
    . 2018-03-27 12:10:26.118 FTP: FTPS: Explicit TLS; Passive: Yes [Force IP: A]; MLSD: - [List all: A]
    . 2018-03-27 12:10:26.118 Session reuse: Yes
    . 2018-03-27 12:10:26.118 TLS/SSL versions: TLSv1.0-TLSv1.2
    . 2018-03-27 12:10:26.118 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
    . 2018-03-27 12:10:26.118 Cache directory changes: Yes, Permanent: Yes
    . 2018-03-27 12:10:26.118 Timezone offset: 0h 0m
    . 2018-03-27 12:10:26.118 --------------------------------------------------------------------------
    . 2018-03-27 12:10:26.118 Connecting to ###.myfritz.net:47658 ...
    . 2018-03-27 12:10:26.165 Connected with ###.myfritz.net:47658, negotiating TLS connection...
    < 2018-03-27 12:10:26.259 220 FRITZ!Box7490 FTP server ready.
    2018-03-27 12:10:26.259 AUTH TLS
    < 2018-03-27 12:10:26.415 234 Authentication method accepted
    . 2018-03-27 12:10:27.117 Verifying certificate for "" with fingerprint 67:21:0f:[...]:e6:b3:07:a8:e5 and 18 failures
    . 2018-03-27 12:10:27.163 Certificate verified against Windows certificate store
    . 2018-03-27 12:10:27.163 Certificate common name "###.myfritz.net" matches hostname
    . 2018-03-27 12:10:27.163 Using TLSv1.2, cipher TLSv1/SSLv3: ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
    . 2018-03-27 12:10:27.163 TLS connection established. Waiting for welcome message...
    2018-03-27 12:10:27.163 USER ###
    < 2018-03-27 12:10:27.273 331 Password required for ###.
    2018-03-27 12:10:27.273 PASS
    **
    < 2018-03-27 12:10:27.382 230 User ### logged in.
    2018-03-27 12:10:27.382 SYST
    < 2018-03-27 12:10:27.397 215 UNIX Type: L8 Version: Linux 3.10.73
    2018-03-27 12:10:27.397 FEAT
    < 2018-03-27 12:10:27.429 211- Extensions supported:
    < 2018-03-27 12:10:27.650 UTF8
    < 2018-03-27 12:10:27.650 MDTM
    < 2018-03-27 12:10:27.650 SIZE
    < 2018-03-27 12:10:27.650 AUTH TLS
    < 2018-03-27 12:10:27.650 PBSZ
    < 2018-03-27 12:10:27.650 PROT
    < 2018-03-27 12:10:27.650 211 end
    2018-03-27 12:10:27.650 OPTS UTF8 ON
    < 2018-03-27 12:10:27.681 200 UTF8 ON
    2018-03-27 12:10:27.681 PBSZ 0
    < 2018-03-27 12:10:27.712 200 ok
    2018-03-27 12:10:27.712 PROT P
    < 2018-03-27 12:10:27.744 200 Data channel will be secured
    . 2018-03-27 12:10:27.744 Connected
    . 2018-03-27 12:10:27.744 --------------------------------------------------------------------------
    . 2018-03-27 12:10:27.744 Using FTP protocol.
    . 2018-03-27 12:10:27.744 Doing startup conversation with host.
    2018-03-27 12:10:27.744 PWD
    < 2018-03-27 12:10:27.775 257 "/" is current directory.
    . 2018-03-27 12:10:27.775 Getting current directory name.
    . 2018-03-27 12:10:27.775 Startup conversation with host finished.
    < 2018-03-27 12:10:27.775 Script: Active session: [1] ###@###.myfritz.net
    2018-03-27 12:10:27.775 Script: get "test.kdbx" "C:\Users###\AppData\Local\Temp\tmp10C8.tmp"
    . 2018-03-27 12:10:27.775 Listing file "test.kdbx".
    . 2018-03-27 12:10:27.775 Retrieving file information...
    2018-03-27 12:10:27.775 PWD
    < 2018-03-27 12:10:27.822 257 "/" is current directory.
    2018-03-27 12:10:27.822 CWD /test.kdbx
    < 2018-03-27 12:10:27.837 550 /test.kdbx: Not a directory.
    2018-03-27 12:10:27.837 TYPE I
    < 2018-03-27 12:10:27.868 200 Type set to I.
    2018-03-27 12:10:27.868 SIZE /test.kdbx
    < 2018-03-27 12:10:27.900 213 334414
    2018-03-27 12:10:27.900 MDTM /test.kdbx
    < 2018-03-27 12:10:27.931 550 /test.kdbx: No such file or directory
    . 2018-03-27 12:10:27.931 Could not retrieve file information
    < 2018-03-27 12:10:27.931 Script: Can't get attributes of file 'test.kdbx'.
    < 2018-03-27 12:10:27.931 Script: Could not retrieve file information

    < 2018-03-27 12:10:27.931 /test.kdbx: No such file or directory
    . 2018-03-27 12:10:27.931 Script: Failed
    . 2018-03-27 12:10:27.931 Script: Exit code: 1
    . 2018-03-27 12:10:27.931 Disconnected from server

     
  • Mads

    Mads - 2018-03-27

    It looks like it still uses MDTM. How did you add the FtpUseMlsd argument?

     
  • Markus

    Markus - 2018-03-27

    In KeePass I entered "FtpUseMlsd=1" into the very last field of the "Advanced" tab, i.e. under "WinSCP (FTPS / SCP / SFTP) raw settings:".

    Or does that need to be entered in WinSCP itself?

     
  • Mads

    Mads - 2018-03-27

    Without the " right?

     
  • Markus

    Markus - 2018-03-27

    Correct.

     
  • Markus

    Markus - 2018-04-03

    Just installed the recent update of IOProtocol (v 1.13). Hoped that this issue had been fixed. Not yet the case unfortunately...

     
  • Dominik Reichl

    Dominik Reichl - 2018-04-03
    • status: open --> closed
     
  • Dominik Reichl

    Dominik Reichl - 2018-04-03

    As it can be seen from the WinSCP log (thanks for posting it), the command 'SIZE /test.kdbx' command succeeds, but the following command 'MDTM /test.kdbx' fails, even though the server claims to support MDTM (see answer to 'FEAT') and the file exists ('SIZE' command was answered). This looks like a server bug to me.

    I'm not aware of a way to tell WinSCP to ignore this error (as a workaround).

    Best regards,
    Dominik

     
  • Christian

    Christian - 2018-05-01

    Hi Dominik, as I wrote hear https://sourceforge.net/p/keepass/discussion/329221/thread/3c515cab/ it works without keepass, if I put an asterrix before the filename, but if I try to do it with keepass, then keepass can't find the file and give a correct error message. Perhaps it helps to have a special plugin of IOProtocol for a Fritzbox ?
    Best regards,
    Christian

     
  • Dominik Reichl

    Dominik Reichl - 2018-05-01

    Please try the following development snapshot of IOProtocolExt. It has an option 'Enable FRITZ!Box workaround' (on the 'Advanced' tab of the connection dialog, at the very bottom); when setting it to 'Yes', IOProtocolExt prepends an asterisk to the file name. Does this work?
    https://keepass.info/filepool/IOProtocolExt_180501.zip

    Thanks and best regards,
    Dominik

     
  • Markus

    Markus - 2018-05-01

    Domink - that works!! Where did you get that modified plugin from?!

    Thx so much!

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.