需要使用 delphi 应用程序引导 SSH 隧道

发布于 2024-09-28 19:37:13 字数 784 浏览 2 评论 0 原文

我创建了一个 Delphi 2010 应用程序。该地区的许多公司(从受信任的用户到不受信任的用户)都在使用它。该应用程序使用 MySQL MD5 加密密码对用户进行身份验证。接下来,应用程序需要通过 ftp 上传和下载许多文件。

事实是:任何网络嗅探器(例如 Ethereal 也称为 WireShark)都可以从我的应用程序的 ftp 部分获取我的普通用户和密码。加密的密码也可以被窃取,任何人都可以使用任何 ftp 应用程序登录到我的服务器并做出不愉快的事情。

[TindyFTP] 用于管理 FTP 连接本身。这个对象不支持 SFTP,我认为这可能是我的问题的结束。

DEVART 的[tMyMac] 用于管理 MYSQL 连接。

现在我的观点是什么: 使用 SSH 隧道来控制我的应用程序上的两种(ftp 和 mysql)事务类型的 IO 处理程序是一个好方法吗?我现在正在使用 DEVART 的 SecureBridge 进行一些测试,该测试兼容带有 MyDAC 组件和 TIndy。

我是否只需要连接到 SSH 隧道并使用 mysql 和 ftp 进行操作? 使用 SSH 隧道时是否还需要加密 ftp 密码? 对于 MySQL 部分,当我尝试使用 WireShark 拦截密码时,密码似乎被加密或混淆。

感谢您让我知道您的想法,而无需更改我的程序的所有结构,该程序已完成 99%:)

谢谢, 乔纳森

I created a Delphi 2010 application. It is use by many company in the region from trusted to untrusted users. The application authenticate users with MySQL behind MD5 encrypted password. Following this, the application need to upload and download many files trought ftp.

The fact is : any network sniffer (such as Ethereal also known as WireShark) can grab my plain user and password from the ftp part of my application. Encrypted password can also be grab and anyone can log with any ftp application to my server and make unpleaseant things.

[TindyFTP] is used to manage the FTP connexion itself. This object those not support SFTP which I tought that could be the end of my problem.

[tMyMac] from DEVART is used to manage MYSQL connexion.

What is my point by now :
It is a good way to use SSH Tunneling to control the IO Handler of both (ftp and mysql) transaction type onto my application ? I'm doing some test right now with SecureBridge from DEVART which is compatible with MyDAC component and TIndy.

Do I simply need to get connected to SSH Tunnel and go trought it with mysql and ftp ?
Do I also need to encrypt ftp password while using SSH Tunnel ?
For the MySQL part, the password seem to be encrypted or obfuscated when I try to intercept it with WireShark.

Thanks to let me know your idea from that point without changing all the structure of my program which is 99% completed :)

Thanks,
Jonathan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

本王不退位尔等都是臣 2024-10-05 19:37:13

首先,您需要确定您应该/可以使用什么协议。 FTP 不是 SFTP,并且基于 SSH 的 FTP 也没什么意义(尽管这是可能的)。让我们回顾一下选项:

  1. 使用 FTPS (FTP-over-SSL)。要求您的 FTP 服务器具有 SSL 证书,否则它是一个 vialbe 选项。缺点:不保护 MySQL 连接。
  2. 使用 FTP over SSH 隧道。如果可以使用 SFTP,不明白为什么有人会这样做。 Indy 和我们的 SecureBlackbox 产品可以通过 SSH 进行 FTP。
  3. 使用 SFTP(SSH 文件传输协议)传输文件并使用 SSH 端口转发来保护 MySQL 连接。从技术上讲,可以通过一个已建立的 SSH 会话来运行 SFTP 子系统和端口转发,以及我们的 SecureBlackbox< /a> 支持这一点。不过,我不了解 DevArt 的东西,因为他们的 SSH/SFTP 客户端还很年轻,并且可能有某些限制。

如果你有一个Linux服务器(MySQL建议你有),那么它有OpenSSH作为SSH服务器,并且OpenSSH有内置的SFTP服务器。如果你在 Windows 上运行 MySQL,你将很难在 Windows 上使用 OpenSSH 端口,而 Bitvise SSH 服务器将是一个更好的选择(我们自己在内部服务器上使用它)。

如果 SFTP 身份验证和加密是在 SSH 级别执行的,则不需要
不必担心进一步保护用于身份验证的密码——它已经通过 SSH 进行了保护。不过,您需要关心的是验证服务器向客户端提供的 SSH 密钥。您可以通过在客户端模块中存储服务器密钥的副本来完成此操作(请记住,您可能需要不时替换服务器密钥,因此不要在客户端模块中对其进行硬编码)。

如果您决定采用 FTP-over-SSH 路线(尽管我不明白为什么您需要这样做),您仍然不需要保护 FTP 密码,因为您将通过安全 SSH 隧道运行 FTP。

First you need to determine, what exactly protocol you should / can use. FTP is not SFTP, and FTP over SSH makes little sense as well (though it's possible). Let's review the options:

  1. use FTPS (FTP-over-SSL). Requires that your FTP server has SSL certificate, otherwise it's a vialbe option. Con: doesn't secure MySQL connection.
  2. use FTP over SSH tunnel. Don't see why one would do this if he can use SFTP. FTP over SSH is possible with Indy and our SecureBlackbox product.
  3. use SFTP (SSH File Transfer Protocol) to transfer files and use SSH port forwarding for securing MySQL connection. Technically it's possible to run both SFTP subsystem and port forwarding via one established SSH session, and our SecureBlackbox supports this. I don't know about DevArt stuff, though, because their SSH/SFTP client is quite young and can have certain limitations.

If you have a linux server (MySQL suggests that you do), then it has OpenSSH as an SSH server, and OpenSSH has built-in SFTP server. If you run MySQL on windows, you will have hard time using OpenSSH ports on Windows, and Bitvise SSH server would be a better option (we use it ourselves on our internal server).

In case of SFTP authentication and encryption is performed on SSH level and you don't need
to bother further securing password used for authentication -- it's already secured with SSH. What you need to care about though is verify the SSH key, presented by the server to the client. You can do this by storing a copy of the server key in the client module (remember that you might need to replace the server key from time to time, so don't hard-code it in the client module).

If you decide to go FTP-over-SSH route (though I don't see why you'd need this), you still don't need to secure FTP password as you will be running FTP over secure SSH tunnel.

爱她像谁 2024-10-05 19:37:13

Indy 10 中的 TIdFTP 确实支持连接级别 (SSL/TLS) 和登录凭据级别 (SASL) 的加密。

TIdFTP in Indy 10 DOES support encryption, both at the connection level (SSL/TLS) and the login credential level (SASL).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文