Video failed to load

Security Checks Giving You a Headache? Save This Complete Port and File-Upload Blocklist!

449 words
2 minutes
Security Checks Giving You a Headache? Save This Complete Port and File-Upload Blocklist!
Security Checks Giving You a Headache? Save This Complete Port and File-Upload Blocklist!

Translation Notice

This article was originally written in Chinese and translated into English with the assistance of AI. The translation has been reviewed and edited for clarity, accuracy, and readability. Please refer to the original source where necessary, especially for technical terms, commands, configuration details, and proper nouns.

Do major security assessments leave you busy and anxious? Which ports should be closed, and how should web security be configured? Don’t worry—we have prepared a practical solution. This article collects high-risk ports and file extensions that must be blocked; bookmarking it should be enough.

1. High-Risk Ports That Must Be Closed#

Core principle: reduce the attack surface; close anything unnecessary.

Most firewalls now use “deny all” as their fallback policy, but many people add an “Any to Any” allow rule for convenience.

As an engineer who has only been working for a few years, I have still seen this kind of reckless configuration far too often.

All I can say is: permissive policies feel good until an incident turns troubleshooting into a nightmare. Do not wait for an incident to regret it. Check the following ports immediately and close access from any address.

Follow my WeChat public account and send “High-Risk Ports” by direct message to receive the complete list.

1.1 Remote-Access Ports#

PortProtocolPurpose
22TCPSSH
23TCPTELNET
3389TCPRDP
5900-5904TCPVNC

1.2 Database Ports#

1.2.1 Relational Databases#

PortProtocolPurpose
1433TCPMicrosoft SQL
1521TCPOracle DB
3306TCPMySQL/MariaDB
5432TCPPostgreSQL
50000TCPIBM DB2
5236TCPDameng
54321TCPKingbase
5866TCPHighGo
30100TCPGBase
2881-2882/2886TCPOceanBase

1.2.2 NoSQL Databases#

PortProtocolPurpose
6379TCPRedis
27017/27018TCPMongoDB
9042TCPCassandra
9200TCPElasticsearch
5984TCPCouchDB
16000TCPHBase
8091TCPCouchbase
8086TCPInfluxDB
9042TCPScyllaDB

1.2.3 Graph Databases#

PortProtocolPurpose
7687TCPNeo4j
8529TCPArangoDB
14240TCPTigerGraph
8080TCPDGraph

1.2.4 Vector Databases#

PortProtocolPurpose
19530TCPMilvus
8080TCPWeaviate
6333TCPQdrant
8000TCPChroma

1.2.5 Database Administration Tools#

PortProtocolPurpose
80/443TCPphpMyAdmin
80/443TCPpgAdmin
80/443TCPAdminier
8080TCPBytebase

1.3 File-Sharing Ports#

PortProtocolPurpose
21TCPFTP
139/445TCPSMB
593TCPAFP
2049TCPNFS

1.4 Other High-Risk Ports#

PortProtocolPurpose
135/136/137/138TCP/UDPWindows RPC
139/445TCP/UDPSMB
161TCP/UDPSNMP

1.5 Ports with Many Known Vulnerabilities#

PortProtocolPurpose
8848TCPNacos
3888/2181TCPZookpeer
9001TCPSupervisor
7077TCPSpark
9092TCPKafka
7001TCPWebLogic

2. File Extensions That Must Be Blocked#

Ineffective file-type validation is equivalent to handing over system execution privileges. The key principle is to validate not only the extension but also the file content and type. The following high-risk types must be blocked on both the frontend and backend to prevent malicious execution.

2.1 System Executables and Scripts#

Risk: these files can execute commands directly on servers or users’ computers and are the highest-risk category.

  • Windows: .exe, .msi, .com, .scr, .bat, .cmd, .ps1, .vbs, .vbe
  • Linux: .sh
  • Cross-platform: .jar

2.2 Web-Interpretable Script Files#

Risk: once uploaded to a web directory and accessed, the server may execute the code, creating a web shell and compromising server privileges.

  • PHP: .php, .php3, .php4, .php5, .php6, .php7, .phtml, .phps, .phar
  • ASP.NET: .asp, .aspx, .asa, .asax, .ascx, .ashx, .asmx
  • JSP: .jsp, .jspx, .jspf
  • Other languages: .py, .pl, .cgi, .cfm, .cfml

2.3 Configuration and Web-Attack Files#

Risk: these files can overwrite server configuration, leak information, or launch other attacks.

  • Apache: .htaccess can rewrite rules and cause arbitrary files to be interpreted and executed.
  • Configuration files: .ini, .conf, .config may contain sensitive information or expose configuration.
  • Markup languages:
    • .xml: may introduce XXE (XML External Entity) injection risks.
    • .html, .htm, .svg: SVG and HTML can embed JavaScript for XSS attacks.

2.4 Disguised Dangerous Files#

Risk: other extensions may be incorrectly associated with executable programs by the system.

  • Disguised files: .pif, .lnk (Windows shortcut), .inc (often used as a PHP include file)

Support & Share

If this article helped you, please share or support!

Sponsor
Security Checks Giving You a Headache? Save This Complete Port and File-Upload Blocklist!
https://blog.bytesycn.cn/posts/321d3617-2a6d-40f4-809d-59837206ebf3/
Author
Ryan Zhang
Published at
2025-09-03

Comments

Profile Image of the Author
Ryan Zhang
Keep building, keep thinking, keep creating.
Announcement
Welcome to my blog!
Categories
Tags
Latest Moments
Site Statistics
Posts
30
Categories
7
Tags
42
Total Words
117,260
Running Days
0 days
Last Activity
0 days ago
Table of Contents