Questions tagged [jnetpcap]

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

Links

129 questions
0
votes
1 answer

Java Pcap loop not starting

I using jnetpcap library for listening to network traffic, and basically using the PcapPacketHandlers for listening to packets, after initializing them I start a pcap.loop() method so it will start listening. However about 50% of the time when I run…
0
votes
0 answers

JnetPcap pcap.loop issues

I'm using JNetPcap to capture packets from a pcap file in Java. The code works fine sometimes, but other times it doesn't capture any packets even though the pcap file is full of packets. Here's my code: import org.jnetpcap.Pcap; import…
elnino17
  • 31
  • 1
0
votes
0 answers

same JNetPcap code to capture packets works inconsistently

I have this simple Java code that uses Jnetpcap to capture packets and print them. public class App { public static void main(String[] args) throws Exception { ArrayList alldevs = new ArrayList(); // Will be filled with…
0
votes
0 answers

error: is not abstract and does not override abstract method nextPacket(JPacket,Object) in JPacketHandler

During running this java code of calculating packets from pcaps file. : // Counting the number of packets in pcap files. // User defined package //package jnt; import java.io.File; import org.jnetpcap.Pcap; import…
0
votes
0 answers

JnetPcap java.lang.NullPointerException

So I am taking part in a CTF and we are required to send a command to a server to make it reboot itself, the twist is the target only accepts requests from a specific ip addr so we are meant to be "spoofing" our addr to make this work, now as I am…
Aasil
  • 103
  • 5
0
votes
0 answers

How to read rtp stream in a particular port using jnetpcap

I am trying to capture all rtp packets received in a particular port. I already know through which excat port I am receiving the packets (for generating rtp packets I am using vlc stream option). I want to use jnetpcap for easy processing. Or is…
0
votes
0 answers

Null Pointer Exception in udp headers line: "Udp udp = packet.getHeader(new Udp());" Why JNETPCAP can't initialize the Udp object

I am trying to create a raw socket using jnetpcap jar files to do IP spoofing in java using UDP protocol. When I tried the below code, I got a null pointer exception in object creation for the udp header. I decompiled the class files in the jar…
0
votes
1 answer

How to Block Windows OS automatic RST packet right after TCP handshake

Here's my Code: import com.github.ffalcinelli.jdivert.WinDivert; import com.github.ffalcinelli.jdivert.exceptions.WinDivertException; public class blocker { public static void main(String[] args) throws WinDivertException { WinDivert w…
RiptimRip
  • 11
  • 1
  • 3
0
votes
0 answers

Convert G711 alaw or G711 ulaw byte array to audio file [.wav or .au ]

I'm developing an application for recording , so I'm trying to decode trafic rtp using library Jnetpcap . The codec provided have in general two types : G711 alaw or G711 ulaw . I convert the payload and save it as a wav file but i can't listen the…
tintin
  • 11
  • 5
0
votes
0 answers

How to extract DNS data from packet using jnetpcap

I'm using jnetpcap to made an application for android, and I know how to extract most of the information that I need, but I can't get the DNS packets. I know to extract DNS packet first need to look at UDP port 53, but when I reach that point I…
lcpr_phoenix
  • 373
  • 4
  • 15
0
votes
1 answer

Sniffing network traffic in java

Referring to: How could I sniff network traffic in Java? I managed to get the sniffer to work with various APIs mentioned there (jNetPcap seems to work best for me). However I struggle to make the payload actually readable, as it is in gzip…
No. 7892142
  • 121
  • 4
0
votes
1 answer

JNetPcap Capture Packages No IPs returned

I have this code from here https://javatutorial.net/capture-network-packages-java But it does not return the src or destination ips. I can see the ip via System.out.println("packet.getHeader(ip)"); …
Sein3i8
  • 133
  • 1
  • 1
  • 10
0
votes
0 answers

jnetpcap ICMP JBuffer Exception

hey i am trying to capture all ICMP Traffic and i stack with this exception: Opening file for reading: tmp-capture-file.pcap Src: 192.168.1.15 Dst: 192.168.1.22 Exception in thread "main" java.lang.NullPointerException at…
Daniel Mamary
  • 29
  • 1
  • 6
0
votes
1 answer

jnetpcap dependency for multiple OSes

I'm trying to write a program that uses jnetpcap and fits both linux and windows. I compile my program using Maven. Currently the dependency to jnetpcap is:
t0m9er
  • 143
  • 2
  • 11
0
votes
1 answer

JnetPcap: reading from offline file very slow

I'm building a sort of custom version of wireshark with jnetpcap v1.4r1425. I just want to open offline pcap files and display them in my tableview, which works great except for the speed. The files I open are around 100mb with 700k packages. public…
banzai
  • 55
  • 1
  • 8
1 2 3
8 9