views:

60

answers:

3

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??

+1  A: 

No, we cannot. And the reason is simple, we don't know what application you are sniffing.

That stream of data could mean anything.

But, I suggest you print the data in hexadecimal. Maybe the data would make more sense.

karlphillip
+3  A: 

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.

David Gladfelter
A: 

i tried this one System.Text.Encoding.ASCII.GetString(tcpHeader.Data) and I'm able to get the data...but when i run it and wait for the data(it's in XML format) i got it in many packets the it's hard to reread it again... what should i do? do i have to collect the data from every packets then add it all to get the whole message? or is there is a library to do that in the .net

Ramah