Home › Topics › External Attack Surface Monitoring › Scanning Your Own Perimeter

Exposure Scanning Your Own Perimeter (Safely and Legally)


Your inventory tells you what you think is exposed to the internet. The firewall rules tell you what you intended to expose. Neither tells you what actually answers when a stranger knocks on your public addresses. The only way to learn that is to knock yourself. Connect to your own addresses from outside, on every port that matters, and write down what responds. That exercise is an exposure scan, and it is the most clarifying thing a junior administrator can do for the organization's perimeter.


It is also the exercise most likely to go wrong if done carelessly. Scan the wrong address and you have probed a stranger. Scan too fast and you trip your own intrusion prevention, or your provider's. Scan without telling anyone and the on-call engineer spends an evening chasing what looks like an attack. None of that is hard to avoid, but it has to be avoided on purpose, before the first packet leaves.


This guide walks through an exposure scan of the addresses and names your organization owns and is authorized to test, and nothing else. You will write a scope, pick an outside vantage point, and choose what to look for. You will schedule the work so it bothers nobody and run a first scan. Then you will turn the results into a documented baseline of expected exposure.


In this guide

  • Scope first: write down what you may scan
  • Why the scan has to come from outside
  • What to scan for
  • Tools by role, not by name
  • Scheduling: when, how fast, and who to tell
  • Running the first scan: an annotated walkthrough
  • Interpreting results: expected versus unexpected
  • Documenting the expected-exposure baseline
  • The safety checklist
  • Where to go next

Scope first: write down what you may scan


Before any tool is installed, produce a short written document called the scope. It answers one question without ambiguity: which addresses and names is this organization authorized to scan? The answer comes from the outside-in inventory described in Seeing Your Network the Way Attackers Do. That inventory lists the public ranges your providers assigned you and the public addresses in cloud accounts you own. It also lists the DNS names under domains you registered. If an address is not on that list, it is out of scope, full stop.


The scope also records who approved it. That means the IT manager or security owner in a small organization, or a formal change request in a larger one. The approval is what turns "I scanned some addresses" into "I performed authorized testing of assets we own." That is the difference between routine maintenance and something a lawyer has to explain. A minimal scope file looks like this:


EXTERNAL EXPOSURE SCAN - SCOPE
Organization assets in scope (owned; sources noted):
  203.0.113.0/29        primary circuit block (provider contract, firewall WAN config)
  198.51.100.42         secondary circuit static address (provider contract)
  cloud account "prod"  public addresses of instances and load balancers (console export)
  example.com           all A/AAAA/CNAME targets that resolve INTO the ranges above
Explicitly out of scope:
  anything not listed above
  the provider's own equipment (their router at the far end of our circuit)
  203.0.113.4           vendor appliance; vendor asked for notice before probing
Approved by: (name, role)          Date: (date)
Scan operator: (name)              Contact during scan: (phone)
Vantage point: scanner host at cloud provider, address 192.0.2.77

Two details deserve attention. First, DNS names are in scope only when they resolve to addresses you own. A subdomain pointing at a marketing platform's address is the platform's infrastructure, not yours. You may look up the record, but not scan the target. Second, addresses you once had and gave back are gone; if you changed providers, the old block belongs to someone else now. Resolve any doubt about ownership with paperwork before scanning, never after.


Provider policies: internet and cloud providers publish acceptable-use policies. Most permit testing your own resources, sometimes with conditions such as advance notice or rate limits. Read the policy for both the provider hosting your vantage point and the one serving your office. Following it is part of "legally," not an optional extra.


Why the scan has to come from outside


New administrators often run their first scan from a workstation on the LAN, pointed at the firewall's public address. They then conclude the perimeter is tight. That scan is nearly worthless, because the LAN is on the wrong side of the firewall. Traffic from inside may hairpin through NAT, may be allowed by a "trust internal" rule, or may never reach the WAN interface at all. The firewall's real behavior toward the internet is only visible from the internet.


