BreachHunter
Pricing Blog Log inSign up
● thermal huntscan engines onlineassessment only — no exploits
  1. Home
  2. Blog
  3. Open Ports on a Web Server: Which Ones Should Never Face the Internet

Guides · ← All guides

Open Ports on a Web Server: Which Ones Should Never Face the Internet

Published: November 14, 2026 · Last reviewed: November 14, 2026 · 8 min read

By the Ingenious AI team

The short answer: A public website needs port 80 (redirects) and 443 (HTTPS). Everything else answering on your server's public IP is attack surface you chose by accident: SSH (22), MySQL (3306), PostgreSQL (5432), Redis (6379) and their peers are the ports BreachHunter's port scan probes and rates as risky findings, because each one lets an attacker skip your web application entirely and talk straight to a service that was never hardened for the open internet.

Run a free BreachHunter assessment on your site →

The port scan is the phase of an assessment owners understand fastest — it is literally a list of doors — and the phase whose findings age worst, because ports get opened for a debugging session at 11 PM and the firewall ticket to close them never gets written. Cloud defaults make it worse: a security group created in a hurry tends toward “allow from anywhere”.

This guide uses the scanner's own model: the ports it probes, the banners it grabs, and the distinction it draws between risky ports (a finding with a severity) and merely open ones (a LOW note asking “is this meant to be public?”). It ends with the firewall patterns that keep the list at two.

Which ports does an assessment treat as risky, and why?

The pattern is services with their own authentication and exploit history that assume a trusted network: databases (3306 MySQL, 5432 PostgreSQL, 27017 MongoDB), caches that double as data stores (6379 Redis), remote administration (22 SSH, 3389 RDP), and mail/legacy services left from a previous life of the server. The scanner grabs each open port's banner — the greeting the service sends — because a banner like a database version string converts “port open” into “this exact software, this exact version, reachable by anyone”.

History justifies the severity. The 2017 MongoDB ransom wave — tens of thousands of internet-facing databases wiped and held for ransom — required no vulnerability at all, just an open port and no authentication. Redis instances left public have been conscripted into botnets the same way. When the report rates an open database port HIGH, it is pricing the fact that exploitation is a solved, scripted problem.

Open does not always mean wrong — but it must mean deliberate

The scanner files non-risky open ports as LOW with a specific question attached: confirm this service is intended to be public. Some are: a mail server needs its ports; a game or API service may legitimately listen elsewhere. The finding is the forcing function — every open port should have an owner who can say why it is open, in the change log, not in a shrug.

The durable controls are boring and complete. Default-deny inbound at the cloud security group or host firewall, with explicit allows for 80/443 and an SSH rule scoped to your office or bastion addresses. Bind internal services to localhost or the private interface so even a firewall mistake leaves them unreachable — defense in depth the scanner verifies indirectly, because a service bound to 127.0.0.1 simply never answers its probe. And re-scan after infrastructure changes: the port list is the fastest-decaying part of any report, as the drift guide explains.

Worked example: meridianprint.example

Meridian Print Shop's server hosted its storefront and, unknown to the owners, the database the storefront talked to — on the public interface, left over from a developer's remote-debugging setup two years earlier. The port phase of the assessment returned:

PORT     STATE  SERVICE   BANNER
80/tcp   open   http
443/tcp  open   https
22/tcp   open   ssh       OpenSSH_8.9p1
3306/tcp open   mysql     MySQL 8.0.x  <- RISKY: database facing the internet

No evidence suggested the database had been reached — its account passwords were strong — but “probably not” is not a posture. The shop bound MySQL to localhost, scoped SSH to the developer's fixed IP, and set the cloud firewall to default-deny. Retest showed exactly two public ports. The owners added the scan's port table to their quarterly review, because the developer's debugging need will recur and now has a closing step.

The five actions to take

Getting your public port list down to deliberate:

  1. Run the scan (or nmap your own IP) and list every open port with its banner — no port without a named owner and reason.
  2. Bind databases, caches and admin services to localhost or the private network; they should never answer on the public interface.
  3. Scope SSH/RDP to specific source IPs or a bastion/VPN — never 0.0.0.0/0.
  4. Set the cloud security group / host firewall to default-deny inbound and add explicit allows only.
  5. Re-scan after every infrastructure change and quarterly otherwise; treat any new open port as a change to explain.

Run a free BreachHunter assessment on your site →

Frequently asked questions

Our database has a strong password. Is an open 3306 still a finding?

Yes. A public database port invites brute force, credential stuffing and every future CVE in that database's network parser — against a service that was designed for a trusted LAN. Password strength reduces one route; removing the port removes the category.

