Java Firewall

Hi all,
I have very recently begun using java as a development package, and I love the network capability that it has. It makes it quite a bit easier to make a network application, and implement it.
Something I would like to try would be to make a fairly simple firewall. For instance, when a user inside the network wants to make a connection, it would forward it through to the outside world, and keep the thread open to allow communication back to the host. If the outside world tried getting in, it would reject the host unless is met specific requirements (right port, etc).
Three questions I have:
1. Is this possible? I mean, it seems possible, but would there be a problem with the data, even if I used very basic I/O streams and such? Or would there be problems because of the vast number of protocols and such?
2. How can I differentiate between 2 NICs? On my existing firewall, I'd have eth0 and eth1 for my internet and local net Ethernet cards. How would java know which is which? Creating a server socket is simple, but how do I tell it which interface to listen on?
3. Obviously a firewall would need to listen to all incoming and outgoing ports. Do I seriously need to make 65535 threads to have a server socket listen on every port? I would hope there is a more simple way, but I'm just not finding it anywhere.

It's possible to write a proxy. Taht said, this is
not really a very good first java network assignment
as java network access is quite high level, and this
is a complex project.As far as having the knowledge behind it, that is not
a problem. This isn't really a school project per-say.
I am persuing a degree as a networking specialist, so
network addressing and protocols is not an issue. It
is simply taking that understanding and putting it
into (java) words.
In combination to that, I have a decent programming
background, just not much in java. I hope to learn
quickly, and this is more like a final goal. Java
seems like the perfect language to compliment an
understanding of a network infrastructure.Your OP didn't specify a level of knowledge other than that you were new to java. I assumed you had quite a bit of network experience to even consider just a project.
The 2 NIC have different IP addresses, when creatinga
ServerSocket you can specify the ip address as wellas
the port,Makes sense, I guess, but I was more or less hoping to
have it dynamic. If I ever want to change the address
or move this to another system, I wouldn't want to
have to recompile with the new address. This could
easily be solved with a textbox to input the addresses
though, so it's not a big deal.You could use a Runtime.exec() call to run a command such as ipconfig on windows or ifconfig -a on unix to get that info.
I believe there is no way to do this, a port of 0
means to use an ephemeral port.If this is not possible, then I would think a java
firewall is not possible. Yes, when I said it requests an ephemeral port I meant that you can't do what you want.
Granted, maybe I am just not
understanding the software end of it, but a packet
sniffer, like Ethereal, is able to see all data
passing through, and I doubt it has 65k threads per
protocol to listen. Is there a way to have the program
see all data hitting it's NIC?Java definitely cannot listen to packets in promiscuous mode. There is a package called JPCap that provides packet capture using JNI.
I am not sure where an ephemeral port would solve
this. Granted, it would help with the internals of the
program, passing data from eth0 to eth1, but how would
this solve the problem of knowing with port to recieve
data on eth0?
Thanks again!You're welcome, and good luck

