Workbooks / Beginner

Website Security Self-Check

A step-by-step guide for small website owners to check the basic security of their own site without attacking it. · 7 chapters · about 75 min

This workbook is for people who run a small website: a shop, a school, a clinic, a blog or a business page. You do not need to be a developer. You need a browser, about an hour, and access to your hosting account or the person who manages it.

Everything in this workbook is passive. You will look at what your site already shows to every visitor. You will not run attack tools, guess passwords or try to break anything.

Only test websites you own, or websites you have written permission to test. Checking someone else's site for exposed files or weak settings without permission can be illegal, even if you mean well. If you manage a site for a client or employer, get their permission in writing first.

Keep a notes file open. For each step, write what you checked, what you found and what needs fixing.

Chapter 1: Know what you are checking

Before you check anything, write down what your website is made of. Attackers look for the parts the owner has forgotten, so this list matters.

  1. Write down every domain and subdomain you use. For example example.pk, www.example.pk, shop.example.pk and any old test site such as dev.example.pk.
  2. Write down where the site is hosted. Note the hosting company, the control panel you use (for example cPanel or Plesk) and who has the login.
  3. Write down what the site is built with. Is it WordPress, Shopify, Wix, a custom PHP site or something else? If it is WordPress or a similar system, list the plugins and theme.
  4. List every account that can change the site. This includes the site admin accounts, the hosting panel, the domain registrar, any FTP or SSH accounts and the email account used to reset all of these.
  5. Confirm you are allowed to test. If you are not the owner, keep the written permission with your notes.

The registrar and the reset email are often forgotten, yet whoever controls the reset email can take over everything else.

If you are new to how websites work, read How Websites Work first. It explains requests, responses and cookies in simple terms.

Checkpoint: you have a written list of your domains, your hosting, your site software and every account that can change the site.

Chapter 2: HTTPS and the certificate

HTTPS encrypts the connection between visitors and your site. Without it, passwords and form data can be read on the network. Browsers also mark plain HTTP sites as "Not secure".

  1. Open your site in a browser and look at the address bar. It should start with https:// and show a padlock or similar icon.

  2. Click the padlock and open the certificate details. Check three things:

    • The certificate is for your domain name.
    • It is valid today and not close to expiring.
    • The browser shows no warnings.
  3. Check that plain HTTP redirects to HTTPS. Type http:// (without the s) in front of your domain. The browser should move you to the https:// version. If you have a terminal, you can also run:

    curl -I http://example.pk
    

    Look for a 301 or 308 status code and a Location: line pointing to https://.

  4. Check every subdomain from Chapter 1 the same way. Old subdomains often have expired certificates.

  5. Look for mixed content. Open your browser's Developer Tools (press F12), go to the Console tab and reload the page. Warnings about "mixed content" mean some images or scripts still load over plain HTTP. Ask your developer to change those links to HTTPS.

  6. Set up automatic renewal. Most hosts offer free certificates that renew automatically. Confirm renewal is turned on, so the site does not suddenly show a warning to customers.

The padlock means the connection is encrypted, not that the site is safe. How the Internet Works explains HTTPS and TLS in more detail.

Checkpoint: your main domain and every subdomain load over HTTPS, HTTP redirects to HTTPS, and the certificate renews automatically.

Chapter 3: Security headers and cookies

