0

Is it possible to create a java class using JPCAP that capture all the packets destined to a particular IP address? Like if i need to capture all the packets destined to my router .. is it possible ?

Shurmajee
  • 1,027
  • 3
  • 12
  • 35

1 Answers1

0

Yes It is..

  • Packet capturing using jpcap (or any such library) allows the user to open the Ethernet interface in two different modes.
  • In promiscuous mode, you can capture every packet from the wire, i.e., even if its source or destination MAC address is not same as the MAC address of the interface you are opening.
  • In non-promiscuous mode, you can only capture packets send and received by your host.
  • In order to catch all the packets passing through your router you need to tell your program to open the Ethernet interface in promiscuous mode.
  • This will enable you to capture all the packets flowing in the network.Later you will need to filter these packets according to your router's IP address.
Shurmajee
  • 1,027
  • 3
  • 12
  • 35
  • Your wright about the diffrent modes, but about the filtering, you can't filter for ip addresses you can use the filter technique to listen for TCP/IP packets for example. – user1941212 Feb 14 '13 at 14:25
  • yes you can filter them at the time of capturing or after storing the captured packets in a file and then parsing the file – Shurmajee Feb 15 '13 at 03:54