What is needed to make a packet capture system? [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm wondering what it would take (skills wise) to make a packet capture system that collects the destination of the packets and stores them, so any help would be appreciated!
I'm hoping to do it in Python or Java, if that helps.

What you're trying to develop already exists for many years, and with multiple implementations:
Wireshark
TCPDump.
Both applications can write the packets in the PCAP format. Bear in mind that these applications require root access and privileges as they ask the kernel to fork the incoming packets to your application.

I Think you need something like jpcap and jNetpcap is wrapping in java.
check out below links :
sniff network traffic in java
full example of network sniffing in java

Related

How to write a C or Java application to handle TCP SYN requests [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to handle TCP SYN requests from users to denied some invalid requests to web server (Apache) on a CentOS server
How to write an application in C++ or Java or any programming languages?
You can create a netfilter kernel module (in C language), and hook yourself for various packet events such as receiving a packet on a particular interface etc. You will need to check the packet header to figure out whether it is a TCP SYN request, and then decide what to do with it.
https://www.netfilter.org/
You cannot create a user mode C++ or Java program to achieve this.
That being the answer for what you are asking, perhaps a better alternative would be to add rules to the firewall depending on what invalid requests you want to disable.

Best way to transmit data between two applications [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
What is the best way to transmit data between two (Java) applications running on the same machine? One obvious idea would be to use standard Sockets but this doesn't feel right.
I've heard that most operating systems have a built-in system specifically for this task. How is it called and how does it work?
And is there any other good method to do something like that?
I think it depends on what you want to communicate between the applications and the size of your project. Some examples:
Sharing of state - use a database, files or similar
Messaging - use a socket. On top of a socket you have several technologies you can leverage, like HTTP/REST, but you can also create your own transport
There are also message applications you can leverage, like RabbitMQ

Socket streaming in java using eclipse for windows [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm working on a project to simulate skype app through lan which requires socket implementation if I'm to use java. There is no particular information available in the web on how to work on this subject. Any valuable tips are welcomed or suggestions are entertained.
Thanks in advance.
You've likely seen this, but Oracle provides some pretty in-depth documentation on sockets in Lesson: All About Sockets
In this series of lessons, you're shown how to read from and write to sockets in Java, thus sending data to and receiving data from the computer you're connected to. Perhaps you could start with something simple like sending audio files over LAN, then see if you can actively write audio to the socket which could then be read and played on the receiving machine.
EDIT: Good 'ol Bucky has a video on building an IM program using sockets in Java which should put you at a starting point for your mock-Skype application.
Best of luck!

Which socket programming is best (TCP/UDP)? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
My client program wants to send a huge file to the server and in return the server program returns a double or triple sized file.
My question is, which approach should I use? Either TCP or UDP.
You could utilize FTP (File Transfer Protocol) for your use case.
It is very common and you can use it with java to get or to upload
files to the FTP server.
Also take a look at this question on SO: File upload in Java through FTP
If you still want to implement it yourself, I would recommend using TCP, since it offers you some services:
Ordered data transfer — the destination host rearranges according to sequence number
Retransmission of lost packets — any cumulative stream not acknowledged is retransmitted
Error-free data transfer
http://en.wikipedia.org/wiki/Transmission_Control_Protocol#Data_transfer
This question is too broad, but the answer is probably TCP; if you're needing to transfer a file, TCP provides ordering and retransmission services that UDP doesn't, and there's no reason to reinvent the wheel.
Along those lines, though, why reinvent HTTP? This sounds like a classic case for using a Web server.
UDP programmin but it will be difficult to implement

simple Java api to form and send ntp packet [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
We should feed some system under test with ntp data, that we should control. Since the testing environment is mainly java-oriented, it would be perfect to find and reuse any java code, that forms and send ntp packets. There is no matter, how precise this server side would be, since the main idea of the test to provide the mocked time through via ntp packets. Is there any ntp java library, or may be example, especially for netty usage?
I would appreciate for any suggestions. Thanks in advance!
UPD. Since the question is taken to 'on hold' (I don't understand why, ntp + java seems to be too familiar to local folks, but not to me), I'd like to summarize it to simple question:
Is there Java API that can provide ntp server packets on ntp client dmand being simple like NTPPacket ntpp=new NTPPacket(new Time()); while all other wirings will be default?
Ho-ho, I see some haters already started their downvotes; it seems they just see the title, but not the details of the issues (I really dislike this kind of haters)
I have even to remove 'java' tag here. So, my suggestion that I can reuse http://mvnrepository.com/artifact/org.apache.directory.server/apacheds-protocol-ntp/2.0.0-M15 for this purpose

Categories