Have I Been Hacked? Hacked website security inspection

Have I Been Hacked? How to Check If Your Website Is Hacked and Fix It

Ali Hussain - Laravel Developer

Ali Hussain

If you're wondering, "Have I been hacked?" and suspect something is wrong with your website, you're in the right place. Unexpected redirects, unfamiliar pages appearing in Google, suspicious administrator accounts, or browser security warnings can all indicate a potential website compromise.

The quickest way to find out is to check your website files, administrator accounts, server activity, database, hosting logs, and Google Search Console. In this guide, I will explain how to identify the warning signs, investigate a potentially hacked website, contain the damage, and recover your website without overlooking the vulnerability that caused the problem.

How Do I Know If My Website Has Been Hacked?

A hacked website does not always display a message saying it has been compromised. Attackers often try to remain unnoticed by injecting malicious scripts, creating hidden pages, stealing credentials, or using the server to distribute spam.

Look for these common warning signs:

  • Unexpected redirects: Visitors are redirected to gambling, pharmaceutical, adult, phishing, or other unfamiliar websites.
  • Unknown website pages: New URLs appear on your domain containing spam keywords, suspicious product listings, or content you never published.
  • Unfamiliar administrator accounts: New users have appeared in WordPress, your Laravel application, or your hosting control panel.
  • Modified website content: Your homepage, navigation, footer, or other pages contain unfamiliar links, scripts, or advertisements.
  • Browser security warnings: Chrome or another browser warns visitors that your website may contain malware or deceptive content.
  • Unexpected server activity: Your hosting account consumes unusually high resources, sends suspicious emails, or generates unexplained traffic.
  • Login problems: Your administrator password no longer works, or your account email and password have been changed without permission.
  • Unfamiliar files: New PHP files, scripts, or modified configuration files appear in directories where they do not belong.

One symptom alone does not always prove a compromise. For example, a redirect might come from a misconfigured plugin, advertising script, or legitimate third-party integration. However, multiple unexplained changes deserve immediate investigation.

7 Ways to Check If Your Website Has Been Hacked

1. Check Your Website in an Incognito Browser

Start with a simple browser check. Open your website in an incognito or private browsing window and inspect several pages, not just the homepage.

Pay particular attention to:

  • Unexpected redirects when opening pages.
  • Pop-ups or advertisements you did not configure.
  • Unknown links appearing in the header, footer, or content.
  • Browser warnings about dangerous or deceptive websites.
  • Different content appearing on mobile and desktop devices.

Some malicious scripts behave differently depending on the visitor's browser, device, location, or referral source. Therefore, a website appearing normal when you are logged in does not guarantee that visitors receive the same experience.

Also test a few pages using a different browser and device. If suspicious behavior occurs only for certain visitors, investigate conditional redirects and injected JavaScript.

2. Search Google for Unknown Pages on Your Domain

Attackers sometimes create hundreds of spam pages without changing your visible website. These pages may target search queries related to gambling, counterfeit products, pharmaceuticals, or unrelated commercial keywords.

Use Google's site search operator:

site:example.com

Replace example.com with your actual domain. Review the indexed results and look for unfamiliar URLs, page titles, and descriptions.

For example, if you operate a Laravel development website but Google suddenly displays pages about unrelated online casinos, investigate immediately.

Keep in mind that this search is not a complete security scan. Google may not have indexed every compromised page, and old search results can remain visible after a page has been removed.

3. Check Google Search Console Security Issues

Google Search Console is one of the most useful free tools for identifying website security problems.

Open your verified property in Google Search Console and check the Security Issues report. Google may identify problems such as:

  • Hacked content.
  • Malware distribution.
  • Deceptive pages or phishing content.
  • Injected scripts or other harmful website behavior.

If Google identifies a problem, it generally provides information about the affected URLs and the type of security issue detected.

Also check the Messages section for security notifications. Make sure your Search Console account is protected because an attacker with access to it may interfere with your website monitoring.

Official resource: Google's guide to preventing malware infections.