Why does the report list port 22 as risky if we need SSH?

It lists the exposure, and the expected answer is scoping: key-only auth, a fixed source range or a bastion, and fail2ban-style throttling. SSH open to the whole internet with password auth is the risky shape; SSH itself is a legitimate service.

What is a banner and why does the scan record it?

The banner is the greeting text a service sends on connect — often its name and version. The scan stores it as evidence because “port open” plus an exact version tells an attacker precisely which exploits apply, and tells you exactly what is listening.

Can a firewall alone fix this if the services stay bound to all interfaces?

A correctly configured default-deny firewall does make them unreachable from the internet, and the scan will pass. Binding to localhost as well is still recommended: it protects you on the day the firewall rule is edited by someone in a hurry.

How often do port findings appear on ordinary small-business servers?

Constantly — they are among the most common HIGH findings in assessments, almost always leftovers: a debugging session, a migrated service, a default cloud image. That ordinariness is the point of scanning on a schedule.

Sources

Where this guide's claims come from, in citable form:

  • Nmap documentation (2025) — how port scanning and banner grabbing actually work.
  • NIST SP 800-53 Rev. 5 (2020) — boundary protection: deny by exception, allow by necessity.
Share this: X · Facebook · LinkedIn · WhatsApp

Related guides

  • Website Security Test: What It Checks, What It Misses, and How to Read Yours · 9 min read
  • Website Security Cheat Sheet: Headers, TLS, Cookies and Exposed Files · 7 min read
  • What a Website Security Assessment Actually Tests · 10 min read
  • TLS/SSL Basics: What Your Certificate Says About Your Site · 8 min read
  • Common Website Misconfigurations (and How to Fix Them) · 11 min read
  • Reading Your First Pentest Report: From Score to Action · 9 min read
  • Deleted ≠ Gone: What the Wayback Machine Keeps After You Delete Your Secrets · 9 min read
  • SQL Injection in Plain English: How One Login Box Can Read Your Database · 9 min read
  • What Does a Website Security Scan Check? · 8 min read
  • Exposed .git Directory: What It Leaks and How to Check · 7 min read
  • Security Headers Missing? What Each Header Stops · 7 min read
  • How Much Does a Penetration Test Cost in 2026? · 7 min read
  • Website Security Checklist for Small Teams (60-second self-check) · 6 min read
  • Reading Your Scan Results: Which Findings Fix First? · 7 min read
  • Content-Security-Policy Missing: What CSP Does and How to Add It Safely · 8 min read
  • HSTS Missing: What Strict-Transport-Security Prevents · 7 min read
  • Clickjacking and X-Frame-Options: How Framing Attacks Work · 7 min read
  • Cookie Flags Explained: Secure, HttpOnly and SameSite · 8 min read
  • Exposed .env File: What Leaks, What Attackers Do Next, What You Do First · 8 min read
  • Directory Listing Enabled: What It Shows Attackers and How to Disable It · 7 min read
  • Mixed Content: Why Your HTTPS Page Still Loads Insecure Resources · 7 min read
  • Expired SSL Certificate: What Breaks, Why Renewal Fails, and How to Catch It Early · 7 min read
  • TLS 1.0 and 1.1 Still Enabled: Why Old Protocols Show Up as a Finding · 7 min read
  • No SPF or DMARC Record: How Missing Email Auth Exposes Your Website · 7 min read
  • Subdomain Takeover: How a Dangling DNS Record Lets Attackers Claim Your Name · 7 min read
  • Forgotten Subdomains: The Staging Site You Forgot Is Still Public · 7 min read
  • WordPress Security Scan: The Exposures an Assessment Finds on WordPress Sites · 8 min read
  • Exposed Backup Files: .bak, .old and .zip Files Sitting in Your Web Root · 7 min read
  • phpinfo() in Production: The Diagnostic Page That Maps Your Server for Attackers · 7 min read
  • Server Version Banners: Why Your Headers Point Attackers to the Right Exploit · 7 min read
  • End-of-Life Software: Running a Server Stack Nobody Patches Anymore · 7 min read
  • CORS Misconfiguration: When Cross-Origin Sharing Opens Your Data to Any Site · 7 min read
  • Open Redirect Vulnerability: How Your Own Domain Sends Visitors to a Phishing Page · 7 min read
  • Dangerous HTTP Methods: What TRACE, PUT and DELETE Should Never Answer · 7 min read
  • Host Header Injection: Poisoned Reset Links and Cache Attacks Explained · 7 min read
  • What Is security.txt? The Small File That Lets Researchers Reach You · 6 min read
  • Admin Panel Exposed to the Internet: What an Assessment Flags and Why · 7 min read
  • phpMyAdmin Exposed: Why This Database Door Is a Prime Brute-Force Target · 7 min read
  • Spring Boot Actuator Exposed: Environment Dumps, Heap Leaks and Shutdown Endpoints · 7 min read
  • Debug Console in Production: The Finding That Can Become Code Execution · 7 min read
  • Exposed AWS Credentials File: The /.aws/credentials Finding, Explained · 7 min read
  • Referrer-Policy and Permissions-Policy: The Two Quiet Headers You Are Probably Missing · 6 min read
  • Exposed package.json: Your Dependency List Is a Recon Gift · 6 min read
  • DNS Zone Transfer Open (AXFR): Handing Out Your Entire DNS Map · 6 min read
  • Certificate Name Mismatch: Why the Cert Does Not Match Your Domain · 6 min read
  • Website Security Assessments for Agencies: Checking Every Client Site Without a Security Team · 8 min read
  • SaaS Security Questionnaires: What Buyers Check About Your Website First · 8 min read
  • Ecommerce Website Security: The Exposures That Put Your Checkout at Risk · 8 min read
  • Small Business Website Security: The Checks That Matter at Your Size · 7 min read
  • How to Prepare for a Website Security Assessment (and Read the Report Calmly) · 7 min read
  • Vulnerability Severity Explained: What Critical, High, Medium and Low Actually Mean · 7 min read
  • Retest After Fixes: How to Prove a Security Finding Is Actually Closed · 7 min read
  • Security Assessment vs Vulnerability Scan vs Pentest: What Is the Difference? · 7 min read
  • How Long Does a Website Security Scan Take? · 6 min read
  • Website Security Drift: Why Last Month's Clean Scan Is Already Out of Date · 7 min read
  • WordPress Site Keeps Getting Hacked After Cleanup · 8 min read
  • Google Blacklist Removal: Getting the Red Warning Off Your Site · 8 min read
  • VirusTotal Flagged My Site: How to Clear a False Positive · 8 min read