Security headers are instructions your server sends to the browser. They turn on extra protections at little cost.

  1. Collect your site's response headers. Use either method:

    • In the browser, open Developer Tools, go to the Network tab, reload the page, click the first request (your page) and look at Response Headers.
    • In a terminal, run curl -I https://example.pk.
  2. Paste the headers into the HTTP Security Headers Checker. It runs in your browser and shows which headers are missing, with suggested values.

  3. Compare your results with this table:

    Header What it does Common value
    Strict-Transport-Security Tells browsers to always use HTTPS max-age=31536000
    Content-Security-Policy Limits where scripts can load from, which reduces XSS damage Depends on your site
    X-Content-Type-Options Stops the browser guessing file types nosniff
    X-Frame-Options Stops other sites putting your page in a frame DENY or SAMEORIGIN
    Referrer-Policy Limits what your URLs reveal to other sites strict-origin-when-cross-origin
  4. Look for headers that leak information. Server: Apache/2.4.41 or X-Powered-By: PHP/7.4.3 tell attackers exactly which versions you run. Ask your host or developer to hide version numbers.

  5. Check your cookies. Log in to your site, then open Developer Tools and find Cookies under the Application (or Storage) tab. Your login or session cookie should have:

    • Secure turned on, so it is only sent over HTTPS
    • HttpOnly turned on, so page scripts cannot read it
    • SameSite set to Lax or Strict
  6. Make changes carefully. Turn on Strict-Transport-Security only after HTTPS works on every page and subdomain. A strict Content-Security-Policy can break parts of a site, so test it on a copy first.

On platforms such as Shopify or Wix, you may not control headers. Note what the platform provides and move on.

The Web Testing Basics cheat sheet has a fuller list of headers and cookie flags. To understand why HttpOnly and Content-Security-Policy matter, read Cross-Site Scripting.

Checkpoint: you have a list of missing headers, any version numbers your site leaks, and the flags on your session cookie.

Chapter 4: Files that should not be public

Websites often expose files by accident: old backups, configuration files and developer folders. Attackers find these with simple guessing. You can check your own site in the same way, one address at a time, in your browser.

Do this only on your own site, or one you have written permission to test.

  1. Read your robots.txt. Visit https://example.pk/robots.txt. This file tells search engines what not to index. Anyone can read it. If it lists paths like /admin-old/ or /backup/, you are pointing attackers to them. Sensitive pages need a login, not a robots.txt line.
  2. Read your sitemap. Visit https://example.pk/sitemap.xml. Make sure it only lists pages that should be public.
  3. Check for a public .git folder. Visit https://example.pk/.git/HEAD. If you see text like ref: refs/heads/main, your source code history may be downloadable. This is serious. Block access to the folder and assume any passwords in the code have leaked.
  4. Check for environment and configuration files. Try /.env and, on WordPress, /wp-config.php.bak or /wp-config.php.old. A blank page or a "403" or "404" is good. If you see text with passwords or keys, treat it as a leak.
  5. Check for backup files. Ask your developer or host whether backups are ever saved inside the website folder. Common names include backup.zip, site.zip, database.sql and www.tar.gz. Backups belong outside the public web folder.
  6. Check for folder listings. Visit a folder such as /uploads/ or /images/. If you see a plain list of every file, directory listing is turned on. Ask your host to turn it off.
  7. Check for test and info pages. Pages such as phpinfo.php, test.php or an old /install/ folder should be deleted after setup.

If you find something exposed:

  • Remove the file or block access to it.
  • Change any password, database password or API key that was inside it. Once a secret has been public, assume someone has copied it.
  • Check your access logs for requests to that file, if your host provides them.

The lesson Recon: Finding Hidden Pages explains how attackers find these files. You can practise safely on a made-up company in the Robots Recon lab.

Checkpoint: you have checked robots.txt, sitemap.xml, .git, configuration files, backups, folder listings and test pages, and fixed or noted anything exposed.

Chapter 5: Protect the admin login

Most small sites are not hacked through clever bugs. They are hacked through weak, reused or stolen admin passwords.

  1. List every admin account in your site, hosting panel and domain registrar. Remove accounts for people who no longer work with you.

  2. Use the lowest role that works. A staff member who writes blog posts does not need full admin rights. This is called least privilege.

  3. Use long, unique passwords. Each admin account needs its own password, ideally stored in a password manager. Test the kind of password you plan to use with the Password Strength Checker. Never type a real password into a website you do not trust.

  4. Turn on two-factor authentication (2FA) for:

    • your site admin accounts
    • your hosting control panel
    • your domain registrar
    • the email account used for password resets

    Most hosting and domain companies support 2FA in their security settings. For WordPress, 2FA is usually added with a well-known plugin.

  5. Limit login attempts. Check whether your platform or host can limit failed logins or block repeated attempts. Many security plugins and hosting firewalls offer this.

  6. Check what the login page reveals. Try logging in with a made-up username and a wrong password. A message like "This user does not exist" helps attackers find real usernames. "Incorrect username or password" is better.

  7. Do not run password-guessing tools against your own live site. They can lock out real users or overload the server. Use the settings above instead.