So you need a vantage point: a machine on the public internet, reached through a path other than your office circuit. The usual choices:


  • A small virtual machine at a cloud provider, in an account your organization owns. Cheap, disposable, easy to give a fixed address. Check that provider's policy on running scans from their network.
  • A second internet circuit at your office, from a different provider, if you have one for redundancy. Be sure the scan actually leaves through that circuit.
  • A machine at another site your organization runs, connected through its own provider rather than your VPN. A VPN tunnel puts you back inside the perimeter.

Whatever you pick, know its public address and write it in the scope. That way, you and the on-call engineer can recognize it in logs and alerts. Resist adding an "allow the scanner" rule to the firewall. The point is to see what everyone else sees, and a special rule gives the scanner the one distorted view on the internet.


What to scan for


"Scanning" covers several distinct questions, each using a different tool and producing a different kind of finding.


Open ports and services

The foundation. For each address in scope, which ports answer? A port scanner reports one of three states per port. Open means something accepted the connection. Closed means the address is reachable but nothing listens there; the host refused. Filtered means no answer at all, which almost always means a firewall silently dropped the probe. Most ports should read filtered and a small, known set should read open. Closed ports on a public address deserve a raised eyebrow. The firewall is letting the probe through to a host that happens not to be listening.


Scan TCP ports thoroughly; that is where nearly all exposed services live. UDP scanning is slower and less reliable because UDP has no handshake. So limit it to the handful that matter: DNS on 53, NTP on 123, SNMP on 161, and your firewall's VPN ports. A public address answering SNMP from the internet is a classic finding.


Service banners: what is actually answering

An open port tells you something listens. A banner tells you what. Many services greet a new connection with an identifying string. A mail server announces its hostname, a remote-shell service announces its software, and a web server names itself in a response header. Collecting banners is identification, not intrusion; you are reading the sign on the door. It matters because "port 443 open" on a firewall address might be your VPN portal. Or it might be the management interface of a device someone forgot to lock down.


Web endpoints

For each open web port on your own addresses, fetch the front page and note what it is. Also note whether plain HTTP redirects to HTTPS and whether an obvious administration path answers. You are confirming identity so the baseline can name each thing, not hunting for weaknesses.


Certificate details

For each encrypted service, record the certificate's subject name, issuer, expiry, and whether it is self-signed. A name that does not match the address's purpose is a strong hint you have found equipment rather than a server. So is a certificate issued by "the device itself." Ongoing expiry tracking belongs to the certificate expiry guide; here you capture the facts.


Mail-related records

Your domain's mail records are exposure too. But they live in DNS rather than on a port. Looking them up is a read of public data that needs no vantage point. The DNS and certificate guide covers reviewing them; run the lookup in the same scheduled job so records and ports share a timestamp.


Tools by role, not by name


This topic describes tools by what they do. Products come and go; roles do not, and once you know the role you can evaluate any tool that claims it.


RoleWhat it doesWeight and frequency
Port scannerSends connection attempts to a list of ports on your own addresses and reports open, closed, or filtered; usually grabs banners tooLight; the workhorse of every scheduled scan
Vulnerability scannerConnects to each open service and compares what it finds against a catalog of known weaknesses, producing findings with severitiesHeavier and slower; run less often, only against your own assets under the same scope
DNS lookup utilityQueries public DNS for your records: names, addresses, mail entriesTrivial; built into every operating system
Certificate inspection utilityConnects to an encrypted service you own and prints the certificate it presentsTrivial; part of the standard encryption toolkit
Your own firewall logsShow the scan arriving from the inside, confirming which probes reached which ruleFree; the best cross-check you have

A port scanner and a vulnerability scanner are different animals. The port scanner asks "what is there?" and is nearly harmless. The vulnerability scanner asks "what is wrong with it?" by sending many more requests, some unusual enough to upset fragile devices. Both belong only inside your scope. Start with the port scanner, get the baseline right, and add the heavier tool once you know what it will be talking to.


Scheduling: when, how fast, and who to tell