Important: A clean Security Issues report does not prove your website is safe. Google only reports problems it has detected, and some compromises may remain undiscovered.

4. Inspect Website Files for Suspicious Changes

If you have hosting control panel, SSH, or SFTP access, inspect your website's files for unexpected modifications.

Start by checking:

  • index.php and other entry-point files.
  • .htaccess and web server configuration files.
  • PHP files inside upload directories.
  • Theme and plugin files in WordPress installations.
  • Laravel application files and the public directory.
  • Unknown files in temporary, cache, or writable directories.

Look for unfamiliar PHP scripts, suspicious encoded strings, unexpected remote requests, or JavaScript that loads from unknown domains. Functions such as eval(), base64_decode(), and gzinflate() can appear in malicious code, but they also have legitimate uses. Their presence alone is not proof of malware.

Compare modified files against a trusted source, such as your Git repository, official application release, or a verified clean backup. Pay particular attention to files modified around the time suspicious activity began.

For Laravel applications, inspect application code, configuration, Composer dependencies, scheduled tasks, queue workers, and writable directories. A compromised file may be placed somewhere that does not appear in the normal application workflow.

5. Review Administrator Accounts and Database Records

An attacker who gains access to your website may create a new administrator account to maintain access even after you change your own password.

For WordPress, review the Users section and look for unfamiliar administrator accounts, unexpected email addresses, and changes to existing user roles.

For custom PHP and Laravel applications, inspect the users table and any permission or role management tables. Check for:

  • New accounts you cannot identify.
  • Unexpected administrator or super-admin permissions.
  • Modified email addresses or password reset details.
  • Unfamiliar API tokens and active sessions.
  • Unexpected changes to application settings.

Also review database records for spam content, injected links, and unfamiliar configuration values. Do not delete suspicious records before preserving a backup or collecting evidence. Some malicious entries may be connected to a larger compromise that needs to be understood first.

6. Check Hosting Logs and Server Activity

Website logs can help establish when an attacker accessed your application and what happened afterward.

Ask your hosting provider for relevant access logs, error logs, authentication logs, and other available security records. Depending on your hosting environment, investigate:

  • Repeated login attempts and suspicious authentication activity.
  • Requests to unfamiliar PHP files or administrative endpoints.
  • Unexpected POST requests to upload or file-management functionality.
  • Unusual requests to configuration or backup files.
  • Changes to scheduled jobs and background processes.
  • Unexpected outbound connections or email activity.

For Laravel applications, review storage/logs/laravel.log and relevant web server logs. Laravel application logs can help identify application errors and unusual behavior, but they are not a complete record of server-level activity.

Check the hosting account separately. A website can appear clean while an attacker still has access through SSH, FTP, a hosting control panel, or another application sharing the same account.

7. Run a Website Malware Scan

Use an external website scanner and, where appropriate, an application-level security scanner to look for malicious scripts, suspicious URLs, and known malware signatures.

For WordPress, a reputable security scanner can inspect core files, plugins, themes, and other parts of the installation. External scanners can also identify publicly visible malicious content and browser security problems.

However, scanners have limitations. They may miss obfuscated PHP code, backdoors, compromised administrator accounts, malicious database records, or malware that activates only under specific conditions.

I recommend treating scan results as investigation leads rather than a final security verdict. A clean scan is not the same as a clean website.

What Should You Do If Your Website Is Hacked?

If you have confirmed unauthorized access or found convincing evidence of malware, the priority is to contain the incident before attempting to repair the website.

Step 1: Preserve Evidence and Contact Your Hosting Provider

Record the suspicious URLs, screenshots, warning messages, approximate discovery time, and any changes you noticed. If possible, preserve a snapshot of the affected website files and database before modifying anything.

Contact your hosting provider and explain that you suspect a security compromise. Ask whether they can isolate the affected account, preserve server logs, identify suspicious processes, and investigate whether other websites on the same hosting account are affected.

Step 2: Contain the Compromised Website

If your website is distributing malware, redirecting visitors to phishing pages, or exposing sensitive information, temporarily restrict public access. Depending on the situation, your hosting provider may be able to isolate the site or place it behind an appropriate maintenance or access restriction.

