使用SharpPcap解码数据包 [英] Decode packet with SharpPcap

查看:462
本文介绍了使用SharpPcap解码数据包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用SharpPcap库来嗅探特定设备上的数据包.我以前从未真正使用过原始套接字,有些困惑.我很好地捕获了数据包,但是现在我想将数据包数据解码为可读的字符串.基本上,我要实现的是读取正在发送和接收的原始HTML请求.

我收到的数据是一个byte [],并且我已经尝试使用提供的.Net方法将所有基本byte []转换为字符串方法.如果曾经使用SharpPcap的人做到了这一点,还是有人知道该怎么做?

预先感谢,

-Dom

Hi,

I am using the SharpPcap library to sniff packets on a particular device. I have never really worked with raw sockets before and am a bit confused. I am capturing the packets fine, but now I want to decode the packet data into a string that is readable. Basically, what I want to achieve is reading the raw HTML requests that are being sent and received.

The data I receive is a byte[], and I have tried all of the basic byte[] to string methods with the .Net methods provided. If someone who has used SharpPcap achieved this, or does someone know how to do this?

Thanks in advance,

-Dom

推荐答案



我引用Packet.Net

"Packet.Net是一个高性能的.Net程序集,用于解剖和构造网络数据包,例如以太网,ip,tcp,udp等.

Packet.Net最初是在SharpPcap中重写数据包解析器,目的是使API更加一致和文档化.

Packet.Net现在从SharpPcap v3.0.0开始为SharpPcap提供数据包解析功能."


http://sourceforge.net/apps/mediawiki/packetnet/index.php?title=Main_Page [^ ]

绝对同意,SharpPcap的文档很少.

我认为您可以使用packet.net api并读取tcp包轻松实现它.

致以最诚挚的问候
Hi,

I''m quoting from Packet.Net

"Packet.Net is a high performance .Net assembly for dissecting and constructing network packets such as ethernet, ip, tcp, udp etc.

Packet.Net started as a rewrite of the packet parser in SharpPcap with the goal of making a more consistent and better documented API.

Packet.Net now provides the packet parsing functionality for SharpPcap as of SharpPcap v3.0.0."


http://sourceforge.net/apps/mediawiki/packetnet/index.php?title=Main_Page[^]

Absolutly agree, SharpPcap''s documentation is very less.

I think you''re easily able to achieve it with packet.net api and reading tcp packages.

With Best Regards


这篇关于使用SharpPcap解码数据包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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