Small and medium-sized enterprises (SMEs) rely on their websites for leads, sales and credibility, yet most run them with no dedicated security staff. Attackers know this. Automated bots scan the internet continuously for outdated CMS versions, vulnerable extensions and weak passwords, and a compromised site is quickly turned into a platform for spam, phishing, malware distribution or search engine poisoning.

This paper does two things. First, it is a hands-on technical tutorial: how to build an authorized testing environment with Kali Linux on Ubuntu, assess a Joomla site with tools such as joomscan, nuclei and OWASP ZAP, monitor it with Wazuh, and detect and clean a Japanese keyword SEO spam infection. Second, it explains how KeenComputer.com helps SMEs prevent, detect, clean and monitor against website attacks, so owners who do not have the time or in-house skills can get the same outcome with a predictable process.

Audience: SME owners, IT administrators, web developers and managed-service staff.

Defending and Recovering SME Websites: A Joomla Security Tutorial

White paper by KeenComputer.com (KEENSOFTWARE), Winnipeg, Manitoba

Executive Summary

Small and medium-sized enterprises (SMEs) rely on their websites for leads, sales and credibility, yet most run them with no dedicated security staff. Attackers know this. Automated bots scan the internet continuously for outdated CMS versions, vulnerable extensions and weak passwords, and a compromised site is quickly turned into a platform for spam, phishing, malware distribution or search engine poisoning.

This paper does two things. First, it is a hands-on technical tutorial: how to build an authorized testing environment with Kali Linux on Ubuntu, assess a Joomla site with tools such as joomscan, nuclei and OWASP ZAP, monitor it with Wazuh, and detect and clean a Japanese keyword SEO spam infection. Second, it explains how KeenComputer.com helps SMEs prevent, detect, clean and monitor against website attacks, so owners who do not have the time or in-house skills can get the same outcome with a predictable process.

Audience: SME owners, IT administrators, web developers and managed-service staff.

Scope note: All testing techniques in this paper must be used only against systems you own or have written authorization to test. Prefer a staging copy over production.

1. Why SME Websites Are Targeted

SMEs are attractive targets for practical rather than personal reasons:

  • Automation: attackers do not choose victims. Scripts probe every reachable site for known flaws.
  • Delayed patching: CMS cores, templates and third-party extensions are often updated irregularly, if at all.
  • Weak credentials and no 2FA: administrator accounts are protected by reused or guessable passwords.
  • Little visibility: without logging, file integrity monitoring or alerting, infections can persist for months.
  • Reputation value: a site with established search rankings is valuable for hiding spam, redirects and malicious downloads.

The business impact goes well beyond a defaced home page: lost search traffic, browser and search engine warnings, blacklisted email domains, customer data exposure, downtime and the cost of emergency recovery.

2. Anatomy of a Common Attack: The Japanese SEO Spam Hack

The Japanese keyword hack (also called Japanese SEO spam) is a frequent infection on Joomla, WordPress and other PHP CMS sites. Its goal is to use your domain's authority to rank pages selling counterfeit or unrelated goods.

2.1 Typical symptoms

  • Search results for site:yourdomain.com show Japanese-language product titles and descriptions that you never published.
  • The spam pages often appear only to search engine crawlers (cloaking), so the site looks normal when you browse it.
  • Extra sitemap files or a very large sitemap listing thousands of unknown URLs.
  • Unknown PHP or HTML files with random names, frequently in images/, media/, cache/, tmp/ or the webroot.
  • Modified .htaccess, index.php or template files containing user-agent or referrer checks.
  • Unknown Super User accounts, or unfamiliar owners and verification tokens in Google Search Console.
  • Sudden drops in organic traffic and security warnings in search results.

2.2 Typical attack chain

  1. Entry: an outdated extension, a stolen or weak admin password, or a vulnerable upload form.
  2. Foothold: a web shell or backdoor PHP file is dropped, often disguised as a legitimate file name.
  3. Persistence: extra admin accounts, modified core files, cron jobs, or multiple hidden backdoors.
  4. Monetization: thousands of spam pages are generated, sitemaps are injected, and cloaking rules serve the spam to crawlers.
  5. Reinfection: if any backdoor or the original vulnerability remains, the site is infected again after a superficial cleanup.

The last step is why cleanup without root-cause analysis so often fails.

3. Tutorial Part A: Building an Authorized Testing Environment

3.1 Install Kali tooling on Ubuntu

Do not add Kali repositories to Ubuntu with apt. Mixing package sets breaks systems. Use a container or a virtual machine.

