java劫持套接字可能吗? [英] java hijack socket possible?

查看:139
本文介绍了java劫持套接字可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我突然发现自己想知道这个问题,是否有可能在java中劫持套接字?

I suddenly find myself wondering this question, is it possible in java to hijack a socket?

说服务器正在侦听端口5000,是否可以编写一个java程序来监听端口5000,并通过端口5000将相同的数据转发到服务器。

say a server is listening on port 5000, would it be possible to write a java programme to listen on port 5000, and forward the same data to the server via port 5000.

这样做会涉及到什么?我觉得这涉及编写一个新的网络驱动程序,将数据传递给java编程,然后进行一些处理并将其传递回驱动程序,然后再将其发送到服务器。当然所有这些处理也可以在驱动程序代码本身中完成〜

What would be involved in doing this? I feel this involves writing a new network driver that would pass the data to the java prog, which then does some processing and pass it back to the driver before sending it to the server. Of course all this processing could just as well be done in the driver code itself~

只是出于好奇,你会如何为windows noob编写这个驱动程序?

And just out of curiosity, how would you approach writing this driver for a windows noob?

推荐答案

网络套接字由操作系统管理,操作系统不允许您绑定到已在使用的套接字。所以是的,你需要在网络驱动程序级别上做一些诡计。

Network sockets are managed by the operating system, and the OS will not let you bind to a socket that is already in use. So yes, you would need to do some trickery on the network driver level.

这篇关于java劫持套接字可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