Solved

tcp packet scanner

Posted on 2012-03-29
1
484 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 500 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now