NetCat

Attack Surface: How can I reduce the attack surface?

Photo by Azamat E on Unsplash

There are various ways to decrease the attack surface. Let’s take a look at some of the more widely used techniques.

The digital side

The easiest target to attack is the digital attack surface. Let’s explore effective strategies to reduce the attack surface.

Less code, less software attack surface

When you reduce the code you’re running in your desktop, server, or cloud instance, you’re reducing the possibilities for entry points to be discovered and later exploited. Turn off, disable, or remove unnecessary software features, and simplify your code. Fewer codes also mean fewer software bugs and vulnerabilities; at the end of the day, that equals fewer security risks overall.

Remove unnecessary OS software and services.

Cleaning the OS includes removing unnecessary functions, applications, and system tools. Do you need a printing service running if you don’t use a printer? What about that MYSQL server running on the 3306 port? Do you need it if you don’t host any databases? And is Adobe Suite required if you don’t work with any PDF files? Install only the strictly necessary applications for your employees’ daily work, and turn off all unused protocols or services. The same advice goes for servers.

Scan your network ports.

Scanning the open ports in your public IP addresses is often the first thing attackers do when performing infosec reconnaissance on any target.

Luckily, there are many ways for you to stay one step ahead of your attackers. And your best bet is to begin auditing your network ports before they do. In our previous article about most scanned ports, we showed a quick way to get famous using the almighty Nmap command.

While using the Nmap top-ports option helps audit your port exposure, this activity can be done using different port scanners such as Unicornscan, Angry IP Scanner, or Netcat.

Analyze your SSL certificates.

People often see SSL certificates as a way to prove a website is secure, but that can be a big mistake.

How hardened are your SSL certificates? Are you keeping your SSL chains complete and well-secured? Are you using strong cipher suites? These are fundamental questions that all developers, system administrators, and technical managers should ask themselves more often. Additional information can be found in our article: Is SSL a real sign of security?

But SSL security doesn’t end up in your hardening, chain, and overall security score. You also need to consider the data you’re exposing to the public.

Have you ever thought about your SSL certificate expiration and validity? Your attack surface includes all your SSL certificates—valid, active, and expired ones.

Of course, the bad guys can explore such public information. So, remember that while SSL certificates are suitable for encrypting your information…not having a thorough audit or control over them can lead to some of your worst nightmares.

Segmentation your network

Keeping all your assets within a single network is often one of the biggest mistakes you can make. Splitting and segmenting your network is one of the easiest ways to reduce your attack surface.

This will help increase your network barriers and, at the same time, help you gain better and more effective server or desktop controls over all machines connected to the network.

Audit your software, network, and traffic.

Auditing your software is one of the oldest known tactics for reducing your attack surface. This will help detect misconfigurations and outdated software, test the security system, and keep users’ activity under control.

Analyzing the network, protocols, OS services, and current and past traffic over the network is a great way to detect factors that could expose your attack surface even more.

Log analysis plays a critical role in reducing your attack surface. Also, running scheduled audits on overlooked services (such as the DNS service) can help keep your exposure under control, as we covered in our previous article: Why should I perform a DNS audit?

The human side

The physical attack surface involves our world, making its most significant component none other than the human being.

As we’ve said before, company staff is often one of the weakest links in the cybersecurity chain of your online business.

Let’s see what can be done to avoid exposing your physical attack surface as much as possible:

Train all your employees to avoid getting tricked by social engineering calls or phishing emails. These are two of the most common ways to sabotage networks, routers, and other physical hardware, most of the time allowed by your human capital. 

While nothing can prevent rogue employees from stealing sensitive information about your company (including email or user logins), human resource and hiring departments do have psychological tests in hand for screening applicants. These tests may reveal the true nature (including many unconscious aspects) of the people in line to work with your team.

Teaching your employees correct policies concerning using unknown and unauthorized devices in the office can also help reduce baiting attacks. 

There are more social engineering techniques we’ll explore in future posts. Fortunately, they all rely on following company-based security practices and constant employee education.

Attack Surface: What is an attack surface?

Photo by Bernd 📷 Dittrich on Unsplash