Do not simply delete suspicious files while the attacker may still have access. An active backdoor can recreate deleted files or reinfect the application.

Step 3: Secure All Access Credentials

From a trusted, malware-free device, secure the accounts that could provide access to your website.

Review and rotate:

  • Website administrator passwords.
  • Hosting control panel credentials.
  • SSH, SFTP, and FTP credentials.
  • Database usernames and passwords.
  • Application API keys and third-party service tokens.
  • Email and domain registrar credentials.
  • Cloud storage and deployment credentials.

Enable multi-factor authentication wherever available. Revoke suspicious sessions, tokens, and application passwords. Changing only your WordPress or Laravel administrator password is insufficient if an attacker still controls another access point.

Step 4: Remove Malware and Restore Clean Files

Identify the initial entry point and remove malicious code, unauthorized accounts, injected database records, and persistence mechanisms. Replace compromised application files with trusted copies rather than relying on selective deletion.

If you have a verified clean backup from before the compromise, restoring it may be the fastest recovery option. However, restoration alone is not enough if the vulnerability that allowed the attack remains open.

For WordPress, reinstall trusted copies of the core software, themes, and plugins, and carefully inspect the uploads directory and database.

For Laravel or custom PHP applications, compare the codebase against a trusted Git revision, review dependencies, rotate exposed environment secrets, and inspect server-level access. Never assume that replacing the application source code automatically removes a backdoor elsewhere on the server.

Step 5: Identify and Fix the Original Vulnerability

This is one of the most important parts of recovery. If you remove the malware without fixing the entry point, your website can be compromised again.

Common causes include:

  • Outdated WordPress installations, plugins, themes, or PHP packages.
  • Weak or reused administrator passwords.
  • SQL injection and cross-site scripting vulnerabilities.
  • Insecure file upload functionality.
  • Incorrect file permissions and exposed configuration files.
  • Leaked database credentials or API keys.
  • Compromised hosting accounts and insecure deployment processes.

For Laravel projects, review authorization policies, validation, authentication, dependency versions, file upload handling, and environment configuration. Never expose your .env file publicly, and avoid placing sensitive credentials in source control.

Depending on the incident, you may need a broader application security review rather than a simple malware removal.

Step 6: Verify the Cleanup and Request a Google Review

After cleaning the website, run security scans again, inspect the affected URLs, review administrator accounts, and monitor server logs for recurring suspicious activity.

If Google Search Console reported security problems, use its Security Issues report to review the remaining findings. Once all identified problems have been resolved, request a security review through Search Console.

Google needs to verify that the reported problems have been fixed. Removing a warning from the browser or deleting a suspicious page does not automatically mean that the underlying security problem has been resolved.

Common Website Security Problems by Platform

The investigation process depends partly on the technology powering your website. Different platforms have different attack surfaces and recovery requirements.

PlatformCommon warning signsWhat to investigate
WordPressSpam pages, unknown admins, redirectsPlugins, themes, core files, uploads, database
LaravelSuspicious PHP files, exposed data, unauthorized accessAuthentication, policies, dependencies, logs, server access
Plain PHPInjected scripts, modified files, unusual requestsInput validation, file uploads, database queries, permissions
WooCommerceSuspicious orders, checkout redirects, modified productsWordPress security, payment integrations, webhooks, administrator access
React applicationsUnexpected frontend scripts, compromised API responsesBuild pipeline, hosting, dependencies, API authentication and backend security

Remember that frontend and backend compromises are different. A React application may display malicious content because its API or hosting environment has been compromised, even when its frontend source code is unchanged.

How to Prevent Your Website From Being Hacked Again

