如何在 Ruby 中使用 RAW 套接字?
我正在尝试使用 Ruby 创建一个原始套接字。
问题是,那里没有任何所谓的“原始套接字”,另一方面,Socket 类本身没有完整的文档记录。
有没有人有 Ruby 中这种套接字的一些代码示例,或者可能有某种文档?
顺便说一句,我已经知道如何使用 TCPSocket 和 TCPServer 类,并且我特别需要一个原始套接字。
I'm trying to create a raw socket using Ruby.
The problem is, there isn't anything called "raw socket" there and, on the other hand, the Socket class itself is not fully documented.
Does anybody have some code samples for that kind of socket in Ruby, or maybe some kind of a documentation for that?
By the way, I already know how to work with TCPSocket and TCPServer classes, and what I need is particularly a raw socket.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Google 得出以下结果: http://www.ruby-forum.com/topic/90408
简短版本:
有关各种 Socket 类的更多文档: http://www.rubycentral .com/pickaxe/lib_network.html
(整个原始套接字在 unices 上相当令人讨厌,因为它通常需要 root 访问权限。我没有测试这段代码。如果您是这样,您可能需要自己构建整个数据包不使用 IPSocket)
Google brings up the following result: http://www.ruby-forum.com/topic/90408
Short version:
More documentation on the various Socket classes: http://www.rubycentral.com/pickaxe/lib_network.html
(The whole raw sockets thing is rather nasty on unices since it usually requires root access. I did not test this code. You may need to construct the whole packet yourself if you're not using IPSocket)
看看球拍 gem (https://rubygems.org/gems/racket)。自从 2009 年发布最后一个版本以来,它似乎有点过时了,但它也在 Metasploit 框架中使用。
Have a look at the racket gem (https://rubygems.org/gems/racket). It seems to be a bit outdated since the last version was released in 2009 but its also used in the metasploit framework.
看看 PacketFu。它被 Metasploit 项目维护和使用得很好。
Have a look at PacketFu. It is very well maintained and used by the Metasploit Project.