通过 tcp 读取嗅探数据 [英] read sniffing data over tcp

查看:18
本文介绍了通过 tcp 读取嗅探数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发应用程序,它正在侦听来自 pc 的数据并将其存储在数据库中当我尝试使用任何嗅探软件时,它会解码数据并且我可以读取它...但在我的代码中......我根本看不懂它以这样的格式出现

<预> <代码> 1822262151622341817118815518211616121520941131921572041519912321413018224510453482062312258624219217426213385792952422362282081777270129716688629114817282188771708157542505055171418651781981425595109572128317191993018793431541418175198551682143218916536118562071014546919618158204181231187237183188160147127165111798312311810419822146114761993113815821216617541542372062129733198212250147199288115346102031191275215728146245198190171121209115149107193226253199151253205183146112072202559697791491441131572351381412278441552554817712614110121823714822712523618924690185291182071331471286244143181469018522814822821118012620321315924832238219115405615512392145202385512115735771691111055935782371281492476567165158924021493139815144225143762294713291762001113814720516216041120169912317914878167571392103510118386589521910621319622274158971538465206168139190127867123282255271781242497522124211517622131122113236255230254211206911242051832545515823012124925217318223920523316923122925514321122343602492471242…………

谁能告诉我这是什么类型的数据以及解决它的代码??

解决方案

要查看真正的数据包嗅探器长什么样,请查看 WireShark.TCP上有许多不同的协议,其中许多是二进制的.那些不使用的可能使用的是 unicode 字符,它们是两字节字符,因此它们的 ascii 显示将毫无意义.

无论如何,您显示的数据毫无意义.它看起来像十进制数据,您是否连接了一堆二进制流的十进制表示,解释为字节或整数值?这样就可以解释了.您应该首先通过 System.TextEncoding.ASCII.Decode 运行流.您可能会看到一些可识别的字符串.那就试试System.TextEncoding.Unicode.Decode

i'm developing application that is listening to the data coming to the pc and store it in a db when i'm trying to use any sniffing software it decode the data and i can read it... but in my code ....i cant read it at all it come in a format like that

1822262151622341817118815518211616121520941131921572041519912321413018224510453482062312258624219217426213385792952422362282081777270129716688629114817282188771708157542505055171418651781981425595109572128317191993018793431541418175198551682143218916536118562071014546919618158204181231187237183188160147127165111798312311810419822146114761993113815821216617541542372062129733198212250147199288115346102031191275215728146245198190171121209115149107193226253199151253205183146112072202559697791491441131572351381412278441552554817712614110121823714822712523618924690185291182071331471286244143181469018522814822821118012620321315924832238219115405615512392145202385512115735771691111055935782371281492476567165158924021493139815144225143762294713291762001113814720516216041120169912317914878167571392103510118386589521910621319622274158971538465206168139190127867123282255271781242497522124211517622131122113236255230254211206911242051832545515823012124925217318223920523316923122925514321122343602492471242........

can any one tell me what kind of data is that and any code to solve it out??

解决方案

To see what a real packet sniffer looks like, check out WireShark. There are many different protocols over TCP, and many of them are binary. Those that aren't may be using unicode characters, which are two-byte characters so an ascii display of them would be meaningless.

Anyway, the data you're displaying is pretty meaningless. It looks like decimal data, are you concatenating a bunch of decimal representations of the binary stream interpreted as byte or integer values? That would explain it. You should start by running the stream through System.TextEncoding.ASCII.Decode You'll probably see some recognizable strings. Then try System.TextEncoding.Unicode.Decode, etc.

这篇关于通过 tcp 读取嗅探数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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