tcp packet scanner

Posted on 2012-03-29
Last Modified: 2012-03-30

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?
Question by:codey-06
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 53

Accepted Solution

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.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
convert Systemjs to Webpack 3 129
Secondary drive is failing... D Volume 11 98
$_GET call between URL 3 70
upload values via post via proxy 1 19
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

751 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