After recovery, put a practical security routine in place. You do not need an unnecessarily complicated security setup, but you should consistently maintain the parts that protect your website.

  • Keep software updated: Apply security updates to PHP, Laravel, WordPress, plugins, themes, and dependencies.
  • Use strong authentication: Use unique passwords, multi-factor authentication, and restricted administrator access.
  • Maintain regular backups: Keep automated backups of website files and databases, preferably with an isolated copy that attackers cannot easily modify.
  • Protect sensitive files: Prevent public access to environment files, database backups, configuration files, and other private resources.
  • Validate user input: Use proper validation, authorization checks, parameterized database queries, and safe output handling.
  • Secure file uploads: Validate file types and content, generate safe filenames, restrict executable uploads, and store user files appropriately.
  • Monitor website activity: Review authentication events, administrator changes, server logs, and unusual traffic.
  • Use HTTPS and secure connections: Use HTTPS for website traffic and SFTP or SSH instead of unencrypted FTP.
  • Limit user permissions: Give developers, editors, and administrators only the access they need.

For additional guidance, see the official WordPress hacked website recovery guide and Google's documentation on hacked content.

When Should You Get Professional Website Malware Removal?

Some security problems are straightforward. For example, removing an unauthorized administrator account after confirming that the account was created accidentally may not require a full incident response.

However, professional investigation is advisable when:

  • Your website repeatedly becomes infected after cleanup.
  • You cannot identify how the attacker gained access.
  • Malicious PHP code or hidden backdoors are present.
  • Your website has been blacklisted or flagged by Google.
  • Customer information, payment-related data, or sensitive credentials may have been exposed.
  • You have multiple applications sharing the same compromised hosting environment.
  • You cannot safely restore the website without risking further data loss.

I work with Laravel, PHP, WordPress, and WooCommerce applications, so I approach these problems by examining both the application code and the environment in which it runs. Depending on the incident, the investigation may include malware identification, suspicious file analysis, database inspection, credential rotation, vulnerability fixes, and post-cleanup verification.

You can learn more about my website malware removal services if your website needs a structured cleanup. If the incident also involves application errors or broken functionality, my website bug fixing services may also be relevant.

Frequently Asked Questions

Can I tell if my website has been hacked without logging in?

Yes. You can inspect your public website, search Google for unfamiliar pages, check browser security warnings, and use external malware scanners. However, identifying hidden backdoors, unauthorized accounts, and database changes generally requires hosting or application access.

Can a website be hacked without showing any signs?

Yes. Attackers may install backdoors, steal data, or create hidden administrator accounts without visibly changing your website. Regular file integrity checks, security monitoring, access reviews, and server log analysis help identify these less obvious compromises.

Does a Google Safe Browsing warning mean my website has been hacked?

It can indicate that Google has detected potentially dangerous content or behavior associated with your website. Investigate the specific warning and affected URLs. Also consider whether a third-party script or external resource is responsible.

Can I recover a hacked website using a backup?

Yes, if the backup is verified as clean and was created before the compromise. However, you must also identify and fix the original vulnerability, rotate exposed credentials, and check for backdoors outside the restored files and database.

How long does it take to remove website malware?

It depends on the size of the website, the type of infection, the number of affected files, and whether the attacker compromised the hosting environment. A straightforward infection may be resolved relatively quickly, while a persistent compromise involving multiple applications or exposed customer data requires a more extensive investigation.

Is my website safe if a malware scanner reports no threats?

Not necessarily. Automated scanners can miss new, hidden, or obfuscated malware, unauthorized access, and compromised credentials. A reliable security assessment should combine scanning with manual investigation of application files, database records, access permissions, and server activity.

Final Thoughts

If you are asking, "Have I been hacked?" do not rely on how your homepage looks or whether a security scanner reports a clean result. Check your Google Search Console reports, inspect unfamiliar pages, review administrator accounts, compare website files, and investigate server activity.

If you discover a compromise, preserve evidence, contain the incident, secure access credentials, remove malicious code, and fix the original vulnerability before considering the recovery complete. These steps help protect your visitors, business data, search visibility, and the long-term reliability of your website.

Comments

No comments yet. Did this work for you, or did you hit something different? Ask below.

Leave a comment

Comments are reviewed before they appear. Your email is never shown.

About Me

I help startups and SMEs ship reliable products using Laravel, React, Vue.js, SQL & Firebase - with clean code, clear communication, and measurable results.