Questions tagged [jnetpcap]

jNetPcap is an open-source Java wrapper for nearly all libpcap library native calls.

Links

129 questions
0
votes
1 answer

get website name from packet using Jnetpcap

I've asked this to Jnetpcap forum. And didn't get any response. I've been trying to get the website name from the request/ response packet. This is what I've tried: PcapPacketHandler jpacketHandler = new PcapPacketHandler() { …
user2112371
  • 31
  • 2
  • 10
0
votes
1 answer

"error reading dump file: Permission denied" Jnetpcap API on windows

I'm using Jnetpcap 1.3.0 version for extracting the pcap file. Below is my code snippet /* Main Class */ public class Proceed{ public static void main(String[] args) { PCapFile pcapFile = new PCapFile("C:/test/no-gre-sample.pcap"); …
user102964
  • 21
  • 3
0
votes
1 answer

Java = Building packets from scratch with Jnetpcap

I'm trying to build a packet using jnetpcap, according to the packets I receive. I'm currently using jnetpcap-1.4.r1425, and am running into several problems. The following code is common to all my problems: JPacket wPacket = new…
Cong Hui
  • 202
  • 5
  • 16
0
votes
2 answers

NoClassDefFoundError with classpath

I'm attempting to run a program using the command: java Honey -cp ../../jnetpcap-1.3.0/jnetpcap.jar and am getting the title error: Exception in thread "main" java.lang.NoClassDefFoundError: org/jnetpcap/Pcap at…
Cong Hui
  • 202
  • 5
  • 16
0
votes
1 answer

jnetpcap to capture HTTPS traffic

I am developing a simple Sniffer system for the first time using jnetpcap. I adapted some codes and I can currently read HTTP traffic (port 80) and print its fields. private void packetHandler(){ jpacketHandler = new PcapPacketHandler()…
Marcos Valle
  • 77
  • 2
  • 11
0
votes
2 answers

jnetpcap: can't create PcapPacket using byte array on ubuntu

I'm trying to run this code which just take a HexString of bytes transform it to a byte array and try to create a PcapPacket from this array: import org.jnetpcap.packet.PcapPacket; public class PcapTest { public static void main(String[] args)…
user1928596
  • 1,503
  • 16
  • 21
0
votes
1 answer

Jnetpcap Payload modify in UDP packet

i would modify the content of Data in the UDP Packet read from a pcap file and send it on the network. In the following example i write a string "User data" and it work correctly but if my data require more space than the previous payload opened, i…
0
votes
0 answers

Jnetpcap UDP Recalculate Checksum

i'm trying to recalculate UDP Checksum on a packet where i changed IPD destination, but the function udp checksum seems to doesn't accept any parameter,i'm using jnetpcap 1.4 Pcap pcap_off = Pcap.openOffline(fileName, errorBuf); //open…
0
votes
0 answers

tomcat on ubuntu jnetpcap native library *.so unable to load

I want to deploy my application on to tomcat which has a pcap parsing ability. The module was running fine on eclipse / terminal. On tomcat i see the error as below. I have tried the following steps to resolve this issue: Add jnetpcap.jar and *.so…
Raghuveer
  • 2,859
  • 7
  • 34
  • 66
0
votes
1 answer

Tomcat: java.lang.UnsatisfiedLinkError: no jnetpcap in java.library.path

I'm getting the following error when deploying my application to Tomcat: I have added the jnetpcap jar file to the lib folder of Tomcat. I have also added it to my classpath in eclipse. I am deploying my application as a WAR file built using…
C_B
  • 2,620
  • 3
  • 23
  • 45
0
votes
1 answer

Decoding ARP packets using jnetpcap library

The following error occured while trying to read packets using jnetpcap library. What could be the reason ? ERROR actor.OneForOneStrategy: org.jnetpcap.protocol.network.Ip4java.io.NotSerializableException: org.jnetpcap.protocol.network.Ip4 at…
user3823859
  • 469
  • 1
  • 7
  • 20
0
votes
1 answer

jNetPcap Packet discard if coming from specific IP address

I am trying to filter the packet and discard if expression matches the situation. I mean to say that If packet is coming from 192.168.1.100, It should not get deliver to the destination(which is 192.168.1.119).
PcapBpfProgram program = new…
0
votes
1 answer

issue with tcp reassembly

I am getting packet segments in two parts.I am able to see it in wireshark as tcp reassembled.After searching on google i found out about dont fragment bit set for fragmented data.but it is not set even for fragmented data.i am using java jnetpcap…
saifjunaid
  • 65
  • 1
  • 1
  • 11
0
votes
1 answer

Java jnetpcap IndexOutOfBoundsEcxeption payload

if (packet.hasHeader(ip)) { String str = FormatUtils.ip(ip.source()); if (packet.hasHeader(Payload.ID)) { try{ payload = packet.getHeader(new Payload()); } catch(Exception…
0
votes
1 answer

Encoding and Decoding of Pcap Packets

I need to convert packets to byte format and decode it . How is it possible to convert packets captured using jnetpcap library to array[bytes] and vice-versa in Java?
user3823859
  • 469
  • 1
  • 7
  • 20
1 2 3
8 9