A scan is a burst of unusual traffic aimed at your own front door. Several parties notice: your firewall, any intrusion prevention, your provider, and whoever is on call. Schedule with all of them in mind.


  • Off-hours. If a fragile device reboots because it saw an unfamiliar probe (older equipment does this), you want that to happen when nobody needs it.
  • Announced. Tell the on-call engineer, the security owner, and anyone who reads firewall alerts. Give them the vantage address and the time window. An unannounced scan looks exactly like the start of an attack.
  • Rate-limited. Configure the scanner to go slowly: a modest number of probes per second, one address at a time, with pauses between hosts. A slow scan is less likely to trip your own defenses or bother your provider. It takes longer, which is fine for a scheduled, unattended job.
  • Consistent. Same vantage, same port list, same rate, every time. The drift guide depends on scans being comparable.

Expect your own intrusion prevention to react. If it blocks the vantage address after a few probes, the rest of the scan reads as filtered, which is misleading. Either slow down until it stops reacting, or accept the block as proof the defense works. If you accept the block, cross-check the remaining ports against firewall rules and logs. Do not whitelist the scanner.


Running the first scan: an annotated walkthrough


Here is what a first scan of the example scope produces, condensed into a tool-neutral format. The addresses are the organization's own; the scanner is the cloud host named in the scope; the rate is slow; on-call has been told. Ports not listed were filtered.


# scope: 203.0.113.0/29 (see scope file)   vantage: 192.0.2.77   rate: slow
# ports: full TCP range, plus UDP 53,123,161,500,4500

203.0.113.1  (fw-01, firewall)
  500/udp    open      VPN key exchange
  4500/udp   open      VPN (NAT traversal)

203.0.113.2  (web-01, website)
  80/tcp     open      http    - redirects to https
  443/tcp    open      https   - cert: www.example.com, public issuer

203.0.113.3  (mail-01, mail gateway)
  25/tcp     open      smtp    - banner: 220 mail.example.com ESMTP
  443/tcp    open      https   - cert: mail.example.com (webmail)
  587/tcp    open      smtp submission

203.0.113.4  (vendor appliance - excluded per scope, not probed)

203.0.113.5  no response on any probed port

203.0.113.6  (NOT IN INVENTORY)
  22/tcp     open      ssh     - banner: vendor build string
  8443/tcp   open      https   - cert: self-signed, name "device"
  161/udp    open      snmp    - responded to probe

Read it top to bottom. The firewall answers only on the VPN ports, which is exactly right. The web server answers on the two web ports and nothing else, with plain HTTP politely redirecting to HTTPS. The mail gateway answers on the three ports a mail gateway should, and its banner names the host you expect. So far, the perimeter matches intent.


Then comes 203.0.113.6. It is not in the inventory. It answers on a remote-shell port with a banner identifying a device rather than a server. It also answers on a web port with a self-signed certificate calling itself "device," and on SNMP from the open internet. This is the vendor's remote-access box from the first guide. And the scan has told you three things the inventory could not. It told you that the box exists, what it is, and that its management interfaces face the world. Notice too that 203.0.113.5 answered nothing. It stays in scope and gets scanned every time, because "nothing" is a state that can change.


Interpreting results: expected versus unexpected


Every line in a scan result lands in one of two buckets. Expected exposure is an open port that is in the inventory, on the address the inventory names. It runs the service the inventory says, because someone decided it should. Unexpected exposure is everything else. That includes an unlisted address, an extra port on a listed address, or a banner that says the service is not what the inventory claims. Sorting results into those buckets is the whole interpretive job, and the inventory is what makes it possible.


Within the unexpected bucket, prioritize in roughly this order. First come management interfaces of any kind (remote desktop, remote shell, web administration panels, SNMP) reachable from the internet. Next comes anything not in the inventory at all, followed by database and file-sharing ports. Then come services with self-signed certificates on public addresses, which usually means equipment rather than a maintained server. Finally come ordinary services on the wrong port or address. The first category is urgent because a management interface is a door with the keys behind it. And that category is where the vendor box landed.


One subtler reading: a public address with many closed ports has a firewall rule that is too permissive, even if nothing happens to be listening today. That is a finding about the rule, not the host, and it belongs on the list.


