Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

tcp packet scanner

Posted on 2012-03-29
1
Medium Priority
?
522 Views
Last Modified: 2012-03-30
Hi

I am creating a kern module that scans the network and displays packet information

I want to display the remote port numbers, however i can only find how to display local port numbers (tcphdr->dest and tcphdr->source) Can anyone help?

also how can i display the packet data in hex?
0
Comment
Question by:codey-06
1 Comment
 
LVL 53

Accepted Solution

by:
Infinity08 earned 2000 total points
ID: 37785966
>> however i can only find how to display local port numbers (tcphdr->dest and tcphdr->source)

One of these is the local port, and the other is the remote port. Which is which depends on the direction the packet travelled.


>> also how can i display the packet data in hex?

The data can be found immediately after the TCP header. Just skip the appropriate amount of bytes (using tcphdr->doff), and display the data found there in hex.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
Six Sigma Control Plans

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question