Option 1: Docker (lightweight)

sudo apt install docker.io
docker pull kalilinux/kali-rolling
docker run -it --rm --name kali --net=host \
-v $PWD/reports:/reports kalilinux/kali-rolling bash

# inside the container
apt update
apt install -y joomscan nikto nmap sqlmap nuclei whatweb wafw00f dirb

Option 2: Full virtual machine (GUI, Burp Suite, ZAP)

sudo apt install qemu-kvm virt-manager

Download the pre-built Kali VM image from the official Kali website, verify its checksum, and import it into your hypervisor.

3.2 Prepare a staging copy

Testing against production risks outages and polluted logs. Clone the site to a staging host:

  1. Copy the webroot and export the database.
  2. Change configuration.php to use the staging database and set a staging URL.
  3. Block search engines (robots.txt disallow and HTTP basic auth).
  4. Scrub or anonymize customer data if the staging host is less protected.

3.3 Define scope and rules of engagement

Record, in writing: target hosts, permitted tools, testing windows, who to contact if something breaks, and how findings will be reported. For client engagements this document is mandatory.

4. Tutorial Part B: Assessing a Joomla Site

4.1 Reconnaissance and fingerprinting

whatweb https://staging.example.com
wafw00f https://staging.example.com
nmap -sV -sC -p 80,443,22 staging.example.com

The goal is to learn the Joomla version, web server, TLS configuration and whether a web application firewall is present.

4.2 Joomla-specific scanning

joomscan -u https://staging.example.com

joomscan reports the detected Joomla version, known core vulnerabilities for that version, the administrator login location, exposed configuration backups and installed components.

nuclei -u https://staging.example.com -tags joomla
nikto -h https://staging.example.com

nuclei applies community templates for known CVEs and misconfigurations. nikto reports general web server issues such as dangerous files and outdated server software.

4.3 Authenticated and application-level testing

  • OWASP ZAP or Burp Suite Community: crawl the site while logged in as different roles and run active scans.
  • sqlmap: test suspect parameters in third-party extensions, only on staging.
  • testssl.sh: verify TLS protocols and ciphers.
  • Brute-force resistance: test rate limiting and lockout on your own login page only, with a small, controlled wordlist.

4.4 Prioritizing findings

Rank findings by exploitability and business impact. In practice, the highest priorities for Joomla sites are:

  1. Core or extension versions with known remote code execution or SQL injection flaws.
  2. Exposed administrator interfaces without 2FA or IP restriction.
  3. Writable and executable upload directories.
  4. Leaked backup files, configuration.php~ or database dumps in the webroot.
  5. Missing security headers and weak TLS settings.

5. Tutorial Part C: Continuous Monitoring with Wazuh

Wazuh is an open-source security platform providing host-based intrusion detection, file integrity monitoring (FIM), vulnerability detection and security configuration assessment. It is a monitoring tool rather than a pentest tool, so deploy the manager on a separate server and install an agent on the web server.

5.1 Installation outline

# on the Wazuh server (check the official documentation for the current version URL)
curl -sO https://packages.wazuh.com/4.x/wazuh-install.sh
sudo bash wazuh-install.sh -a

Then enroll the web server using the agent deployment command generated by the Wazuh dashboard.

5.2 File integrity monitoring for Joomla

Add to the agent's ossec.conf:

<syscheck>
<directories realtime="yes" check_all="yes" report_changes="yes">/var/www/site</directories>
<ignore>/var/www/site/cache</ignore>
<ignore>/var/www/site/administrator/cache</ignore>
</syscheck>

Useful alerts to build as custom rules:

  • Creation of any .php file in images/, media/, tmp/ or logs/.
  • Modification of configuration.php, .htaccess or index.php.
  • New files in the webroot with random names.
  • Web server child processes spawning shells.

5.3 Log analysis

Forward nginx or Apache access and error logs to Wazuh. Look for repeated requests to /administrator, POST requests to unusual PHP files, and bursts of 404 or 200 responses for scripted file names.

5.4 Active response

Enable active response to block IPs that repeatedly trigger authentication failures or web attack signatures. Pair it with fail2ban at the host level.

6. Tutorial Part D: Detecting and Cleaning a Japanese SEO Spam Infection

6.1 Preserve evidence first

Take a full snapshot of files and database before changing anything, and put the site into maintenance mode. A forensic copy lets you find the entry point and prove what happened.

6.2 Triage on the server

# recently modified files
find /var/www/site -type f -mtime -14 -not -path "*/cache/*" -ls