Documenting the expected-exposure baseline


The scan is not finished until its results are written into a baseline. This is a plain file listing, for each address in scope, the ports that are supposed to be open. It also lists the service on each, the owner, the reason, and the date someone last confirmed it. This is what every future scan is compared against, and what turns a one-off exercise into monitoring.


# expected-exposure baseline   (reviewed: date, by: name)
# address        port/proto   service          owner      justification
203.0.113.1      500/udp      vpn              netadmin   remote access for staff
203.0.113.1      4500/udp     vpn nat-t        netadmin   remote access for staff
203.0.113.2      80/tcp       http redirect    webteam    public website
203.0.113.2      443/tcp      https            webteam    public website
203.0.113.3      25/tcp       smtp             mailadmin  inbound mail
203.0.113.3      443/tcp      https webmail    mailadmin  webmail for staff
203.0.113.3      587/tcp      submission       mailadmin  outbound from clients
203.0.113.5      (none)       -                netadmin   spare; must stay silent
203.0.113.6      -            UNRESOLVED       ?          vendor box found in scan; ticket open

Notice what the baseline does with the vendor box: it does not pretend the box is expected, and it does not pretend it is gone. It records the finding as unresolved with a ticket, so the next scan compares against the truth. When the ticket closes, either the box is removed and the line deleted, or it is kept under a proper owner with reduced exposure. In the latter case, the line is filled in. The baseline should only contain things a named person has agreed to. Keep it under version control, or at least date-stamped copies. That way, you can answer "when did this port become expected, and who said so?" in every incident review.


The safety checklist


Run through this before every scan, not just the first. It takes two minutes and is the difference between routine maintenance and an incident you caused. Save the raw results with a timestamp and the scanner settings every time; the drift comparison depends on it.


ItemAsk yourselfWhy it matters
ScopeIs every target on the written list of addresses and names we own? Has ownership changed since?Anything outside the list is someone else's property
AuthorizationHas a named person approved this scan, and is the approval recorded with the scope?Turns activity into authorized testing
VantageIs the scanner outside the perimeter, with a known address, not tunneling through the VPN?An inside scan shows the wrong view; an unknown vantage address confuses your own responders
TimingIs the window off-hours and clear of maintenance, backups, and busy periods?A fragile device that reacts badly should do so when nobody needs it
RateIs the scanner configured slow, one host at a time, with the same settings as last time?Avoids tripping defenses; keeps scans comparable
NotificationDo on-call, the security owner, and anyone reading firewall alerts know the window and vantage address?An unannounced scan looks like an attack
ExclusionsAre fragile or vendor-managed devices marked out of scope or scheduled with their owner's agreement?Some equipment misbehaves when probed
Stop conditionDo you know what would make you abort, and how to stop the scanner at once?Stopping cleanly is part of doing this responsibly

Where to go next


You now know how to find out what your perimeter actually exposes. Write a scope limited to what you own and get it signed. Scan from a vantage point on the internet, slowly, at a quiet hour, with everyone told. Collect ports, banners, web identities, and certificate facts. Sort every result into expected or unexpected. And record the expected set as a baseline containing only things a named person agreed to. Nothing in that process touches an address that is not yours, and nothing goes beyond identification.


The baseline feeds the next guide, Open-Port Drift: Alerting When Exposure Changes. That guide compares every scheduled scan against the baseline and alerts when the answer changes. The DNS and certificate guide handles the records side. The program guide sets the cadence for repeating all of this without it eating your week. All of them live under External Attack Surface Monitoring.


Put this into practice with SysPeep Monitor

An outside scan tells you what the internet sees; it cannot tell you what the thing behind the port is. That is where an inside view earns its place. SysPeep Monitor discovers the devices and interfaces on your network. It tracks the firewall and the servers behind your public addresses over SNMP, WMI, and SSH, and alerts when their health changes. So when a scan turns up something unexpected you already have the inside inventory to identify it. The free trial installs on a Windows machine in minutes.

Download Free TrialLearn About SysPeep