更改已编译应用程序中的嵌入目标端口
我有一个已编译的客户端应用程序,没有源代码。它通过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
没有源代码你是如何编译的?这个问题放在一边。
在二进制编辑器中查找 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.
这将取决于平台和可用的工具。如果您可以在您的环境中使用 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.您可以使用 socat 创建 TCP 转发代理。来自 socat 示例:
与使用 iptables 相比,这种方法不太灵活,因为 socat 代理必须在客户端连接的服务器上运行。
You can use socat to create a TCP forwarding proxy. From socat examples:
It is a less flexible approach than using
iptables
because the socat proxy must run on that server your client connects to.