# PHP files in directories that should only hold media
find /var/www/site/{images,media,tmp,cache,logs} -name "*.php*" -ls

# common obfuscation functions
grep -RIlE "eval\s*\(|base64_decode|gzinflate|str_rot13|assert\s*\(" \
--include=*.php /var/www/site

# user-agent cloaking logic
grep -RIliE "googlebot|HTTP_USER_AGENT" \
--include=*.php --include=.htaccess /var/www/site

# compare against a clean copy of the same Joomla version
diff -rq /var/www/site/libraries /tmp/joomla-fresh/libraries

6.3 Scanner and tool support

  • Linux Malware Detect (maldet) and ClamAV for signature-based scanning.
  • YARA with community PHP malware rules for pattern matching.
  • Akeeba Admin Tools or RSFirewall for Joomla-aware file change scanning and web application firewall rules.
  • Wazuh FIM to show exactly which files changed and when.

No scanner finds everything. Treat scanner output as leads for manual review, not as proof of a clean site.

6.4 Database inspection

Search for injected content and rogue accounts:

SELECT id, username, email, registerDate FROM #__users
ORDER BY registerDate DESC;

SELECT id, title FROM #__content
WHERE introtext LIKE '%<script%' OR fulltext LIKE '%<iframe%';

SELECT extension_id, name FROM #__extensions ORDER BY extension_id DESC;

Also review #__modules, #__template_styles and #__user_usergroup_map for unauthorized privilege changes.

6.5 Cleanup procedure

  1. Identify the entry point by reviewing access logs around the timestamp of the earliest malicious file.
  2. Replace Joomla core with a fresh package of the same version, then upgrade to the latest supported release.
  3. Reinstall every extension and template from the vendor and delete any that are unused or abandoned.
  4. Remove malicious PHP files, injected .htaccess rules, spam sitemaps and doorway pages.
  5. Clean the database of rogue users, injected content and malicious plugins.
  6. Rotate all secrets: Joomla admin passwords, database credentials, the $secret value, SSH and FTP keys, hosting control panel and API tokens.
  7. Check persistence: user and root crontabs, systemd timers, authorized_keys and hidden files.
  8. Retest with joomscan, nuclei and a fresh integrity comparison before taking the site out of maintenance mode.
  9. Monitor closely for at least 30 days for reinfection.

6.6 Hardening

Block PHP execution in directories that hold uploads or caches. Example nginx rule:

location ~* ^/(images|media|tmp|cache|logs)/.*\.php$ {
deny all;
}

Additional measures:

  • Use 644 permissions for files and 755 for directories, and keep configuration.php as restrictive as possible.
  • Enable two-factor authentication for all administrators.
  • Restrict /administrator by IP address or place it behind a VPN or additional authentication.
  • Deploy a web application firewall and fail2ban.
  • Keep automated, offsite and tested backups.
  • Apply updates on a schedule, with a staging check beforehand.

6.7 Search engine recovery

  1. In Google Search Console, remove unknown owners and verification tokens.
  2. Submit a clean sitemap and review the Security Issues and Manual Actions reports.
  3. Return 410 Gone for spam URLs so they drop from the index faster, and use the Removals tool for urgent cases.
  4. If a manual action was applied, document the cleanup and request a review.
  5. Check your domain against email and web blocklists and request delisting where needed.

7. Prevention Checklist for SMEs

Area

Control

Patching

Update CMS core, extensions and templates monthly; remove unused ones

Access

Unique strong passwords, 2FA, least-privilege roles, IP restriction for admin

Hosting

Separate sites into isolated accounts or containers; no shared credentials

Web server

No PHP execution in upload directories; security headers; TLS 1.2 or higher

Monitoring

File integrity monitoring, log centralization, uptime and content-change alerts

Backups

Daily offsite backups, versioned, with periodic restore tests

Incident response

Written plan: who to call, how to isolate, how to restore

Search presence

Search Console alerts enabled; periodic site: checks for spam

8. How KeenComputer.com Can Help

KeenComputer.com, the regional IT and managed services arm of KEENSOFTWARE based in Winnipeg, Manitoba, helps SMEs protect and recover their websites without needing an in-house security team. Our approach combines the tooling described in this paper with practical, business-focused delivery.

8.1 Services

Website Security Assessment An authorized, scoped assessment of your Joomla, WordPress or Magento site using tools such as joomscan, nuclei, OWASP ZAP and manual review. You receive a prioritized findings report with clear remediation steps written for both owners and technical staff.

