更改已编译应用程序中的嵌入目标端口

发布于 2024-12-03 20:29:04 字数 173 浏览 2 评论 0原文

我有一个已编译的客户端应用程序,没有源代码。它通过 TCP 连接到我的服务器的端口 7777(这是目的地)。我想更改应用程序以使用不同的端口,但客户端上没有设置可以轻松更改它。这让我相信它是硬编码到应用程序中的。

我已经搞砸了一点,但我不是专业的逆向工程师,事实证明这对我来说太难独自解决了。我想要完成的事情可能吗?

I have a compiled client application without the source code. It connects via TCP to my server on port 7777 (this is the destination). I would like to change the application to use a different port and there is no settings on the client to change it easily. This leads me to believe that it is hard-coded into the application.

I have messed around a little bit with it but I am not a professional reverse-engineer and this proves to be too difficult for me to figure out alone. Is what I am trying to accomplish even possible?

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

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

发布评论

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

评论(3

姐不稀罕 2024-12-10 20:29:05

没有源代码你是如何编译的?这个问题放在一边。

在二进制编辑器中查找 7777(十六进制 1e61)即 1e 后跟 61(或反之亦然)并更改它。

How did you compile this without the source code? That question aside.

Look for 7777 (hex 1e61) i.e. 1e followed by 61 (or the other way around) in a binary editor and change it.

一杯敬自由 2024-12-10 20:29:05

这将取决于平台和可用的工具。如果您可以在您的环境中使用 strace,您可以处理输出并确定端口打开的位置,并利用该信息返回二进制文件,反汇编它,找到进行调用的函数,并尝试确定端口号是如何到达那里的。

This will depend on the platform and the available tools. If you can use strace on your environment, you can process the output and determine where the port is opened, and with that information go back to the binary, disassemble it, locate the function that is making the call, and try to determine how the port number got there.

一影成城 2024-12-10 20:29:05

您可以使用 socat 创建 TCP 转发代理。来自 socat 示例

socat TCP4-LISTEN:www TCP4:www.domain.org:www

安装一个简单的 TCP 端口转发器。使用 TCP4-LISTEN,它会侦听本地端口“www”,直到连接到来,接受它,然后连接到远程主机 (TCP4) 并开始数据传输。它不会接受第二个连接。

与使用 iptables 相比,这种方法不太灵活,因为 socat 代理必须在客户端连接的服务器上运行。

You can use socat to create a TCP forwarding proxy. From socat examples:

socat TCP4-LISTEN:www TCP4:www.domain.org:www

installs a simple TCP port forwarder. With TCP4-LISTEN it listens on local port "www" until a connection comes in, accepts it, then connects to the remote host (TCP4) and starts data transfer. It will not accept a econd connection.

It is a less flexible approach than using iptables because the socat proxy must run on that server your client connects to.

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