What does “attack surface” mean? I see the attack surface as the entire network and software environment exposed to remote or local attacks. For others, it’s the sum of compromised points—although that’s not the attack surface, but the attack vectors.

An attack surface refers to all the ways attackers can exploit your apps. This includes software, operating systems, network services and protocols, domain names, and SSL certificates.

A classic example to help illustrate the concept of attack surface is your business’s physical office. What’s the attack surface of your local office?

The answer is simple: doors, windows, safe boxes, etc. What about your home? Even simpler: front and back doors, windows, garage doors, climbable trees or tables, etc.

The difference between detecting a breach in your home and a violation in your company’s online attack surface can be characterized by the size of the area and its inclusion of multiple complex regions to explore.

You’d clearly notice if someone had broken a window or forced open the door in your home. It’s even easier to have a home alarm system that notifies you immediately.

However, due to the extensive network, software, protocols, and services running within an online company, detecting what part of the attack surface was the origin of the breach or intrusion can be tricky, even with a solid IDS in place, application firewalls, and notification alerts. Most of the time, it may pass unnoticed.

Top 2 Free Open Port Check Tools

Photo by Compare Fibre on Unsplash

The open ports in your hardware could be critical points of vulnerability if the services exposed to them are misconfigured or unpatched. Unfortunately, many organizations are exposing their sensitive resources through such malicious connections, heightening the risk of ransomware attacks, supply chain attacks, and data breaches. Fortunately, free tools can detect all of the open ports in your ecosystem to assess the level of criticality of each exposure.

In this post, we discuss the two best free open port scanners you can start using today to check for open ports in your ecosystem.

What is Open Port Scanning?

Port scanning is the process of analyzing the security of all ports in a network. It involves identifying open ports and sending data packets to select ports on a host to identify any vulnerabilities in received data. Network reconnaissance should be completed regularly to identify and remediate vulnerabilities before cyber attackers discover them. Unfortunately, cybercriminals also use port scanners to garnish vulnerability intelligence about a potential victim before launching a cyberattack.

Because many of these tools are freely accessible, you must assume that cybercriminals are using them to study your open ports. So they cannot be the only security controls protecting your network. This is why network administrators should only use free open port scanners to determine the level of network visibility available to potential cyber attackers. In addition, all free port scanners should be supported with additional security solutions for maximum security. TCP Port scanners can also help penetration testers determine which specific ports accept data to protect them from compromise.

List of Common Network Port Numbers

Every port in a network transports a specific type of network traffic. Each of these ports is assigned a particular number to be easily differentiated.

There are two types of network ports:

TCP – Transmission Control Protocol

UDP – User Diagram Protocol.

What’s the difference between UDP and TCP?

The TCP uses a handshake protocol. TCP also checks each data packet for errors. UDP doesn’t include verification, error checking, or any handshakes. Because of the different processes, TCP is a slower protocol than UDP.

Port numbers range from 0 – 65,535, forming a total of 65,536 ports. These ports are either TCP, UDP, or a combination of both. Because of this extensive range, port numbers are ranked by relevance to shorten the list of network options.

Ports 0-1023 are primarily designed for internet connections.Ports 1024-49151 are ‘registered ports’ designated for exclusive use by registered software corporations and applications. Ports 49152-65,536 are private ports that can be used by anyone.

Tools

1. Nmap

Nmap (short for Network Mapper) is one of the most popular free, open-source port scanning tools. It offers many different port scanning techniques, including TCP half-open scans.

Key features:

Multiple port scanning techniques.

Identifies all open ports on targeted servers.

Operating system detection.

Discovers network services

Scans remote ports

TCP SYN Scanning

UDP and TCP port scanning.

Can scan comprehensive networks housing tens of thousands of network devices. Supports Mac, Linux, Windows Solaris, OpenBSD, Free BSD, and more.

2. Wireshark

Wireshark is a free network sniffing tool used to detect malicious activity in network traffic. This tool can also be used to detect open ports.

Key features:

Reveals request and reply streams in each port.

Malicious network discovery.

Troubleshoots high bandwidth usage.

Offers multiple data packet filters.

Allows users to follow and monitor data streams of interest.