If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

In reality, I would think that a program which could decide for itself which ports to close and which ones are valid would require a lot of work, like inspecting state tables, checking sequence numbers, and so on. A human could probably do it a lot faster.

Re: Java port scanner problem

Originally posted here by benipegu List out the service that is listening on a particular port.

Depending on your desired functionality, this could range from easy to difficult.
The easy solution, nab a copy of /etc/services off of any nix distribution (attached in case you don't have access to one) and write a way to parse the file (probably want it in your own format at that point) and then pump out the entries when you list the ports.

Close an open port (&gt;1024, of course)

Apart from an undesirable non-portable hack/wrapper scripts, I am not sure this could be done. I don't know for certain, but it is based on what I've run into in other areas in terms of controlling anything below the VM level. The VM operates in an isolated environment, it's tough to do things that exist outside this environment at all, let alone without wrappers.

Chris Shepherd
The Nelson-Shepherd cutoff: The point at which you realise someone is an idiot while trying to help them.
\"Well as far as the spelling, I speak fluently both your native languages. Do you even can try spell mine ?\" -- Failed Insult
Is your whole family retarded, or did they just catch it from you?

chsh, I believe that with java you can write an external library in C++ that could access down to kernel level, then use the System.load(...) [it's something like that] command to load it in. Then you have access to any of the methods that you created in your C++ library.

I know you can do this with dll files, and I'm sure there must be a way to do it in *nix OSs.