How could I capture wire shark traces on loop back interface? - capture

How can I capture wireshark traces on the interface it is configured to capture the traces?

The way you capture a trace on the lo interface with Wireshark is that you select the lo interface from the list of interfaces Wireshark offers. (If it doesn't offer any interface, there's a permissions problem; see the Linux section of the CapturePrivileges page on the Wireshark Wiki for information on that.)

Related

What is knet interface and what is it used for?

Can some expert please throw some light on what is knet interface and what is it used for.
One of my container images show knet2 as an interface for output of 'ifconfig'
I have no idea what it is, can someone please explain or point me to documents / web where I can find more about it.
knet is kernel network interface for efficient of packet exchange between switch and the kernel (linux operating system) network protocol stack.
There could be other methods which could used, such as implementing a software connector module over the Open NSL Rx/TX APIs.
The intent of theknet interface is to provide a network interface that
then delivers packets to the NetIO framework from the kernel.
this is nicely explained in user-networking.pdf.
I hope this is what you were expecting. feel free to comment for any clarification.
this is about knet reference
This module implements a Linux network driver for Broadcom
XGS switch devices. The driver simultaneously serves a
number of vitual Linux network devices and a Tx/Rx API
implemented in user space.
Packets received from the switch device are sent to either
a virtual Linux network device or the user mode Rx API
based on a set of packet filters.susp
Packets from the virtual Linux network devices and the user
mode Tx API are multiplexed with priority given to the Tx API

Monitoring eth0 using libudev in Qt wrapper class

I need to display the status of the ethernet connection (eth0) on the GUI, i.e. is the link up or not.
I have a Davicom DM9000 PHY.
I know there are various ways to skin this cat, like parsing ifconfig, polling /sys/class/net/eth0/operstate, etc.
However, as I will need to monitor other devices also, like USB, I would like to use libudev for this as a more generic implementation.
Furthermore, I would like to use the monitor mechanism (using a select() ) and in doing so prevent having to poll.
I have wrapped the libudev functionality in a Qt class and intend on using signal/slot mechanisms to indicate events to my program.
Problem is, I can't seem to generate UDEV events from eth0 no matter what.
I have also tried using
udevadm monitor
but no events either when unplugging my ethernet cable.
I don't think my code is too far off, because I am able to generate events for USB (hidraw) devices by unplugging my keyboard, for example.
Also, I am able to see eth0's attributes using the libudev enumerate mechanism (but this is a polling process)
My question - is this possible, i.e. to use libudev's udev_monitor functions to catch events on eth0?
Sorry for the long post.
Have already looked at D-bus? Via D-Bus and underlying services you can get all the info you need. See this a little bit outdated article to understand the concept. See Qt/D-Bus documentation.

Using Cain and Abel to capture traffic of machine in the same network

I have installed Cain and Able in a machine(A). Machine A is connected to another machine via lan(B). Now I want to analyze all the traffic of machine B. Is this possible by installing Cain and Abel on machine A?
EDIT
After truing a bit more - cain and abel is able to sniff packets of the machine B. But the problem is How do I view the packets. It only shows the number of packets captured/sniffed.
Ash,
As we discussed in chat while Cain is a great tool for ARP poisoning , Wireshark is far a better tool for analysis. Good news is when you are using Cain to recieve the ARP poisoned packets you can also use Wireshark and sniff the packets at the same time.
Get the binary here http://www.wireshark.org/
Once you have begun poisoning with cain simply select the same interface you are poisoning from in Wireshark and click start capture. This view will be far superior to what you could see when using Cain.
Of note, know there are other ARP cache poisoning programs out there that are more purpose built for this sort of application. One of the best I have found is ettercap. It will also work very well with Wireshark or any other sniffer you choose to employ.
I hope our discussion helped.
dc

Ethernet Linux Control

I'm new on work with linux. I want capture the ethernet packets above the device drivers layer.
I know that all the packets pass through the functions "dev_queue_xmit" to transmit the packet to the upper layer and the function "netfi_rx" for recieving the packet.
How can i "hook" this function to control the ethernet traffic?
what should i work with to accomplish this task?
You might want to check out libpcap (a portable C/C++ library for network traffic capture). There is also an example.
You might want to use raw sockets. http://aschauf.landshut.org/fh/linux/udp_vs_raw/ch01s03.html
See also this question

Program to capture data and address connected by a certain program

I need to capture the remote addresses that a program connects to and the data that it sends and receives on Win 7. any suggestion for the program I can choose?
Use Wireshark (which includes the libpcap packet capture library). Wireshark provides a packet sniffer GUI and a number of analysis tools that will summarize traffic by endpoint(s), protocols, and other characteristics. http://www.wireshark.org/

Resources