Emergency Malware and SEO Spam Cleanup For sites already compromised, including Japanese keyword hacks, redirect malware and defacements. Our process follows Section 6: evidence preservation, entry-point analysis, core and extension replacement, database cleanup, credential rotation and retesting.

Search Engine Reputation Recovery Cleaning Search Console ownership, removing spam URLs, submitting clean sitemaps and managing reviews for blacklists or manual actions, so your visibility returns after the cleanup.

Hardening and Secure Configuration Web server rules, permissions, two-factor authentication, administrator access restriction, web application firewall setup and secure backup design.

Managed Security Monitoring Wazuh-based file integrity monitoring, log analysis and alerting on your web servers, with a human reviewing and responding to meaningful alerts rather than leaving you with an unread dashboard.

Patch and Maintenance Plans Scheduled, tested updates of CMS core, extensions and server software, with staging checks and rollback plans.

Backup and Recovery Planning Offsite, versioned backups with documented and tested restore procedures, so recovery takes hours instead of weeks.

Security Awareness for Site Owners Short practical sessions on password hygiene, phishing and safe administration habits for the people who manage your content.

8.2 Engagement Process

Stage

What happens

What you receive

1. Intake

Scope, access and authorization confirmed; site placed in maintenance mode if infected

Signed scope and contact plan

2. Preserve

Full file and database snapshot

Forensic copy held securely

3. Assess

Scanning, manual review, log analysis

Findings and root-cause summary

4. Remediate

Cleanup, patching, credential rotation

Change log of every action

5. Harden

Configuration and access controls

Hardened baseline documented

6. Verify

Retesting, search engine recovery steps

Verification report

7. Monitor

Ongoing monitoring and maintenance (optional)

Regular reports and alerts

8.3 Why an SME Should Work with a Regional Partner

  • Accountability: a local team that is reachable, in your time zone and invested in the long-term relationship.
  • Breadth: experience across websites, ecommerce platforms, hosting infrastructure and managed IT, so problems that span several layers are handled by one team.
  • Engineering depth: KEENSOFTWARE's sister unit, IAS Research, brings applied AI and secure-systems engineering experience that informs our monitoring and automation approach.
  • Plain language: reports that business owners can act on, with technical appendices for developers.
  • Right-sized pricing: tiered options from one-off cleanup to continuous monitoring, so you pay for the protection you actually need.

8.4 Choosing an Engagement Level

Situation

Recommended starting point

Site is actively hacked, spam in search results

Emergency cleanup, followed by hardening and 30-day monitoring

Site looks fine but has never been tested

Security assessment and hardening

Site was cleaned before and keeps getting reinfected

Root-cause review, full rebuild of core and extensions, managed monitoring

Multiple sites or an online store

Maintenance plan with monitoring and offsite backup

9. Conclusion

Website attacks on SMEs are usually opportunistic, repeatable and preventable. The same fundamentals defeat most of them: current software, strong access control, restricted execution in upload directories, tested backups and continuous monitoring. When prevention fails, a disciplined cleanup that finds the entry point and removes every persistence mechanism is what stops reinfection and restores search visibility.

KeenComputer.com combines these practices into services built for organizations that need strong security without a dedicated security department.

Next step: contact KeenComputer.com for a website security assessment or an emergency cleanup consultation. [Insert contact email, phone and website link before publishing.]

Appendix A: Incident Response Quick Card

  1. Do not delete anything yet. Snapshot files and database.
  2. Enable maintenance mode or restrict access by IP.
  3. Change admin, hosting, database and SSH credentials from a clean machine.
  4. Review access logs and Wazuh alerts to find the first malicious activity.
  5. Replace core and extensions, remove rogue files and accounts.
  6. Retest, then restore public access.
  7. Clean up Search Console and monitor for 30 days.

Appendix B: Tool Reference

Tool

Purpose

joomscan

Joomla version, component and misconfiguration scanning

nuclei

Template-based CVE and misconfiguration detection

nikto, whatweb, wafw00f

Server issues, fingerprinting, WAF detection

sqlmap

SQL injection testing (staging only)

OWASP ZAP, Burp Suite

Authenticated crawling and active scanning

testssl.sh

TLS configuration review

Wazuh

File integrity monitoring, log analysis, vulnerability detection

ClamAV, maldet, YARA

Malware signature and pattern scanning

Akeeba Admin Tools, RSFirewall

Joomla file scanner and web application firewall

fail2ban

Automatic blocking of repeated abusive requests

This document is provided for educational purposes. Apply testing techniques only to systems you own or are explicitly authorized to assess.