Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I opened up a port (23) on my server with netcat.

I then blocked this specific port with an IPTABLES Input rule.

Are there any tools at my disposal to determine that I do indeed have this port open behind my firewall? Epic Nmap scans/hacks etc? I'm pentesting my box.


share|improve this question

The simple option is to telnet to the port for example:

telnet <your ip address> 23

If you get a connection, i.e. no timeout or refused message, your port is accessible.

share|improve this answer
Thank you for your comment. I know I have the port open behind my firewall and the firewall would indeed block any attempt at such a connection. I'm asking how a hacker could determine if a port is open even if it is filtered/blocked by a firewall. – Scandalist Oct 25 '12 at 7:29
Ah, ok - I would offer that the answer is no in that case. If the hacker did in fact gain access to that machine or any other behind the firewall, then it's possible, but externally, I don't think so .. or at least I hope its not possible :) – FreudianSlip Oct 25 '12 at 7:33
Best thing to do in that case is not to REJECT, but DROP. REJECT gives some indication that the machine exists at that address and that something is listening on that port - DROP just ignores the connection, meaning there should be no indication there's even a box at that IP. – Xyon Oct 25 '12 at 7:33
Right, that makes sense. I suppose my real question is how could I keep these services accessible yet block port scans, ping probes etc - Rendering my server invisible to the common port sweeps of the internet. I would guess this is a fine art. – Scandalist Oct 25 '12 at 7:41
@Scandalist: Port Knocking is one way to make a service available through the Internet without being visible to port scanners. VPN is another way. N.b. it's usually best to ask your real question in the question, not as a comment ;-) – RedGrittyBrick Oct 25 '12 at 8:40

I make use of several external sites which attempt to connect to a port from outside your local network, such as the one at DNS tools. They usually have some tools I don't use, but they allow you to check a particular port. Depending on how you're setting up, this might be more useful than local telnet (for instance, if you want the port open locally but closed to the outside internet).

share|improve this answer
The thing is, I know the port is open behind the firewall. I question a hackers ability to determine this even though I am filtering the port. – Scandalist Oct 25 '12 at 7:32
See my comment on the above answer. :) – Xyon Oct 25 '12 at 7:35
Also see the Gibson Shields Up test. Feed it a port range and it'll tell you not only if it could connect, but what indication it gets from your box. – Xyon Oct 25 '12 at 7:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .