How can I make a Packet Sniffer in Java?

Is there anyone who can tell me where to start to look for the information needed to make a packet sniffer in Java? I've already programmed internet-type applications before, but I would like to know how to access the recieved data packets before they reach their intended port. So, just tell me a way to do that if you already know; otherwise, just tell me where to look for some information about it. Thank you.

Short answer: Anythings possible
Medium answer: I think you are actually going to talk to the 'chip' on your network device to tell it to pass messages to your listener too. From what I understand most of these devices simple won't pass those not meant for it's own ID(some long number, each device unique, yes, in the world). So you need some hardware.
Since communicating with the hardware is not something Java is good at, probably you would need some kind of native language interface.
Here's somebody who has done just that.
http://forum.java.sun.com/thread.jsp?forum=52&thread=95001

Similar Messages

  • How can I make a screensaver from a Java program?

    Hi!
    I've made a Java program works as a screensaver, and I've grouped all files into a jar file. How can I make a screensaver from this jar file?
    Thanks.

    check https://jdic.dev.java.net/documentation/incubator/screensaver/
    - I think it's still in development, but it's something...

  • How can I run a packet sniffer on a Router or Switch

    I have on my network several router 1700 series and switches Catalyst 2950 and I want to know how can I run ethereal on those babies to monitore what comes and goes

    The two most common methods would be (the old way) insert a hub (not a switch) in-line between the devices withthe traffic you wish to monitor or (the new way, for Cisco anyway) using port mirrroring.
    A hub (not a switch) will repeat every pulse that passes on the line to the analyzer.
    Since finding a new hub these days is virtually impossible (even some of the things sold as hubs are really switches), the more common way, at least in Cisco environments, is to "SPAN" (aka Port Mirroring) the port of the device whose traffic you'd like to monitor.
    Here's the setup guide for a 2950:
    http://www.cisco.com/en/US/docs/switches/lan/catalyst2950/software/release/12.1_19_ea1/configuration/guide/swspan.html
    Good Luck
    Scott

  • How can I make Firefox use another installed Java runtime version?

    For development purposes I have several Java runtime versions on my Windows 7 64 bit machine. I try to keep the number of installed JDKs and JREs to a minimum and I want Firefox to use JRE 1.7.0_21 (32 bit) since this came with a JDK version I am forced to use for another application.
    Firefox however uses JRE 1.6.0_31, and correctly reports this as insecure. It offers me the option to upgrade, but I do not want to download and install another JRE since I already have said JRE 1.7.0_21 installed. I would highly prefer to just be able to point Firefox to that JRE. I don't see an option to select another installed JRE however.
    I have already attempted to manually modify the pluginreg.dat file (I know, it says Do not edit...) by changing the JRE 1.6 entries to JRE 1.7, but upon restart my edits were overwritten and the old JRE was back. As a result I cannot view certain web sites (also corporate/internal) without having to switch to lesser browsers.
    Please let me know how I can make Firefox use the already installed JRE 1.7.

    Thank you for your response, cor-el. I was able to successfully add the JRE 1.7 plugin to Firefox by modifying the existing JRE 1.6 registry entries, but I would not recommend this procedure to users that are less confident in registry editing. Too bad there is not a more user friendly way to do this.
    Unfortunately the Java applet I'm trying to view is still not displayed. I've dug a bit deeper and found that the applet explicitly specifies an older JPI version (1.5.0_02). AFAIK Firefox cannot deal with this if its installed JPI (now 1.7.0_21) does not match the version requested. So either I'm going to have to dig up this older JPI version and install that too, or just switch to an alternative browser to be able to view this applet.

  • How can I make a version(s) of java on windows compatible for multiple app

    I have a switch application from EMC -connectrix manager which requires 1.5.0_x,
    we have 1.6.0_x on our management servers. Is java backwards compatible/supporting earlier versions for applications requiring earlier versions. If so, di I have to enavble or list the versions?

    Sun tries very hard to make each version of Java backward compatible with previous versions, especially the previous major release. If it works in 1.5.* it's highly likely to work in 1.6.*... so yeah, suck it and see...

  • How can I make my program Run forever?

    I would like to know how can I make my program execute some method while the GUI still open. I have something like this.
      public static void main(String args[]) {
        System.out.println("****************************");
        System.out.println("    PACKET READER CONSOLE   ");
        System.out.println("****************************");
        IPDetector window = new IPDetector(); // IPDetector is the JFrame
        window.setTitle("IPDetector Analyzer");
        window.pack();
        window.show();
        PortListener pl = new PortListener();// Is my portlistener class
        PacketReader c = new PacketReader();
        while(JFrame still open){// I dont know how to put a statemente here
          pl.start();// this method reads from a port and returns a string
          String cc = pl.data;// gets the string from the port listener
          while(!cc.equals("")){
            c.portWriter(cc);// writes the string into a file
      }I want that my portlistener keeps reading all the time, and if is something in the socket information.
    Should I use a thread? Any ideas? thanks.
    Chris

    I still not understanding how to make it thread. My main class is this one IPDetector. and it looks like this.
    public class IPDetector extends JFrame {
      // Declaration of the instance variables
      private static ArrayofDisplay  ad = new ArrayofDisplay();
      private ArrayofCreators database = new ArrayofCreators();
      JLabel sourceLabel;//etc..
      public IPDetector() {
        IPDetectorLayout customLayout = new IPDetectorLayout();
        getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
        getContentPane().setLayout(customLayout);
        sourceLabel = new JLabel("Source IP Add.");
        getContentPane().add(sourceLabel); 
        addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
      // I get confused here...
      private boolean alive; // Do I need to declared here?
      public void setAlive(boolean val) { // This one also?
        alive = val;
      // IPDetector Methods...
      public void displayCaller(ArrayofDisplay aD){  }
      public void setAndReplace(String text)  {    }
      public void refresh(){ }
      public boolean action(Event evt, Object arg){ }
      //etc...
      public static void main(String args[]) {
        System.out.println("***********************************************");
        IPDetector window = new IPDetector();
        window.setTitle("IPDetector");
        window.pack();
        window.show();
        PortListener pl = new PortListener();
        PacketReader c = new PacketReader();
        while (alive) {// Is this correct here?
          pl.start();
          String cc = pl.data;
          while(!cc.equals("")){
            c.portWriter(cc);
            window.refresh();
            cc = "";
    class IPDetectorLayout implements LayoutManager {
      public IPDetectorLayout() {  }
      public void addLayoutComponent(String name, Component comp) {  }
      public void layoutContainer(Container parent) {  }
    }

  • I've been trying to make an account with iTunes n everytime I get to the part of the credit card that's as far as I get because I dnt have one, how can I make an iTunes account without a credit card??

    I've been trying to make an account with iTunes n everytime I get to the part of the credit card that's as far as I get because I dnt have one, how can I make an iTunes account without a credit card??

    Where are you located?
    Just go and buy an iTunes gift card at any store in your country.
    Then follow all the steps you did, but when it asks you for the credit card number, there shoujld be a GIFT CARD option which will let you load your account witht eh funds form the gift card without providing a credit/debit card #.

  • How can i make an iTunes store acount without a credit card?

    how can i make an iTunes store acount without a credit card?
    im israeli and the israel store is only the app store.
    i want to get stuff for free without a credit card.
    help?!?

    Just go get a prepaid Visa or something. Put a small amount of money on it and then use that to open an account. If that doesnt work just call them. Contacting Apple for Support and Service 1 800 275-2273

  • HT1918 how can i make an apple id account without a credit card?

    how can i make an apple id account ? it says i need a credit card but i dont have one how can i get passed this?

    Download a free app, create a new apple id account and click none when it says to fill in credit card information.

  • How can I make mac except capture from my canon xlh1?

    How can I make my imac recognize my canon XL1 Camcorder in Final Cut Express

    Assume you are connected by Firewire, and that FCE has Import in some menu? Also check FCE Forum https://discussions.apple.com/community/professional_applications/final_cut_expr ess_hd?view=discussions.

  • TS3988 When I try and log into the icloud, I get a message that my Apple ID is valid but not an icloud account. How can i make it one?

    Whin I try and long into the icloud, I get a message that my Apple ID is valid, but the it is not an icloud account, how can I make it one?

    To use iCloud on a PC, you must first set it up using a device with iOS5 or a Mac with OS X Lion.

  • I synced two of my email accounts via gmail's POP3 thing. But now my iphone's gmail inbox shows a random selection of emails (not most recent ones that are in my inbox). How can I make my iphone inbox match what I see when I log on using a PC?

    I synced two of my email accounts via gmail's POP3 capabilities. But now my iphone's gmail inbox only shows a random selection of emails (i.e. right now it is May 31, 2013 but the emails in my inbox are a couple from Nov 12, a few from Oct 12, and then some way older than that and so on.When I log into my gmail from a computer, I see all my emails in the logical, standard order. How can I make my iphone inbox match what I see when I log on using a PC?

    If you're trying to decide between using POP and IMAP, we encourage you to use IMAP.
    Unlike POP, IMAP offers two-way communication between your web Gmail and your email client. This means when you log in to Gmail using a web browser, actions you perform on email clients and mobile devices (ex: putting mail in a 'work' folder) will instantly and automatically appear in Gmail (ex: it will already have a 'work' label on that email the next time you sign in).
    IMAP also provides a better method to access your mail from multiple devices. If you check your email at work, on your mobile phone, and again at home, IMAP ensures that new mail is accessible from any device at any given time.
    Finally, IMAP offers a more stable experience overall. Whereas POP is prone to losing messages or downloading the same messages multiple times, IMAP avoids this through two-way syncing capabilities between your mail clients and your web Gmail.
    That is from the page that you linked- does highlighted part of message ring a bell?

  • I down loaded sygic on my iPhone 3s but the icon is missing even in the search but when I want to download it again ,it say this application is present, how can I make the icon to show up

    I down loaded sygic on my iPhone 3s but the icon is missing even in the search but when I want to download it again ,it say this application is present, how can I make the icon to show up

    - Have you tried a reset. Nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Try syncing  the iPod to your computer. Then delete from iTunes and sync. that should delete it from the iPod. Then redownload it.

  • I have a new MAC MINI and I want to install a second monitor.  I have one connected to the HDMI and it works.  I can't get a signal to the other one.  It is connected from the thunderbolt to its HDMI port.  How can I make it work?

    I have a new MAC MINI and I want to install a second monitor.  I have one connected to the HDMI and it works.  I can't get a signal to the other one.  It is connected from the thunderbolt to its HDMI port.  How can I make it work?

    Could be a bad cable or bad Thunderbolt port.
    You have 90 days of free telephone support on a new device. You can call them at 1-800-MY-APPLE. Have your Mini's serial number handy
    You can also make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

  • I am frustrated with how my cursor jumps around while typing.  How can I make the arrow follow the cursor so this doesn't happen?

    Macbook Pro with OSX Yosemite:  I am frustrated that when using Word for Mac, the cursor keeps jumping around all over the page.  How can I make the pointer follow the cursor so this stops?

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

Maybe you are looking for

  • Any ideas on a good 42" lcd to use with fcp?

    Do anyone here use a large lcd for editing? What would be the best brand to get and some info on the specs such as contrast ratio etc.... I do not want plasma. Thanks Tony

  • Calling a Web service from Oracle Forms....

    Hi , I 've tried to follow the steps described in the link: http://www.oracle.com/technology/obe/obe_as_10g/deploy/callws_fromforms/forms_webservice.htm which uses : a)JDeveloper 9.04 and b)Oracle Forms 9.0.4. However , i have installed Oracle Forms

  • Has the IOS update on my Ipod caused the Apple TV Remote App to have connection problems?

    I recently updated the software on my IPod Touch and now the Apple TV Remote App won't connect to the Apple TV.  Home Sharing is turned on for both my computer and Ipod.  ITunes and the IPod have both been updated.  Is there an issue with the new sof

  • Site won't open in browsers

    My fledgling site will not open in Safari, nor in Firefox. At first I got a 404 error: "Not Found. The requested URL / was not found on this server." [Below this message was a plain line, and below the line was another message.] "Apache/2.2 Server at

  • How do I get photos out of iphone and in PC

    I have a PC. How in the world do I get my 90 photos out of the iphone and onto my pc without having to email them one at a time to myself. Can someone please help me. I am sure I am overlooking something very simple. Perry