Changing your admin page address reduces bot noise, but it is not real protection.

For more on why reused passwords are dangerous, read Strong Passwords and 2FA. To see how a site can fail to check who is allowed to see what, read Broken Access Control.

Checkpoint: every admin, hosting and registrar account is still needed, uses a unique password, and has 2FA turned on.

Chapter 6: Updates, plugins and backups

Old software with known bugs is one of the most common ways small sites are hacked. Backups are how you recover when something goes wrong anyway.

Updates

  1. Check your core software version. In WordPress, the dashboard shows whether an update is available. On a custom site, ask your developer which framework and version it uses.
  2. List every plugin and theme. Update the ones you use. Delete the ones you do not use, rather than only turning them off. Inactive plugins can still contain vulnerable files.
  3. Check when each plugin was last updated by its developer. A plugin with no updates for several years may be abandoned. Look for a maintained alternative.
  4. Never install pirated ("nulled") themes or plugins. They are often modified to include hidden backdoors.
  5. Check your server software. In your hosting panel, look for the PHP or other language version. Old versions no longer receive security fixes. Ask your host for help upgrading.
  6. Turn on automatic updates where your platform allows it, at least for security releases.

Backups

  1. Find out what is backed up. You need both the files and the database. Many sites lose orders or posts because only the files were saved.
  2. Find out where backups are stored. If they are only on the same hosting account, an attacker or a billing problem could delete the site and the backups together.
  3. Follow the 3-2-1 rule: keep three copies of your data, on two different types of storage, with one copy kept somewhere else, such as cloud storage in a separate account.
  4. Test a restore. A backup you have never restored is only a hope. Restore it to a test location or ask your host to help, at least once.
  5. Decide how often to back up. A shop that takes daily orders needs daily backups. A site that changes once a month may need less.

Checkpoint: your software, plugins and theme are up to date, unused ones are deleted, and you have a recent backup stored outside your hosting account that you have tested.

Chapter 7: Your final checklist

Copy this checklist into your notes. Tick each item, and write down who will fix anything that is not done.

Inventory and permission

  • I have a list of all domains, subdomains and accounts
  • I own the site, or I have written permission to check it

HTTPS

  • Every domain and subdomain loads over HTTPS without warnings
  • HTTP redirects to HTTPS
  • Certificates renew automatically
  • No mixed content warnings

Headers and cookies

  • Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options and Referrer-Policy are set
  • A Content-Security-Policy is planned or in place
  • Version numbers are hidden
  • Session cookies use Secure, HttpOnly and SameSite

Exposed files

  • robots.txt and sitemap.xml do not reveal private paths
  • .git, .env, configuration backups and database dumps are not public
  • Directory listing is off
  • Test and install files are deleted

Accounts

  • Old admin accounts are removed
  • Every admin, hosting, registrar and reset email account has a unique password and 2FA
  • Failed logins are limited
  • The login page does not reveal which usernames exist

Updates and backups

  • Core software, plugins and themes are up to date
  • Unused plugins and themes are deleted
  • Server language version still receives security updates
  • Backups include files and database, follow 3-2-1, and a restore has been tested

Keep it going

Set a reminder:

  1. Every month: apply updates, check backups ran, and remove accounts that are no longer needed.
  2. Every three months: repeat Chapters 2 to 4 and paste your headers into the checker again.
  3. After any big change (new developer, new plugin, new hosting): repeat the whole workbook.

If you ever find signs that your site was hacked, such as unknown admin users, strange redirects or files you did not add, treat it as an incident. The Incident Response Checklist shows the first steps.

Checkpoint: you have a completed checklist, a list of fixes with owners, and a reminder set for your next monthly check.

Spotted a mistake or something unclear? Report a mistake