Related from the Ingenious AI suite

  • Ingenious AI — the full suite of security and compliance tools
  • DomainGuard — domain impersonation and typosquat defense
  • See BreachHunter pricing →
BreachHunter · by Ingenious AI · read-only security assessment — scan only targets you own or are authorized to test
About · Contact · Blog · vs Intruder · Privacy · Terms · Security · Threats · Nextcloud Check · Verify Evidence · Help · Redeem
More from Ingenious AI:
DisclosureGuard — AI disclosure compliance · Vibe-Code Audit — AI code security scanner · Rogue-Agent Defense — AI agent firewall · ChatBreaker — AI chatbot red-teaming · ModelMinder — AI model deprecation radar · TermsWatch — AI vendor terms monitor · Agent Flight Recorder — tamper-evident agent audit trails · Agent Auth Gateway — agent credentials & kill switch · DomainGuard — domain impersonation defense · Agent Passport — Know-Your-Agent registry · AgentGate — agent policy publisher · AgentBlock — AI agent & crawler access control · BoundaryVault — agent log forensics · Agentic Receipts — verifiable agent payment receipts · EvalEgress — eval-to-production exposure scan · HomeShield MCP — home AI server exposure check · WireWatch — payment verification ceremony · ADMT Notice Kit — AI decision notice compliance · DueLadder — human-approved invoice chasing · Agent-Ready Store Audit — can AI agents buy from your store · ContentCraft AI — content operations · AgentReady — agent-readiness checks · AI Audit Exchange — AI audit exchange · CallbackShield — callback & webhook protection · CompanionGuard — AI companion safety guardrails · CRAClock — EU Cyber Resilience Act deadline clock · EInvoice Translator — e-invoice format translator · GEOFixer — geo & local listing fixes · MandateGuard — agent spending mandates · OutcomeMeter — AI outcome measurement · ProvenanceGuard — content provenance checks · ReviewDesk — review response desk · ReviewProof — verified review evidence · TakedownCoop — coordinated phishing takedowns · TrustGate — trust & safety gating · BreachHunter — website penetration testing · All 36 platforms — the Ingenious AI portfolio

We use cookies. Necessary cookies keep the site working. With your permission we also use analytics cookies (to understand usage) and marketing cookies (for ads). Read our privacy policy.

NecessaryRequired for login, security and core features. Always on.
AnalyticsHelps us understand which pages are useful.
MarketingUsed for advertising and measuring ad performance.

    No match. Try “pricing”, “php2shell” or “contact” — or press Esc to close.

    ↑↓ navigate · Enter open · Esc close