Similar Messages

  • Enbed java firewall into Windows NT

    Hi
    I am doing a project and going to create a firewall using Java. After that I have to run the firewall in Windows NT platform. Is there anyone who knows what I need to do to enbed the Java firewall into a NT platform? Thanks a lot.

    Why do you have to post the same question 3 times?
    http://forum.java.sun.com/thread.jspa?threadID=652296&messageID=3834871#3834871
    http://forum.java.sun.com/thread.jspa?threadID=652295&messageID=3834868#3834868
    http://forum.java.sun.com/thread.jspa?threadID=620790&messageID=3498334#3498334

  • How to create Java firewall?

    Hi
    I am going to create a proxy firewall using Java programming language. But I don't know what tools I should use? Is there anyone who knows that? Thank you.

    Hi
    I am going to create a proxy firewall using Java
    programming language.No you won't, pick another project.And the reason that you won't is that java is a very
    poor choice if you want to write a firewall or proxy.
    You should do that in e.g. C/C++ instead.
    /KajNo, the reason is that he seems to have no clue about what he's trying to do and therefore likely won't succeed no matter what language he does.
    I do agree C or C++ would be a better choice, but he's unlikely to succeed there either.

  • Writing a firewall

    How do you write firewall software in java?
    Can anyone point me to some info about creating a packet filter firewall in java.. I realise that the filtering is done on the kernel level of an OS but I have seem a few firewall programs around and was wondering how it was done.
    Thanks
    Sim

    It is possible to write firewall in java but you should write some native code for this.
    The native code should call system libraries.
    There are many Linux/Java firewall builders but the Java program is actually only GUI to common filtering apps like iptables, ipchains or ipfwadm.
    There are similar apps for UNIX like OS. I don't know such command-line tools to control packet filtering in Windows environment.

  • Having your computer to stop listening to a particular port....!

    Hi...guys...!
    I have my computer listening to a particular port (tcp). But, my question is: how do I make it stop listening to that port...??
    Any help...please...???

    Just how does this question relate to java?Probably another one of those "I want to create a Java firewall" fools.

  • Problem with firewall and java on line sites internet explorer

    i have been experiencing problems with java on line games because the firewall has blocked usage.On two of them when i press play to play the game a message appears error on page.If i dowload mozilla will i have the same problems? also when downloading from my gmail account again error on page. When i donload your browser do i click on save or open?
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB6.5; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; WinNT-EVI 27.03.2010)

    Well... good; when we help each other here, we can't
    assume that any step has been taken, unless it's been
    specifically identified. I'm sure that makes it all
    the more frustrating, since you are a very experienced
    user.
    Now, then:
    -- since you have reinstalled the Java Update; and
    -- if you open your Help >> Installed Plug-ins, and
    scroll down the list and find these three items:
    Java Plug-in for Cocoa -- Java 1.4.2 "JavaPluginCocoa.bundle"
    Java Plug-in (CFM) -- Java 1.3.1 "Java Applet Plugin Enabler"
    Java Plug-in "Java Applet.plugin"
    -- and if Enable Java and Enable JavaScript are checked in:
    Safari >> Preferences >> Security, as you say they are; and
    -- if Enable Plug-ins is checked in the same section,
    as you say it is; and
    -- you have repaired permissions, as you say you have; and
    -- you have emptied your Cache; and
    -- your Icons folder ({YOU}/Library/Safari/Icons) has been
    trashed if it is over 750 KB; and
    -- you have Quit, then relaunched Safari after all this,
    as you say you have; and
    -- your {YOU}/Library/Caches and {YOU}/Library/Caches/Safari
    folders have read and write permissions
    ...then, I'm currently at a loss as to what else to suggest.

  • Calling a web service from a Java SOAP RPC client behind a firewall

    Hi
    I've generated java stubs for a web service developed under Workshop. I have tested
    the service successfully when the web service is deployed on my "localhost" Weblogic7
    server.
    I have now deployed this service on a separate WL7 server outside our corporate
    firewall and have changed the IP address in the ServiceLocator to that of the
    new WL7 box.
    Now when I run the test client, I get the following error:
    java.net.NoRouteToHostException: Operation timed out: no further information
    Does anyone know what I need to do to fix this?
    Thanks

    I've solved this problem - setting up http.proxyHost system properties sorted it
    out.
    "Tim" <[email protected]> wrote:
    >
    Hi
    I've generated java stubs for a web service developed under Workshop.
    I have tested
    the service successfully when the web service is deployed on my "localhost"
    Weblogic7
    server.
    I have now deployed this service on a separate WL7 server outside our
    corporate
    firewall and have changed the IP address in the ServiceLocator to that
    of the
    new WL7 box.
    Now when I run the test client, I get the following error:
    java.net.NoRouteToHostException: Operation timed out: no further information
    Does anyone know what I need to do to fix this?
    Thanks

  • Ports to open between Java application server inside firewall and Java CI

    What ports do I need to open to allow a J2ee App server 7.0 to communicate with the Java Central Instance inside the firewall??
    thank you !
    Ld

    Why Database ports? seems like the Central Instance would be the only one talking to the Database no?
    thanks...
    This is for CRM eCommerce....

  • Mac OS X firewall and Java.

    Hello,
    1) I am using the built in firewall 10.5.8, and I was wondering what functionality I will lose if I select "Block Incoming Connections" for "java".
    2) If "Block Incoming Connections" is selected, for a specific program (java), does that mean that the program (java) will not respond to connections that the program itself opens? I guess I am asking if the software firewall is a NAT/SPI based firewall.
    3) The icon to the left of "java" looks weird to me. Is is everyone else seeing the same icon? Here is a link to the image: http://gallery.me.com/zap1313#100057/firewall&bgcolor=black
    Thanks

    1) I am using the built in firewall 10.5.8, and I was wondering what functionality I will lose if I select "Block Incoming Connections" for "java".
    That depends on what Java applications you're running.
    2) If "Block Incoming Connections" is selected, for a specific program (java), does that mean that the program (java) will not respond to connections that the program itself opens?
    It has no effect on outgoing connections initiated by the application.
    3) The icon to the left of "java" looks weird to me. Is is everyone else seeing the same icon? Here is a link to the image: http://gallery.me.com/zap1313#100057/firewall&bgcolor=black
    The icon looks normal to me. Java isn't a typical double-clickable application, so it appears as the generic console application icon.

  • Firewall - Java Card project with two packages.

    My Java Card project has got two Java Card packages. One of them contains only the Java Card applet. The other package contains all other classes. We did the splitting because our application is large and if all the code is left inside the one package if debug mode was checked, the size of the cap file was more than 64 bytes and the CAP file with that size cannot be installed inside the simulator. That situation made the programming difficult. Therefore the splitting took place. What is my question? If we have two packages, is there a firewall between them or the packages are in the same group context.

    A library package has different restrictions to an applet package. As for the firewall, the data created in your library package is owned by the applet instance that created it. That means any data or objects created by calling your library from your applet will be in the same context as your applet. Any other applet accessing this library will not be able to access instances from the original context. This is only a problem with static fields and methods etc that are shared between both applets.
    Cheers,
    Shane

  • Manage Processes in Java VM (Process Monitor, Firewall)

    Hey there.
    I asked myself today if there is a possibility to have a task-manager for the java vm (since windows task-manager shows only javaw.exe) and a VM-Firewall (since a common firewall only sees "any java programms wants to establish a connection"
    thank you

    Actually, you comments aren't necessarily unclear. They are more incomplete. You didn't really provide too much details as to what you are trying to do or experiencing. Genrally speaking, most firewalls will allow you to not only monitor and block/permit by application executible name, but also by the port used to make the exchange, the content type, and numerous other attributes. So if you have multiple java applications, but want to allow or restrict one in particular, simply block by a specific port or set of ports or one of the other attributes supported by your particular firewall.
    As a simply example, take a look at the Windows Firewall for XP. Notice that you can define the app, the port, and protocol
    http://support.microsoft.com/kb/842242
    http://support.microsoft.com/Library/Images/2691294.png

  • I can't run java installer. This may involve firefox. My firewall is turned off so that I can install java, but something is still blocking the installation procedure, and java's support page doesn't seem to offer an answer.

    University tech support says their online course system prefers explorer to firefox, and something they and the java download site both say about allowing pop-ups and disabling the firewall make me thing that part of the problem is with firefox's compatibility. But honestly, I don't know. I just know that I'm following all the directions I can find and it doesn't seem to be working.

    #Download and SAVE the Java installer to your hard drive,
    #*SAVE the installer to your Desktop so that you can easily find it
    #exit Firefox (Firefox button > Exit '''''OR''''' File > Exit if using the Menu Bar),
    #click or double-click the Java installer that you downloaded to start it
    #Using Java with Firefox and Download link: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]
    #Test your Java after installation: https://www.java.com/en/download/testjava.jsp
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]

  • MAC OS 10.5.7 FireWall & Java Socket programing

    Hi everyone,
    I am fighting for few days with a simple problem in vain.
    I am programming a simple java client-server application based on TCP sockets but I do not manage to open any socket at all due to a "connection refused" problem:
    In the previous versions of MAC OS X Leopard it was possible to open communication port easily. The latest version of leopard no longer support this functionality. Now you can grant permission only to applications (not to java programs).
    I tried the following:
    Creating a script that starts my application and uses the firewall setup program to grant permission to that script: Impossible only application can be managed neither script nor JAR files are accepted.
    Modifying low level firewall parameters using IPFW: useless the MAC firewall works at a lower level. changing local firewall rules does change anything.
    I am thinking about modifying the /library/Java/Home/lib/java.security file but I think that it works only for Applets.
    I try to grant permissions to the java executable file using the firewall configuration panel but the problem is still present.
    I am sure that lots of programers had this problem.. Anyone have a simple solution ?
    Thx for your time.
    PS: here a simple code example of what I am doing.
    try
    socket = new Socket(InetAddress.getLocalHost(),port);
    catch (UnknownHostException e)
    e.printStackTrace();
    and the output is:
    java.net.ConnectException: Connection refused

    I finally got around to rearranging and backing up partitions. Updated to 10.5.7 on a non live partition and then booted into it. Don't have any problems with CS3 ID, IL or PS. And no problem with CS4 ID, IL, PS. Does appear to have fixed the OpenGL problems with the NVIDIA GeForce 8800 GT video card and PSCS4. I will say on the main workstations I have not updated a live booted partition in years. Seems like there are nothing but problem trying to update a live partition.
    As to the monitor profile being introduced into the RGB print flow from ID PS3 and 4. Problem still there and still not fixed. But of course you can use Print as Bitmap or if your running a Canon printer with selectable Fast Graphic Process in the driver you can print correct output this way.

  • How do i enable java 7 plugin on to firewall

    ok so the macbook air comes with java 6 installed but i changed my java pathway on a game (minecraft) to java 7 because i needed java 7 to run it. so now i did but to enable playing in lan party i need to allow access from the java 7 to my firewall the regular java that comes with the mac which is java 6 is there since its not a plugin but java 7 is a plugin so i need to know how to allow java 7 through my firewall?

    Updated To OS 10.8.2
    Installed Java 7 Update 9
    According to Oracle Apple disables the Java plug-in and Webstart applications when the Java update is done using Software Update.
    According to Oracle to enable the Java plug-in
    Go to Finder > Applications > Utilities > Java Preferences.
    In the Java Preferences window check the box for Enable Applet plug-in and Webstart applications.
    No Java preferences in Applications>Utilities
    No Java preferences in Applications>Utilities>Other
    Java is enabled in Safari preferences
    How and from where do I get the Applet plug-ins and Webstart applications?
    How do I get the Java Preferences to enable Applet plug-in and Webstart applications?

  • Java provides a Firewall WTF?

    i was taking a terrible java core practice test today online and this was one of the questions:
    Java provides a Firewall between a networked application and your computer.
    TRUE/FALSE
    i said false, they said i was wrong.
    Does anyone know wtf they are talking about here ?

    bah, why was it the first hit on google!!:shrug:
    Why indeed. A good bit of googlebombing I would guess. It really is a terrible reference. It has been discussed here before. If you browse through the questions and answers you will find that the answers break down like this.
    30% correct (if that)
    30% have a grain of truth but largely stuff and nonsense
    30% out and out bullshit
    10% so poorly answered you they don't even seem to be answering the same question
    And then there are the threads that are just scary like...
    http://www.geekinterview.com/question_details/38346
    The answer is a joke of course but the question... I pray it is a joke too.

Maybe you are looking for

  • Losing Keychain, WiFi, clock, and last state on battery drain

    Recently sent my MacBook Pro (MBP) into the shop to get a new shell put on it. When it was returned, it appears I no longer have Safe Sleep functionality. Historically: Prior to sending the MBP into the shop, if the battery ran low on power, I would

  • AIRPORT EXTREME CARD compatability

    I have a G4/500 SAWTOOTH-AGP machine. Will an AirPort Extreme card work in this machine? I've looked everywhere, but cannot fine the answer. The specs for the card say "Will only work in machines that are Airport Extreme ready"... I've looked up the

  • Deleting Notes?

    I know that there has to be a way to do this. Can someone please help me and tell me how , i cant find anything in the online "user maual"

  • HT1918 I forgot the answers to my security questions, how do I change the answers?

    I forgot the answers to my security questions, which I made the answers along time ago. How do I reset them? It will not allow me to purchase anything on my account.

  • German iTunes Store in Spain

    Hi, i´m german. living in spain and would like use iTunes store Germany. But its not possible to setup a account. Always i become a error message credit cards from spain not accepted in german iTunes store? Why not? i can also buy in german apple sto