Protocol Analysis

Telnet data

I have successfully read a pcap file offline following the guideline in the website. But how can I judge whether the packet is using a telnet protocol and how can I extract the Telnet->Data field from the packet?
Unlike IP,TCP, I can peer and get the JHeader object with "if(packet.hasHeader(new Ip4()))".
My original thought was get the last header(payload) from the following code:

int last = packet.getHeaderCount() - 1;
		JHeader header = null;
		System.out.println( packet.getHeaderIdByIndex(last) );
		System.out.println( Payload.ID );
		if( packet.getHeaderIdByIndex( last )==Payload.ID )
		{
			header =  JHeaderPool.getDefault().getHeader(packet.getHeaderIdByIndex(last));
			packet.getHeaderByIndex(last, header);
		}
		return header;

But it is not quite true. Because I cannot tell whether the payload is telnet data or any other data.
Could anyone help me with this issue.
Thanks a million!

comparision of two pcap files

Hi every one,

I am a novice to jnetpcap.
1. Please guide me how to install jnetpcap in linux 12.10
2. My task is to compare packets of two pcap files which are one is online and other is offline. How this cab be done?
Thanks in advance.

TCAP/CAMEL protocol in jNetPcap

Syndicate content